Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » JSP ERROR!!!
JSP ERROR!!! [message #137797] Fri, 09 September 2005 14:57 Go to next message
Eclipse UserFriend
Originally posted by: claudia_rego.hotmail.com

help please....
I'm using Building a simple EJB Application.
Everything it's ok except when i invoke the bean's method in jsp page:

HTTP Status 500 -

description - The server encountered an internal error () that prevented
it from fulfilling this request.

What the problem??

Thanks claudia
Re: JSP ERROR!!! [message #137810 is a reply to message #137797] Fri, 09 September 2005 15:00 Go to previous messageGo to next message
James Lewis is currently offline James LewisFriend
Messages: 4
Registered: July 2009
Junior Member
Claudia Rego wrote:
>
> What the problem??

Hi Claudia,

500 errors can be caused by a practically limitless number of problems.
Is there an exception in the server's logs anywhere? That might provide
a bit more information.

Cheers,

James
Re: JSP ERROR!!! [message #137831 is a reply to message #137810] Fri, 09 September 2005 15:12 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: claudia_rego.hotmail.com

In the web browser, i get:


type Exception report

message

description The server encountered an internal error () that prevented it
from fulfilling this request.

exception

org.apache.jasper.JasperException
org.apache.jasper.servlet.JspServletWrapper.service(JspServl etWrapper.java:370)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServl et.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java :264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(Repl yHeaderFilter.java:81)


root cause

java.lang.NullPointerException
org.apache.jsp.testz_jsp._jspService(org.apache.jsp.testz_js p:59)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.ja va:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.apache.jasper.servlet.JspServletWrapper.service(JspServl etWrapper.java:322)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServl et.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java :264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(Repl yHeaderFilter.java:81)


note The full stack trace of the root cause is available in the Apache
Tomcat/5.5.9 logs.


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

Thanks
Re: JSP ERROR!!! [message #137865 is a reply to message #137831] Fri, 09 September 2005 17:26 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: hicham.dev.menara.ma

Claudia Rego wrote:
> In the web browser, i get:
>
>
> type Exception report
>
> message
> description The server encountered an internal error () that prevented
> it from fulfilling this request.
>
> exception
> org.apache.jasper.JasperException
> org.apache.jasper.servlet.JspServletWrapper.service(JspServl etWrapper.java:370)
>
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServl et.java:314)
>
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java :264)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
> org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(Repl yHeaderFilter.java:81)
>
>
>
> root cause
> java.lang.NullPointerException
> org.apache.jsp.testz_jsp._jspService(org.apache.jsp.testz_js p:59)
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.ja va:97)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
> org.apache.jasper.servlet.JspServletWrapper.service(JspServl etWrapper.java:322)
>
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServl et.java:314)
>
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java :264)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
> org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(Repl yHeaderFilter.java:81)
>
>
>
> note The full stack trace of the root cause is available in the Apache
> Tomcat/5.5.9 logs.
>
>
> ------------------------------------------------------------ ------------------
>
>
> Thanks
>

I assume you are using Jboss as EJB container, the latest version ? is
it supported by eclipse ?

