-
1. Re: Problems in JBoss with Jetty and Tomcat
jules Sep 20, 2002 6:31 AM (in response to tsangcn)Re: Jetty.
You should be able to prevent the cache of your compiled JSPs from being removed between deployments by telling Jasper not to do so. This is detailed in the FAQ :
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jboss/contrib/jetty/FAQ?rev=HEAD&content-type=text/vnd.viewcvs-markup
Look at the item entitled:
"Don't delete JSP compilation results between JBoss instances."
I think you may also have to move the JSP compilation cache outside of the Jetty temporary dir, which will probably be deleted on redeployment. If there is not enough information for you here - ask on jetty-support@yahoogroups.com.
If you work it out, please post your solution back to the forum and I will update the FAQ accordingly.
If you simply symbolically linked your app unpacked into the JBoss deployment directory, you should be able to edit JSPs within the deployed app. Jasper should spot JSPs that have been modified and rebuild them the next time that they are hit. This would mean that you would never have to redeploy your app - alos resolving the problem above.
Finally, to speed up development, toggle the Java2ClassLoadingCompliance (also mentioned in the FAQ)
flag in your /deploy/jbossweb/META-INF/jboss-service.xml. This will result in calls to your EJB tier no longer being optimised (since the calls will cross classloaders), but classloading (a bottleneck with JSPs) will be much faster since it will use Jetty's classloader, which is much simpler and therefore faster than the JBoss UCL.
Try all of this and see how you get on and persevere with Jetty !
Good luck,
Jules -
2. Re: Problems in JBoss with Jetty and Tomcat
tsangcn Sep 23, 2002 1:39 AM (in response to tsangcn)Hello Jules,
I think I found something maybe a bug in Jetty or Jasper ?
First, the results of your suggestions.
(1) "Don't delete JSP compilations results between JBoss instances"
the remarks in the webdefault.xml says the "keepgenerated" parameter is to control whether to keep the generated Java source code for each page, but not the compiled Java class.
And its default value is true.
I have tested keepgenerated as true and also false in webdefault.xml, and found that it only affects the generated Java source code.
So it does not help to my problem.
(2) the Java2ClassLoadingCompliance parameter in jboss-service.xml is originally true.
I have try setting to false, as you suggested. But the result get worse.
I got the exception
java.lang.ClassCastException: org.firebirdsql.jdbc.FBDataSource
when it execute the statement
DataSource ds = (DataSource)jndiContext.lookup("java:comp/env/jdbc/AppDS");
But it is OK when the parameter is true.
------
I have try to look at the source code of Jasper, it determines the location for generated stuff by
- first using scratchdir in webdefault.xml
- or, using javax.servlet.context.tempdir in servlet context, default is $TEMP/Jetty____
- or, using java.io.tmpdir in System property, default is $TEMP
only javax.servlet.context.tempdir does contains port and context, the other two not.
So if I specified scratchdir in webdefault.xml but I deploy 2 EAR with similar structure, the 2 JSPs will MESS up.
Is this a bug or a design purpose?
------
My main problem still have not solved.
I have the following discovery.
I have set scratchdir to a directory say /work
I have set keepgenerated to true
I look at the files in /work every time I restart JBoss.
I found that the last modification date of the files in /work always changes to the time when I invoke the JSP.
==> Jasper always recompile JSP after JBoss restart
Please help to solve.
Thanks
CN -
3. Re: Problems in JBoss with Jetty and Tomcat
tsangcn Sep 23, 2002 1:42 AM (in response to tsangcn)Hello Jules,
I think I found something maybe a bug in Jetty or Jasper ?
First, the results of your suggestions.
(1) "Don't delete JSP compilations results between JBoss instances"
the remarks in the webdefault.xml says the "keepgenerated" parameter is to control whether to keep the generated Java source code for each page, but not the compiled Java class.
And its default value is true.
I have tested keepgenerated as true and also false in webdefault.xml, and found that it only affects the generated Java source code.
So it does not help to my problem.
(2) the Java2ClassLoadingCompliance parameter in jboss-service.xml is originally true.
I have try setting to false, as you suggested. But the result get worse.
I got the exception
java.lang.ClassCastException: org.firebirdsql.jdbc.FBDataSource
when it execute the statement
DataSource ds = (DataSource)jndiContext.lookup("java:comp/env/jdbc/AppDS");
But it is OK when the parameter is true.
------
I have try to look at the source code of Jasper, it determines the location for generated stuff by
- first using scratchdir in webdefault.xml
- or, using javax.servlet.context.tempdir in servlet context, default is $TEMP/Jetty____
- or, using java.io.tmpdir in System property, default is $TEMP
only javax.servlet.context.tempdir does contains port and context, the other two not.
So if I specified scratchdir in webdefault.xml but I deploy 2 EAR with similar structure, the 2 JSPs will MESS up.
Is this a bug or a design purpose?
------
My main problem still have not solved.
I have the following discovery.
I have set scratchdir to a directory say /work
I have set keepgenerated to true
I look at the files in /work every time I restart JBoss.
I found that the last modification date of the files in /work always changes to the time when I invoke the JSP.
==> Jasper always recompile JSP after JBoss restart
Please help to solve.
Thanks
CN -
4. Re: Problems in JBoss with Jetty and Tomcat
tsangcn Sep 24, 2002 1:58 AM (in response to tsangcn)Hello,
I found something which I have discussed about in
http://www.jboss.org/modules/bb/index.html?module=bb&op=viewtopic&t=forums/ EAR is deployed, the EAR is unpacked in $JBOSS_HOME/server/default/tmp/delploy/server/default/deploy/...
and the WAR within the EAR is unpacked to $TEMP/Jetty_____/webapp
But the last modified date of the unpacked files are touched to the current date.
Although I have specified "keepgenerated" and "scratchdir" in webdefault.xml,
the JSP are always more current than the generated stuff after unpacked,
so this causes the recompilation of JSP everytime the EAR is deployed.
I have tested and prove that if JSP is unpacked with date unmodifed, JSP recompilation will not occur, provided scratchdir is not default.
In JBoss 2.4.4, the JSP are unpacked with the date unchanged.
Why in JBoss 3.0.2, the JSP are unpacked and touched to the current date?
Is is possible for JBoss 3.0.2, and after, to unpacked JSP untouched so that JSP recompilation will not be happen?
Thanks
CN