migrating to a different java and tomcat version

i developed an application using j2sdk1.4 and tomcat 4.1.is it possible to deploy that in j2ee and tomcat5? will there be any problems?
[149 byte] By [shuinia] at [2007-10-2 0:49:11]
# 1

> i developed an application using j2sdk1.4 and tomcat

> 4.1.

>

> is it possible to deploy that in j2ee and tomcat5?

> will there be any problems?

j2sdk 1.4 migration to j2ee - what did you develop using j2sdk1.4 alone that was deployed in tomcat 4.1 ? :)

Tomcat 5 will accomodate any java web application upto j2ee 1.3 (ie servlets 2.3 and jsp 1.1). I havent worked on tomcat for earlier versions, so I cant tell much about that.

If you have developed a web application on tomcat 4.1 and wish to migrate to 5.0, your code as such would work fine I guess (though there may be better ways to do a lot of things). The things to look out for would be the application deployment itself - like setting up connection pools etc. Anyways give it a shot and post here when you have specific issues.

cheers,

ram.

Madathil_Prasada at 2007-7-15 17:59:19 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
i did a web application using jsp and java beans in j2se with tomcat4.1they wanted to deploy it using the latest in j2ee and tomcat
shuinia at 2007-7-15 17:59:19 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

>i did a web application using jsp and java beans in j2se with tomcat4.1

That would be j2ee.

j2se is the java standard environment which doesnt contain functionalities for jsp, servlets and the like.

Regarding the migration, all i said in the previous post holds.

ram.

Madathil_Prasada at 2007-7-15 17:59:19 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
no actually, i used j2se. it's possible to use jsp's and java beans with j2se
shuinia at 2007-7-15 17:59:19 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5

Nops, jsps are still converted to servlets remember.

And the servlet library is not contained in j2se's jar. It works because tomcat by default has the servlet's jar files in its library. (in common/lib)

Also at development time, you dont have to compile anything if its pure jsps. At runtime, they become servlets which then accesses libraries not found in j2se. But since tomcat provides it by default, it still works.

Yes, beans do not require any j2ee specific pkgs.

ram.

Madathil_Prasada at 2007-7-15 17:59:19 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 6
oh ok. so there would be no problem then.the existing setup already has one application running. won't there be any problems with that?
shuinia at 2007-7-15 17:59:19 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 7

As I said in my first post, code-wise I dont think anything would break for a straight forward applications. You will have to setup the jar files that you use in the application in the new server ....blah blah.

If your application depends on some server admin specific setup in server.xml like datasources for connection pooling, then you need to know if there's a difference in the way things were done in 4.1 and are done in 5.x.

By what you are saying, its pretty simple and straightforward (only jsp and beans) and I think you will not have any problems.

Oh, one thing - I dont know if tomcat 4.1 enforces that the bean class have to be packaged. I hope you have them so anyways, else it wouldnt work in 5.x

The only way to find out otherwise is to go for it. There will be issues, of that Iam sure, though none would be blockers. Set it up on your local machine and try it out.

cheers,

ram.

Madathil_Prasada at 2007-7-15 17:59:19 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 8
ok thanks
shuinia at 2007-7-15 17:59:19 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 9
just a follow up and some clarifications regarding j2se running on tomcat.since it runs because tomcat by default has the servlet jars in its library,would jsps in j2se still run if another application server, other than tomcat, was used?
shuinia at 2007-7-15 17:59:19 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 10
and also, can i still use j2se and tomcat even if i do jstl and jsf?
shuinia at 2007-7-15 17:59:19 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 11

> just a follow up and some clarifications regarding

> j2se running on tomcat.

>

> since it runs because tomcat by default has the

> servlet jars in its library,would jsps in j2se still

> run if another application server, other than tomcat,

> was used?

yes, most servers would have the api jars in their classpath. It may have a different name, but nonetheless present.

cheers,

ram.

Madathil_Prasada at 2007-7-15 17:59:19 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 12
> and also, can i still use j2se and tomcat even if i> do jstl and jsf?Both jstl and jsf require additional jar files.ram.
Madathil_Prasada at 2007-7-15 17:59:19 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 13
so would i need j2ee then? or just add the additional jars and still use j2se?
shuinia at 2007-7-15 17:59:19 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 14
Additional jars would suffice - you should know which ones though :). And they are not part of j2ee jar pkgs(atleast jsf) so that even if you have j2ee jar apis, you would still need the additional jars.ram.
Madathil_Prasada at 2007-7-15 17:59:19 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 15
so what would be the difference if i use j2se or j2ee for the web when it would still run and i would still need additional jars either way?
shuinia at 2007-7-20 14:34:43 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 16

Hmmm...., see it depends on what kind of facilities your web application uses. For example, if there's a mail service, you would want the java mail apis. If your web application connects to an app server that runs ejbs, you would want the ejb apis on your cp and so on. Similarly if you want to work with xml, you would need the jaxp apis.

All of these are bundled into one j2ee jar file rather than having seperate jar files for each.

