tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From João Luiz de Brito Macaíba <maca...@nc-rj.rnp.br>
Subject tomcat doesn't see javabean inside .jar
Date Fri, 26 Apr 2002 17:11:08 GMT
Hi,

I made a test javabean (HelloBean) which is part of package called

   br.eti.macaiba.test.bean


When I put the directory structure of the package in

   $CATALINA_HOME/webapps/ROOT/WEB-INF/classes/

there is no problem.


But when I try to put the jar file in

   $CATALINA_HOME/webapps/ROOT/WEB-INF/lib/

I receive the error message below:

   Apache Tomcat/4.0.3 - HTTP Status 500 - Internal Server Error



Does anyone have any idea ?

Thanks In Advance,
Joao Macaiba.

PS: Below are the files and full error message:


--- BEGIN : HelloBean.java ---

package br.eti.macaiba.test.bean;

public class HelloBean implements java.io.Serializable {

    private String name;

    HelloBean() {
        name = "World";
    }

    public String getName() {

        return name;
    }

    public void setName(String n) {

		name = n;
	}

}

--- END   : HelloBean.java ---



--- BEGIN : HelloBean.jsp ---

<html>
<head><title>This is the HelloBean example</title></head>
<body>
<jsp:useBean id="hello" class="br.eti.macaiba.test.bean.HelloBean"/>
<jsp:setProperty name="hello" property="name" param="name"/>
Hello, <jsp:getProperty name="hello" property="name"/> !
</body>
</html>

--- END   : HelloBean.jsp ---


--- BEGIN : jar -xvf macaiba.jar ---

  created: META-INF/
extracted: META-INF/MANIFEST.MF
  created: br/
  created: br/eti/
  created: br/eti/macaiba/
  created: br/eti/macaiba/test/
  created: br/eti/macaiba/test/bean/
extracted: br/eti/macaiba/test/bean/HelloBean.class

--- END   : jar -xvf macaiba.jar ---


--- BEGIN : dump of tomcat error message ---

Apache Tomcat/4.0.3 - HTTP Status 500 - Internal Server Error


type Exception report

message Internal Server Error

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

exception
javax.servlet.ServletException: class br.eti.macaiba.test.bean.HelloBean :
java.lang.IllegalAccessException: Class java.beans.Beans can not access a
member of class br.eti.macaiba.test.bean.HelloBean with modifiers ""
        at
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:463)
        at
org.apache.jsp.HelloBean$jsp._jspService(HelloBean$jsp.java:104)
        at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:202)
        at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
        at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
        at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
        at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
        at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
        at
org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
        at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
        at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
        at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2343)
        at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
        at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
        at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
        at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
        at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
        at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
        at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
        at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
        at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
        at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
        at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
        at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
        at
org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1012)
        at
org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1107)
        at java.lang.Thread.run(Thread.java:536)


root cause
java.lang.InstantiationException: class br.eti.macaiba.test.bean.HelloBean
: java.lang.IllegalAccessException: Class java.beans.Beans can not access
a member of class br.eti.macaiba.test.bean.HelloBean with modifiers ""
        at org.apache.jsp.HelloBean$jsp._jspService(HelloBean$jsp.java:70)
        at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:202)
        at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
        at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
        at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
        at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
        at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
        at
org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
        at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
        at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
        at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2343)
        at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
        at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
        at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
        at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
        at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
        at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
        at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
        at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
        at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
        at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
        at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
        at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
        at
org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1012)
        at
org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1107)
        at java.lang.Thread.run(Thread.java:536)


--- END   : dump of tomcat error message ---


-- 
From "The Practice Programming" by Brian W Kernighan & Rob Pike:

  Another effective [debugging] technique is to explain your code to
someone else. This will often cause you to explain the bug to yourself.
Sometimes it takes no more than a few sentences, followed by an
embarrassed "Never mind. I see what's wrong. Sorry to bother you."

  This works remarkbly well; you can even use non-programmers as
listeners. One university computer center kept a teddy bear near the help
desk. Students with mysterious bugs were required to explain them to the
bear before they could speak to a human counselor.

*----------------------------------------------------------------*
|  .''`.  | Debian GNU/Linux: <http://www.debian.org>            |
| : :'  : | Debian BR.......: <http://debian-br.sourceforge.net> |
| `. `'`  |                                                      |
|   `-    |                  Be Happy! Be FREE!                  |
*----------------------------------------------------------------*

----------------------------------------------------------------------
João Macaíba                         Serviço de Suporte a Informações
+55 21 2274.7445                    Rede Nacional de Ensino e Pesquisa
                                            http://www.rnp.br
----------------------------------------------------------------------


--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>


Mime
View raw message