hicham.
Re: JSP ERROR!!! [message #138281 is a reply to message #137865] Sun, 11 September 2005 21:42 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: claudia_rego.hotmail.com

Yes! You're right.
I'm using Eclipse 3.1 + WTP0.7 and JBoss4.0.2
Can you help me?
Have you followed this tutorial (Building a Simple EJB Application)?
Thanks Claudia
Re: JSP ERROR!!! [message #138420 is a reply to message #138281] Tue, 13 September 2005 11:35 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: claudia_rego.hotmail.com

Hello!
People I really need help...
Who accepted my project to make deploy in its machine?
Please
Thanks
Claudia
Re: JSP ERROR!!! [message #138431 is a reply to message #137831] Tue, 13 September 2005 13:23 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: wknauf_NO_._INSIDE_hg-online.de

Hi Claudia,

according to the error message there is a NullPointerException in your
JSP code.
Take a look at the java file which is generated from the jsp by jboss
(should be found somewhere in your jboss server, search for
"testz_jsp.java"). At line 59 of this file you should find the erranous
line. Please post this file here.

Best regards

Wolfgang

Claudia Rego wrote:

>
> root cause
> java.lang.NullPointerException
> org.apache.jsp.testz_jsp._jspService(org.apache.jsp.testz_js p:59)
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.ja va:97)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
> org.apache.jasper.servlet.JspServletWrapper.service(JspServl etWrapper.java:322)
>
Re: JSP ERROR!!! [message #138573 is a reply to message #138420] Tue, 13 September 2005 18:14 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: claudia_rego.hotmail.com

The code of zootest_jsp.java:

package org.apache.jsp;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import java.util.*;
import javax.naming.*;
import javax.rmi.PortableRemoteObject;
import com.zoo.Tiger;
import com.zoo.TigerHome;
import com.zoo.TigerUtil;

public final class zootest_jsp extends 
org.apache.jasper.runtime.HttpJspBase
    implements org.apache.jasper.runtime.JspSourceDependent {

  private static java.util.Vector _jspx_dependants;

  public java.util.List getDependants() {
    return _jspx_dependants;
  }

  public void _jspService(HttpServletRequest request, HttpServletResponse 
response)
        throws java.io.IOException, ServletException {

    JspFactory _jspxFactory = null;
    PageContext pageContext = null;
    HttpSession session = null;
    ServletContext application = null;
    ServletConfig config = null;
    JspWriter out = null;
    Object page = this;
    JspWriter _jspx_out = null;
    PageContext _jspx_page_context = null;


    try {
      _jspxFactory = JspFactory.getDefaultFactory();
      response.setContentType("text/html; charset=ISO-8859-1");
      pageContext = _jspxFactory.getPageContext(this, request, response,
      			null, true, 8192, true);
      _jspx_page_context = pageContext;
      application = pageContext.getServletContext();
      config = pageContext.getServletConfig();
      session = pageContext.getSession();
      out = pageContext.getOut();
      _jspx_out = out;

      out.write(" \r\n");
      out.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 
Transitional//EN\"> \r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("<html>\r\n");
      out.write("<head>\r\n");
      out.write("<title>Insert title here</title>\r\n");
      out.write("</head>\r\n");
      out.write("<body>\r\n");

Object obj = TigerUtil.getHome();


      out.write(" \r\n");
      out.write("\r\n");
      out.write("</body>\r\n");
      out.write("</html>\r\n");
    } catch (Throwable t) {
      if (!(t instanceof SkipPageException)){
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          out.clearBuffer();
        if (_jspx_page_context != null) 
_jspx_page_context.handlePageException(t);
      }
    } finally {
      if (_jspxFactory != null) 
_jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
}



Thanks
Re: JSP ERROR!!! [message #138734 is a reply to message #138573] Wed, 14 September 2005 18:24 Go to previous messageGo to next message
softlogo is currently offline softlogoFriend
Messages: 7
Registered: July 2009
Junior Member
Hi,

I tried same thing and it seems like TigerHome (generated by XDoclet
when TigerBean is created) can't find "Tiger" bean, it actually throws a
Naming Exception. You can confirm that if you replace JSP code by some
thing like this

<html>
<head>
<title>Insert title here</title>
</head>
<body>
<%
com.zoo.Tiger tiger = null;
try{
com.zoo.TigerHome home = com.zoo.TigerUtil.getHome();
tiger = home.create();

}catch(Exception e)
{
//it is never good to ignore exceptions
e.printStackTrace();
}


%>
<b><%= tiger.roar() %></b>
</body>
</html>




> The code of zootest_jsp.java:
>
>
> package org.apache.jsp;
> 
> import javax.servlet.*;
> import javax.servlet.http.*;
> import javax.servlet.jsp.*;
> import java.util.*;
> import javax.naming.*;
> import javax.rmi.PortableRemoteObject;
> import com.zoo.Tiger;
> import com.zoo.TigerHome;
> import com.zoo.TigerUtil;
> 
> public final class zootest_jsp extends 
> org.apache.jasper.runtime.HttpJspBase
>    implements org.apache.jasper.runtime.JspSourceDependent {
> 
>  private static java.util.Vector _jspx_dependants;
> 
>  public java.util.List getDependants() {
>    return _jspx_dependants;
>  }
> 
>  public void _jspService(HttpServletRequest request, HttpServletResponse 
> response)
>        throws java.io.IOException, ServletException {
> 
>    JspFactory _jspxFactory = null;
>    PageContext pageContext = null;
>    HttpSession session = null;
>    ServletContext application = null;
>    ServletConfig config = null;
>    JspWriter out = null;
>    Object page = this;
>    JspWriter _jspx_out = null;
>    PageContext _jspx_page_context = null;
> 
> 
>    try {
>      _jspxFactory = JspFactory.getDefaultFactory();
>      response.setContentType("text/html; charset=ISO-8859-1");
>      pageContext = _jspxFactory.getPageContext(this, request, response,
>                  null, true, 8192, true);
>      _jspx_page_context = pageContext;
>      application = pageContext.getServletContext();
>      config = pageContext.getServletConfig();
>      session = pageContext.getSession();
>      out = pageContext.getOut();
>      _jspx_out = out;
> 
>      out.write(" \r\n");
>      out.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 
> Transitional//EN\"> \r\n");
>      out.write("\r\n");
>      out.write("\r\n");
>      out.write("\r\n");
>      out.write("<html>\r\n");
>      out.write("<head>\r\n");
>      out.write("<title>Insert title here</title>\r\n");
>      out.write("</head>\r\n");
>      out.write("<body>\r\n");
> 
> Object obj = TigerUtil.getHome();
> 
> 
>      out.write(" \r\n");
>      out.write("\r\n");
>      out.write("</body>\r\n");
>      out.write("</html>\r\n");
>    } catch (Throwable t) {
>      if (!(t instanceof SkipPageException)){
>        out = _jspx_out;
>        if (out != null && out.getBufferSize() != 0)
>          out.clearBuffer();
>        if (_jspx_page_context != null) 
> _jspx_page_context.handlePageException(t);
>      }
>    } finally {
>      if (_jspxFactory != null) 
> _jspxFactory.releasePageContext(_jspx_page_context);
>    }
>  }
> }
> 
> 

>
> Thanks
>
Re: JSP ERROR!!! [message #138802 is a reply to message #138281] Wed, 14 September 2005 20:57 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: pavery.us.ibm.com

Claudia Rego wrote:
> Yes! You're right.
> I'm using Eclipse 3.1 + WTP0.7 and JBoss4.0.2
> Can you help me?
> Have you followed this tutorial (Building a Simple EJB Application)?
> Thanks Claudia
>
>
I might be mistaken, but I think only JBoss 3.2.3 is supported by WTP...
-phil
Re: JSP ERROR!!! [message #138886 is a reply to message #137797] Thu, 15 September 2005 11:22 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: claudia_rego.hotmail.com

After many days thought I have found the problem. I think...
AS i said, i am following the WTP Tutorial - Building a Simple EJB
Application.
I had an error when i run the JSP page in the server. Using the code shown
in tutorial:

<html>
<head>
<title>Insert title here</title>
</head>
<body>
<%
com.zoo.Tiger tiger = null;
try{
com.zoo.TigerHome home = com.zoo.TigerUtil.getHome();
tiger = home.create();

}catch(Exception exception)
{

}
%>
<b><%= tiger.roar() %></b>
</body>

I get an Exception:
16:36:56,046 ERROR [[jsp]] Servlet.service() for servlet jsp threw
exception
java.lang.NullPointerException

So i went step by step. My JSP page:
<html>
<head>
<title>Insert title here</title>
</head>
<body>
<%
com.zoo.Tiger tiger = null;
System.out.println("Step1");
%>

<%
com.zoo.TigerHome home = com.zoo.TigerUtil.getHome();
System.out.println("Step2");
%>
</body>

I find that Step1 is done perfectly but Step 2 NO!! Because in
TigerUtil.getHome() there is the problem in the line:
javax.rmi.PortableRemoteObject.narrow(objRef, narrowTo);

The exception generated is:
java.lang.ClassCastException

After search in all forums and the all www :) I find:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4730878
"javax.rmi.PortableRemoteObject.narrow(...) casts the returned result to
the java.rmi.Remote interface...This behavior is contradiciting the spec
of javax.rmi.PortableRemoteObject.narrow(...): "Checks to ensure that an
object of a remote or abstract interface type can be cast to a desired
type"

Since the abstract interfaces do not implement Remote, this code will
break for customers using abstract interfaces in their application. This
code results in ClassCastException..." from Sun

What you find? I am correct?
If yes, as to exceed the problem?

Please, send me feedback
Thnkxx
Cláudia
Re: JSP ERROR!!! [message #138898 is a reply to message #138886] Thu, 15 September 2005 11:33 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: wknauf_NO_._INSIDE_hg-online.de

Hi Claudia,

what's your Java version ? I used this Util class with 1.4.2_09 and it
worked fine. Is there a chance the the JNDI names for local/remote
interfaces got mixed up ?

Post your complete ear project to make it easier to find the problem
(use "export to EAR file" with option "export source files").

Best regards

Wolfgang

c wrote:
> After many days thought I have found the problem. I think...
> AS i said, i am following the WTP Tutorial - Building a Simple EJB
> Application.
> I had an error when i run the JSP page in the server. Using the code
> shown in tutorial:
>
> <html>
> <head>
> <title>Insert title here</title>
> </head>
> <body>
> <%
> com.zoo.Tiger tiger = null;
> try{
> com.zoo.TigerHome home = com.zoo.TigerUtil.getHome();
> tiger = home.create();
> }catch(Exception exception)
> {
> }
> %>
> <b><%= tiger.roar() %></b>
> </body>
>
> I get an Exception:
> 16:36:56,046 ERROR [[jsp]] Servlet.service() for servlet jsp threw
> exception java.lang.NullPointerException
> So i went step by step. My JSP page:
> <html>
> <head>
> <title>Insert title here</title>
> </head>
> <body>
> <%
> com.zoo.Tiger tiger = null;
> System.out.println("Step1");
> %>
>
> <% com.zoo.TigerHome home = com.zoo.TigerUtil.getHome();
> System.out.println("Step2");
> %>
> </body>
>
> I find that Step1 is done perfectly but Step 2 NO!! Because in
> TigerUtil.getHome() there is the problem in the line:
> javax.rmi.PortableRemoteObject.narrow(objRef, narrowTo);
>
> The exception generated is:
> java.lang.ClassCastException
>
> After search in all forums and the all www :) I find:
> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4730878
> "javax.rmi.PortableRemoteObject.narrow(...) casts the returned result to
> the java.rmi.Remote interface...This behavior is contradiciting the spec
> of javax.rmi.PortableRemoteObject.narrow(...): "Checks to ensure that an
> object of a remote or abstract interface type can be cast to a desired
> type"
>
> Since the abstract interfaces do not implement Remote, this code will
> break for customers using abstract interfaces in their application. This
> code results in ClassCastException..." from Sun
>
> What you find? I am correct?
> If yes, as to exceed the problem?
>
> Please, send me feedback
> Thnkxx
> Cláudia
>
Re: JSP ERROR!!! [message #138909 is a reply to message #138802] Thu, 15 September 2005 11:35 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: wknauf_NO_._INSIDE_hg-online.de

Hi Phil,

search this NG, there is a plugin for JBoss 4.0 which works fine.

Best regards

Wolfgang

phil avery wrote:
> Claudia Rego wrote:
>
>> Yes! You're right.
>> I'm using Eclipse 3.1 + WTP0.7 and JBoss4.0.2
>> Can you help me?
>> Have you followed this tutorial (Building a Simple EJB Application)?
>> Thanks Claudia
>>
>>
> I might be mistaken, but I think only JBoss 3.2.3 is supported by WTP...
> -phil
Re: JSP ERROR!!! [message #138944 is a reply to message #138898] Thu, 15 September 2005 13:43 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: claudia_rego.hotmail.com

Wolfgang Knauf wrote:

> Hi Claudia,

> what's your Java version ?

I'm using J2EE 1.4 SDK 2005Q2 UR2

> Post your complete ear project to make it easier to find the problem
> (use "export to EAR file" with option "export source files").

I don't know I to do it. It's some kind of attach??

Thankxx
Cláudia
Re: JSP ERROR!!! [message #138955 is a reply to message #138909] Thu, 15 September 2005 13:50 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: claudia_rego.hotmail.com

If you need, the plugin is:
http://www.mrvelj.net/download/JBoss402EclipseWTP.zip

Good Work!!
Cláudia
Re: JSP ERROR!!! [message #138967 is a reply to message #138944] Thu, 15 September 2005 14:44 Go to previous messageGo to next message
softlogo is currently offline softlogoFriend
Messages: 7
Registered: July 2009
Junior Member
Hi,

Try this, remove

<dependent-module deploy-path="/WEB-INF/lib"
handle="module:/resource/ZooBeansClient/ZooBeansClient">
<dependency-type>uses</dependency-type>
</dependent-module>

from .wtpmodules, it works fine for me usin JBoss 4.0.2, JDK 1.4.2 and
JDK 5.0

But if I add this dependency to .wtpmodules it does not work any more?
(you will still need to add EJB project to buildpath of Web project)

Haroon



Claudia Rego wrote:
> Wolfgang Knauf wrote:
>
>> Hi Claudia,
>
>
>> what's your Java version ?
>
>
> I'm using J2EE 1.4 SDK 2005Q2 UR2
>
>> Post your complete ear project to make it easier to find the problem
>> (use "export to EAR file" with option "export source files").
>
>
> I don't know I to do it. It's some kind of attach??
>
> Thankxx Cláudia
>
Re: JSP ERROR!!! [message #139173 is a reply to message #138944] Fri, 16 September 2005 11:56 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: wknauf_NO_._INSIDE_hg-online.de

Hi Claudia,

Claudia Rego wrote:
>
>> Post your complete ear project to make it easier to find the problem
>> (use "export to EAR file" with option "export source files").
>
>
> I don't know I to do it. It's some kind of attach??
>

You mean how to attach the file to the newsgroup post ? This depends on
your newsreader.

Best regards

Wolfgang
Re: JSP ERROR!!! - SOLUTION [message #139438 is a reply to message #139173] Mon, 19 September 2005 11:26 Go to previous message
Eclipse UserFriend
Originally posted by: claudia_rego.hotmail.com

People i find what was wrong!!!
The version of the EJB and Web Module. When i tried EJB 2.0 and Web Module
2.3 it WORKS!!!
A special thanks to Haroon!
Thankx to all you spend time with my problme.
Claudia
Previous Topic:eclipse EJB Client files
Next Topic:webobject tag
Goto Forum:
  


Current Time: Sun Dec 21 13:33:46 GMT 2014

Powered by FUDForum. Page generated in 0.12300 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software