This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes IDEs, Version Control and other tools and the fly likes HTTP 500 Error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "HTTP 500 Error" Watch "HTTP 500 Error" New topic
Author

HTTP 500 Error

Luis Candelas
Greenhorn

Joined: Jun 19, 2012
Posts: 6
Hi, I have an application deployed in Weblogic 10 and in Tomcat 6. In WL, it works perfectly. However, in the other case, this error appears in navigator:

Estado HTTP 500 -

--------------------------------------------------------------------------------

type Informe de Excepción

mensaje

descripción El servidor encontró un error interno () que hizo que no pudiera rellenar este requerimiento.

excepción

org.apache.jasper.JasperException: java.lang.NullPointerException
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:536)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:368)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)


causa raíz

java.lang.NullPointerException
org.apache.jsp.index_jsp._jspInit(index_jsp.java:22)
org.apache.jasper.runtime.HttpJspBase.init(HttpJspBase.java:52)
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:164)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:338)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)


Someone knows which is the problem? Application works fine in Weblogic, but not in Tomcat. I have read in another site that cause can be JARs in classpath servlet-api.jar and others because those are in Tomcat library directory too. These JARs can't be removed from classpath baceuse they are necessary to project compilation.

Someone can help me?

P.S.: I'm spanish. Don't use strange words in ansrwers, please. English is not my mother tongue.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15962
    
  19

English is not the mother tongue of many who visit the JavaRanch. We try to keep it simple.

WebLogic is a "full-stack" J2EE server. Tomcat is not. Therefore it is possible to use many advanced services under WebLogic that Tomcat does not provide. You could also experience problems if the J2EE standard levels are different between the version of Tomcat you are using and the version of WebLogic you are using.

However, you should never include the servlet jars in the WEB-INF/lib directory of any webapp, whether it runs WebLogic, Tomcat, or even IBM WebSphere. The servlet classes are part of the server, not part of the application and their implementations are not only specific to the server, they have internal constructions such that serious conflicts will occur.

You can - and should (must!) - compile with the servlet api jar in the COMPILER classpath, but you should NOT copy that jar to the WAR.

You will also find that life is more agreeable if you do not put Java code in JSPs. Plus, Bear will not remonstrate you for doing so.


Customer surveys are for companies who didn't pay proper attention to begin with.
Luis Candelas
Greenhorn

Joined: Jun 19, 2012
Posts: 6
Tim Holloway wrote:English is not the mother tongue of many who visit the JavaRanch. We try to keep it simple.

WebLogic is a "full-stack" J2EE server. Tomcat is not. Therefore it is possible to use many advanced services under WebLogic that Tomcat does not provide. You could also experience problems if the J2EE standard levels are different between the version of Tomcat you are using and the version of WebLogic you are using.

However, you should never include the servlet jars in the WEB-INF/lib directory of any webapp, whether it runs WebLogic, Tomcat, or even IBM WebSphere. The servlet classes are part of the server, not part of the application and their implementations are not only specific to the server, they have internal constructions such that serious conflicts will occur.

You can - and should (must!) - compile with the servlet api jar in the COMPILER classpath, but you should NOT copy that jar to the WAR.

You will also find that life is more agreeable if you do not put Java code in JSPs. Plus, Bear will not remonstrate you for doing so.


Ok, but I've checked that JARs in WEB-INF/lib is not the cause of problem. Error also appears.

Line 22 of index_jsp.java is:


Any idea?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15962
    
  19

Check to see if you have an el.jar (name may vary slightly) in your WEB-INF/lib. In Tomcat 5, this was required. In Tomcat 6 the EL jar became an integral part of Tomcat. Plus, the Tomcat6 EL is Unified EL, I think, so the incompatibilities are magnified. So you should remove the EL jar file from the Tomcat WAR if it is present.
Luis Candelas
Greenhorn

Joined: Jun 19, 2012
Posts: 6
Tim Holloway wrote:Check to see if you have an el.jar (name may vary slightly) in your WEB-INF/lib. In Tomcat 5, this was required. In Tomcat 6 the EL jar became an integral part of Tomcat. Plus, the Tomcat6 EL is Unified EL, I think, so the incompatibilities are magnified. So you should remove the EL jar file from the Tomcat WAR if it is present.


Really, problem does cause by JAR servlet-api.jar It is being included in deployment because of referenced projects in web project. If I rename manually JAR file, it works. Now I investigate how to avoid JAR be included in deployment.

Thanks for your help.
Luis Candelas
Greenhorn

Joined: Jun 19, 2012
Posts: 6
The problem is always it includes jsp-api.jar in deployment if it is in the classpath (although it's not in WEB-INF/lib). The JAR is necessary in order to project be compiled. How to say to Tomcat that JAR should be ignored and not be included in the deployment? Is possible?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15962
    
  19

If you are using the Ant or Maven build tools, it's easy to compile code with the J2EE jars in the compiler classpath and then produce a WAR without them in it.
Luis Candelas
Greenhorn

Joined: Jun 19, 2012
Posts: 6
Tim Holloway wrote:If you are using the Ant or Maven build tools, it's easy to compile code with the J2EE jars in the compiler classpath and then produce a WAR without them in it.


No, I'm using MyEclipse deploy tool and deploying in exploded archive.

Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15962
    
  19

I recommend that you inquire in the IDEs forum, then.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HTTP 500 Error
 
Similar Threads
HTTP Status 500 - when testing Crystal report for an Integration with Maximo
org.apache.jasper.JasperException: java.lang.NullPointerException: Module 'null' not found.
Unable to compile class for JSP
how to apply theme as ajax to the jsp form with struts2-core-2.1.6.jar used struts 2 application ?
Suddenly stopped working