Such jar files are usually provided by the servers themselves (just like how tomcat provides you with the servlet-api.jar).

In your case, since you are running a web application and all you require is jstl and jsf, you just use the corresponding jar files for both. The servlet-api.jar gives you the servlet and jsp api required for web applications (remember these are still subsets of the j2ee jars). And since its tomcat you need to have java (j2se) installed externally.

cheers,

ram.

Madathil_Prasada at 2007-7-20 14:34:43 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 17

Oh and btw, I think both stl and jsf jars are subsets of j2ee jars (just like the servlet-api.jar which provides servlet and jsp apis ).

Hence I think they would be available in the j2ee jars in those versions that include jstl and jsf (j2ee 1.4, I guess). Which in turn means that if you use an app server that supports j2ee 1.4 (not tomcat, that's a webserver), the server would provide you with a jar file that would include jstl/jsf etc.

Ram.

Madathil_Prasada at 2007-7-20 14:34:43 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 18

ok. i had to read that twice just to comprehend. lol

i kinda get it a bit now.

so ur saying that if i use j2ee and i have a mail service, i wouldn't have to download the javamail api?

because i used mail service and had to download the api because i am using j2ee.

so basically the main difference is that, all the apis are already bundled in j2ee while i have to separately download them when using j2se. but it would still work either way. right? so j2ee just basically provides more convenience.....

shuinia at 2007-7-20 14:34:43 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 19

>

> so ur saying that if i use j2ee and i have a mail

> service, i wouldn't have to download the javamail

> api?

> because i used mail service and had to download the

> api because i am using j2ee.

>

sorry, i meant i was using j2SE and still had to download javamail

shuinia at 2007-7-20 14:34:43 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 20

>so basically the main difference is that, all the apis are already >bundled in j2ee while i have to separately download them when using >j2se. but it would still work either way. right?

Absolutely. However I dont know if all components have such jars specific to that component and which can be dowloaded on a 'required' basis.

>so ur saying that if i use j2ee and i have a mail service, i wouldn't have >to download the javamail api?

Bingo

>because i used mail service and had to download the api because i >am using j2ee.

Did you mean 'i am using j2se' ?

>j2ee just basically provides more convenience.....

Yes, its kind of that, though I dont know if I would use the word 'convenience', lol :)

cheers,

ram.

Madathil_Prasada at 2007-7-20 14:34:43 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 21

> >j2ee just basically provides more convenience.....

>

> Yes, its kind of that, though I dont know if I would

> use the word 'convenience', lol :)

>

There's a bigger issue here - that of versioning. Assume you have the j2ee1.4.jar available. That would ensure that you would be using the

1. servlet 2.4 spec

2. jsp 1.2 spec

3. ejb 2.1 spec and so on........

Java's versioing of j2ee and the individual components that make it is pure hell, to say the least.

So using a j2ee version specific jar would ensure that your individual components support the version they have to abide by in the j2ee spec.

What that means is that theoretically, its possible that you may download a version of servlet/jsp (that abides by the j2ee 1.3 spec), a version of javamail (thata abides by the j2ee 1.4 spec) and a version of, say ejb (that goes by the 1.2 spec). Needless to say, that's version hell, one that you can do without :)

ram.

Madathil_Prasada at 2007-7-20 14:34:43 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 22
ohh.okay....thank you sooo much...........that really helped:-)
shuinia at 2007-7-20 14:34:43 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 23
so if you're using j2se and you want a certain component, you might get different versions of each, while if you have j2ee, you're ensured that they are of the same version.is that it?so it's a convenience thingy....
shuinia at 2007-7-20 14:34:43 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 24

> so if you're using j2se and you want a certain

> component, you might get different versions of each,

> while if you have j2ee, you're ensured that they are

> of the same version.

>

> is that it?

Yes.

>

> so it's a convenience thingy....

It also helps you with all your version maintenance nightmares :)

ram.

Madathil_Prasada at 2007-7-20 14:34:43 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 25
will different components not work if you have different versions of them?
shuinia at 2007-7-20 14:34:43 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 26

> will different components not work if you have

> different versions of them?

First you have to have a server that supports the highest versionable component. For example, if you are using weblogic 9.1, that supports j2ee 1.3 only. So its no use trying to get servlet 2.4 or jsp 1.2 features working.

Most components provide backward compatibility, but that should be progressive. It may be better to have components in the lower part of the app chain to be of a higher version than the other way. I havent done such things, so I cant say for sure.

ram.

Madathil_Prasada at 2007-7-20 14:34:43 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 27
ok.i learned a lot from you today.thank you :-)
shuinia at 2007-7-20 14:34:43 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 28

Tomcat 5 behaves differently from Tomcat 4 in the way it displays a null value.

Using Tomcat 4 you could populate a form with fields from a database and and null values would appear blank. Using Tomcat 5 the word "null" is displayed. I forget which forum it was I found this issue discussed, most affected punters like myself viewed it as a bug. We were all assured it now works to spec.

Go for Tomcat 5, other than the above it is heaps better than Tomcat 4.

voka at 2007-7-20 14:34:43 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...