IT Community - Software Programming, Web Development and Technical Support

JavaServer Pages (JSP) and JSTL-JSP compiler problem

This is a discussion on JavaServer Pages (JSP) and JSTL-JSP compiler problem within the Java Server Pages (JSP) forums, part of the Web Development category; Hi, I have a JSP based web application that works well when deployed in Tomcat 6. I am trying to ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > Java Server Pages (JSP)

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 09-18-2007, 06:02 AM
leoraja8 leoraja8 is offline
D-Web Sr.Programmer
 
Join Date: May 2007
Posts: 194
leoraja8 is on a distinguished road
Default JavaServer Pages (JSP) and JSTL-JSP compiler problem

Hi,

I have a JSP based web application that works well when deployed in Tomcat 6. I am trying to deploy it in jboss 4.2.1, everything seems to be ok but when I try to access to a JSP page I have the following error

java.lang.IllegalStateException: No Java compiler available
org.apache.jasper.JspCompilationContext.createComp iler(JspCompilationContext.java:229)
org.apache.jasper.JspCompilationContext.compile(Js pCompilationContext.java:561)
org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:311)
org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet .java:803)

my JAVA_HOME is set to use a JDK 1.5, but it should work with a JRE as the Tomcat embedded in jboss has its own compiler. I changed the web deployer configuration to use the sun compiler instead of the default but I have the same problem despite tools.jar is in the classpath. Has someone had this problem before or could someone help me on the issue ?

Thanks,
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 09-18-2007, 06:08 AM
amansundar amansundar is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 325
amansundar is on a distinguished road
Default Re: JavaServer Pages (JSP) and JSTL-JSP compiler problem

This would probably be better posted in a JBoss forum.

You might want to reformulate your question before posting though, as your current question sounds too much like "can I deploy a JSP based web application on JBoss", which could bring you some flaming replies.
__________________
cheers
Aman
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 09-18-2007, 06:10 AM
jeyaprakash.c jeyaprakash.c is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 228
jeyaprakash.c is on a distinguished road
Default Re: JavaServer Pages (JSP) and JSTL-JSP compiler problem

So what is in the JBOSS log at startup?
It should display the JAVA_HOME settings among other things.

Where have you changed the web deployer config?
__________________
thanx n regards
jeyaprakash.c
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 09-18-2007, 06:12 AM
leoraja8 leoraja8 is offline
D-Web Sr.Programmer
 
Join Date: May 2007
Posts: 194
leoraja8 is on a distinguished road
Default Re: JavaServer Pages (JSP) and JSTL-JSP compiler problem

Hi,
here is what JBOSS displays at startup, everything seems to be right and points to a JDK

JBOSS_HOME: D:\java\jboss\jboss-4.2.1.GA

JAVA: D:\java\jdk1.5.0_12\bin\java

JAVA_OPTS: -Djava.library.path="D:\java\jboss\jboss-4.2.1.GA\bin\native;..." -Dprogram.name=run.bat -server -Xms256m -Xmx512m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000

CLASSPATH: D:\java\jdk1.5.0_12\lib\tools.jar;D:\java\jboss\jb oss-4.2.1.GA\bin\run.jar

To use sun compiler instead of jdt in tomcat I modified web.xml in JBOSS_HOME\server\default\deploy\jboss-web.deployer\conf and added the following to the jsp servlet configuration

<init-param>
<param-name>compilerClassName</param-name>
<param-value>com.sun.tools.javac.main.Main</param-value>
</init-param>
<init-param>
<param-name>compilerTargetVM</param-name>
<param-value>1.5</param-value>
</init-param>
<init-param>
<param-name>compilerSourceVM</param-name>
<param-value>1.5</param-value>
</init-param>

but I have the same error as when I use the jdt compiler. I'm clueless on what else I could try from here, I posted also the issue on jboss forums last week but haven't got an answer so far, I suspect a classloader side effect with my application as I get the same error accessing the jboss web-console only when my application is deployed.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 09-18-2007, 06:15 AM
amansundar amansundar is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 325
amansundar is on a distinguished road
Default Re: JavaServer Pages (JSP) and JSTL-JSP compiler problem

In you web app, do you embark JARs in WEB-INF/lib that you should not and that could conflict with Jasper?
__________________
cheers
Aman
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 09-18-2007, 06:17 AM
leoraja8 leoraja8 is offline
D-Web Sr.Programmer
 
Join Date: May 2007
Posts: 194
leoraja8 is on a distinguished road
Default Re: JavaServer Pages (JSP) and JSTL-JSP compiler problem

I checked that before and removed log4j.jar and commons-logging.jar from my application as they are already in JBOSS_HOME/server/default/lib but I have the same issue
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 09-18-2007, 06:20 AM
amansundar amansundar is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 325
amansundar is on a distinguished road
Default Re: JavaServer Pages (JSP) and JSTL-JSP compiler problem

No buggers like servlet.jar, jasper.jar...?

It's hard to figure out the issue without some extra info, especially for something that sounds as trivial as deploying a web application on JBoss.

Can you try again on a fresh install of JBoss?

Have you tried to reduce the complexity of your application until you narrow down the problem location?
__________________
cheers
Aman
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 09-18-2007, 06:23 AM
jeyaprakash.c jeyaprakash.c is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 228
jeyaprakash.c is on a distinguished road
Default Re: JavaServer Pages (JSP) and JSTL-JSP compiler problem

Ok, so what jar files ARE left in your WEB-INF/lib directory?
__________________
thanx n regards
jeyaprakash.c
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 09-18-2007, 06:26 AM
leoraja8 leoraja8 is offline
D-Web Sr.Programmer
 
Join Date: May 2007
Posts: 194
leoraja8 is on a distinguished road
Default Re: JavaServer Pages (JSP) and JSTL-JSP compiler problem

I have the following third party jars remaining in my WEB-INF/lib

axis-schema.jar
axis.jar
commons-dbcp-1.2.1.jar
commons-discovery.jar
commons-fileupload-1.0.jar
commons-pool-1.3.jar
jaxrpc.jar
jms.jar
ldap.jar
ldapjdk.jar
mail.jar
ojdbc14.jar
saaj.jar
wsdl4j.jar

my application runs also a web service using axis, I removed the axis servlet from the web.xml and all the jars related to it but I still have the issue
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 09-18-2007, 06:27 AM
leoraja8 leoraja8 is offline
D-Web Sr.Programmer
 
Join Date: May 2007
Posts: 194
leoraja8 is on a distinguished road
Default Re: JavaServer Pages (JSP) and JSTL-JSP compiler problem

I tried with a fresh install of jboss on a different machine and I have the same issue, I tried also jboss 4.0.5 instead of 4.2.1 and I had the problem also
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #11 (permalink)  
Old 09-18-2007, 07:08 AM
amansundar amansundar is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 325
amansundar is on a distinguished road
Default Re: JavaServer Pages (JSP) and JSTL-JSP compiler problem

Though some jars are probably useless (mail, jms...) because provided by the J2EE container, I do not see anything there that could disrupt JSP compilation.

One crazy idea: your web.xml targets Servlet 2.5/JSP 2.1 (ie JEE 5.0), which is fine on TC6, but not ok for JBoss 4.x that supports only Servlet 2.4/JSP 2.0
(ie J2EE 1.4).

?

PS. I notice that you use DBCP and not JBoss connection pooling: why?
__________________
cheers
Aman
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #12 (permalink)  
Old 09-18-2007, 07:10 AM
leoraja8 leoraja8 is offline
D-Web Sr.Programmer
 
Join Date: May 2007
Posts: 194
leoraja8 is on a distinguished road
Default Re: JavaServer Pages (JSP) and JSTL-JSP compiler problem

I still have the issue after removing some more jars and the application web.xml doesn't target Servlet 2.5/JSP 2.1 so it should be fine. The application has never been deployed on jboss but was build against tomcat and we are in the process of migrating it to jboss, that's why we are not taking advantage of everything that jboss is offering right now.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #13 (permalink)  
Old 09-18-2007, 07:12 AM
amansundar amansundar is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 325
amansundar is on a distinguished road
Default Re: JavaServer Pages (JSP) and JSTL-JSP compiler problem

All in all, this does not make sense or is a world's premiere, but this does not help you.

Do you precompile your JSPs? Do you declare them as servlets in your web.xml?
__________________
cheers
Aman
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #14 (permalink)  
Old 09-18-2007, 07:13 AM
leoraja8 leoraja8 is offline
D-Web Sr.Programmer
 
Join Date: May 2007
Posts: 194
leoraja8 is on a distinguished road
Default Re: JavaServer Pages (JSP) and JSTL-JSP compiler problem

Yes I tried that also, I precompiled the JSPs to see if it solves my issue but no luck, strangely in this case jboss logs report the same exception "no java compiler available" but why is it looking for a compiler in this case ?
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #15 (permalink)  
Old 09-18-2007, 07:15 AM
amansundar amansundar is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 325
amansundar is on a distinguished road
Default Re: JavaServer Pages (JSP) and JSTL-JSP compiler problem

Honestly, at this point, without having a look at your WAR, I do not see what I can tell you further, as you seem to have thoroughly investigated the issue. Did you get any luck on the JBoss forums?
__________________
cheers
Aman
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pascal Compiler drecko Pascal and Delphi 2 11-06-2007 03:43 AM
UNIX OS with CC compiler & TC compiler vigneshgets C and C++ Programming 0 08-01-2007 12:28 AM
compiler & interpreter nssukumar C and C++ Programming 0 07-17-2007 11:24 PM
PHP on pages without a .php extension sivaramakrishnan PHP Programming 1 07-17-2007 07:54 AM
Which C++ compiler do you guyz use? drecko C and C++ Programming 4 03-09-2007 03:57 AM


All times are GMT -7. The time now is 10:54 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0