You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Tomasz Nowak <tn...@ipipan.waw.pl> on 2001/11/05 09:04:09 UTC

JAXM + Tomcat

Hi,

does somebody use JAXM classes with Tomcat ?

I try to make servlet which extends JAXMServlet.
Compilation is ok,
but when I start it with Tomcat 4.0 (or JServ)
I receive messages like the following:

2001-11-05 08:16:37 StandardWrapper[:HTTPNode]: Marking servlet HTTPNode
as unavailable
2001-11-05 08:16:37 StandardContext[]: Servlet  threw load() exception
javax.servlet.ServletException: Class HTTPNode is not a Servlet
         at org.apache.catalina.core.StandardWrapper.load(Unknown Source)
         at
org.apache.catalina.core.StandardContext.loadOnStartup(Unknown Source)

Have you any idea ?

The some code is in JAXM examples or in the article:
http://www.javaworld.com/javaworld/jw-09-2001/jw-0914-xmlmessage3.html

All JAXM classes I put into jdk1.3/jre/lib/ext

Best regards.
-- 
Tomasz Nowak

Institute of Computer Science,    Email: tnowak@ipipan.waw.pl
Polish Academy of Sciences,       http://pegaz.ipipan.waw.pl
al. Ordona 21, PL-01-237 Warsaw,  tel. ++48-22 836-28-41
POLAND                            fax: ++48-22 837-65-64


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: JAXM + Tomcat

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Mon, 5 Nov 2001, Tomasz Nowak wrote:

> Date: Mon, 05 Nov 2001 20:59:04 +0100
> From: Tomasz Nowak <tn...@ipipan.waw.pl>
> Reply-To: Tomcat Users List <to...@jakarta.apache.org>
> To: Tomcat Users List <to...@jakarta.apache.org>
> Subject: Re: JAXM + Tomcat
>
>
>
> Craig R. McClanahan wrote:
>
> >
> >>All JAXM classes I put into jdk1.3/jre/lib/ext
> >>
> >>
> >
> > This is the cause of your problem.  Put the JAXM JAR files in
> > "$CATALINA_HOME/lib" instead.
> >
>
> Yes, it works.
> Why ? What is a differnce ? Tomcat uses jdk...
>

The problem is the way class loaders work.  Details are in the docs
available at:

  http://jakarta.apache.org/tomcat/tomcat-4.0-doc/class-loader-howto.html

but the important point is that one and only one servlet.jar file must be
in use to define classes like javax.servlet.http.HttpServlet.  When you
put the JAXM jar files in the system extensions directory, they get loaded
from a class loader "above" the one where servlet.jar lives, and thus
causes ClassCastException errors.  The same kind of thing will happen if
you put just a copy of servlet.jar in the extensions directory -- you will
get ClassCastException errors.

> Thank you.
>
> Best regards.
> --
> Tomasz Nowak
>

Craig


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: JAXM + Tomcat

Posted by Tomasz Nowak <tn...@ipipan.waw.pl>.

Craig R. McClanahan wrote:

> 
>>All JAXM classes I put into jdk1.3/jre/lib/ext
>>
>>
> 
> This is the cause of your problem.  Put the JAXM JAR files in
> "$CATALINA_HOME/lib" instead.
> 

Yes, it works.
Why ? What is a differnce ? Tomcat uses jdk...

Thank you.

Best regards.
-- 
Tomasz Nowak

Institute of Computer Science,    Email: tnowak@ipipan.waw.pl
Polish Academy of Sciences,       http://pegaz.ipipan.waw.pl
al. Ordona 21, PL-01-237 Warsaw,  tel. ++48-22 836-28-41
POLAND                            fax: ++48-22 837-65-64


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Location for applets?

Posted by longinus <lo...@zeus.polsl.gliwice.pl>.
if I put applet.class in webapps/ROOT directory then
CODEBASE='http://myserver:myport/' ? I tried, but don't know why it
doesn't work.

Yoav Shapira schrieb:
> 
> Hi,
> The codebase depends on how you setup your server directories ;)
> I can only comment on what I like to do personally, so adopt this
> as you see fit.
> 
> I like to set up a directory under my docbase, /applets.  Inside
> are just symlinks pointing to the class files that I put under
> the respective webapps WEB-INF/classes directories.  For example,
> applet1->../WEB-INF/classes/org.mycompany.applet1File
> 
> Then my applet tags are typically things like:
> 
> <APPLET
>   NAME=applet1
>   CODE='org.mycompany.Applet1'
>   CODEBASE='http://myserver:myport/mywebapp/applets'
>   <PARAM tags etc... />
> </APPLET>
> 
> Hopefully this helps,
> 
> Yoav
> 
> longinus wrote:
> >
> > how about codebase attribute?
> >
> > Yoav Shapira schrieb:
> > >
> > > Howdy,
> > >
> > > > > Do you know were applets should be put in TOMCAT server?
> > > > >
> > > >
> > > > Applet is the kind of web documents like .html.
> > > > I think that you can put applets together with other static documents.
> > >
> > > I would disagree with that ;)  The applets, per-se, are compiled
> > > files (.class or maybe in a jar).  Furthermore, the applet must be
> > > locatable by its fully-qualified class name, e.g. org.mycompany.foo.
> > >
> > > Accordingly, I would put the applet (if .class) in the WEB-INF/classes
> > > directory, and if it's in a JAR file I'd put it in the WEB-INF/lib
> > > directory.  The usual stuff applies about if you need them visible to
> > > other apps, put in tomcat/lib, etc.
> > >
> > > Just my two cents ;)
> > > Yoav
> > >
> > > --
> > > To unsubscribe:   <ma...@jakarta.apache.org>
> > > For additional commands: <ma...@jakarta.apache.org>
> > > Troubles with the list: <ma...@jakarta.apache.org>
> >
> > --
> > To unsubscribe:   <ma...@jakarta.apache.org>
> > For additional commands: <ma...@jakarta.apache.org>
> > Troubles with the list: <ma...@jakarta.apache.org>
> 
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>

--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Location for applets?

Posted by Yoav Shapira <sh...@mpi.com>.
Hi,
The codebase depends on how you setup your server directories ;)
I can only comment on what I like to do personally, so adopt this
as you see fit.

I like to set up a directory under my docbase, /applets.  Inside
are just symlinks pointing to the class files that I put under
the respective webapps WEB-INF/classes directories.  For example,
applet1->../WEB-INF/classes/org.mycompany.applet1File

Then my applet tags are typically things like:

<APPLET 
  NAME=applet1 
  CODE='org.mycompany.Applet1' 
  CODEBASE='http://myserver:myport/mywebapp/applets'
  <PARAM tags etc... />
</APPLET>

Hopefully this helps,

Yoav

longinus wrote:
> 
> how about codebase attribute?
> 
> Yoav Shapira schrieb:
> >
> > Howdy,
> >
> > > > Do you know were applets should be put in TOMCAT server?
> > > >
> > >
> > > Applet is the kind of web documents like .html.
> > > I think that you can put applets together with other static documents.
> >
> > I would disagree with that ;)  The applets, per-se, are compiled
> > files (.class or maybe in a jar).  Furthermore, the applet must be
> > locatable by its fully-qualified class name, e.g. org.mycompany.foo.
> >
> > Accordingly, I would put the applet (if .class) in the WEB-INF/classes
> > directory, and if it's in a JAR file I'd put it in the WEB-INF/lib
> > directory.  The usual stuff applies about if you need them visible to
> > other apps, put in tomcat/lib, etc.
> >
> > Just my two cents ;)
> > Yoav
> >
> > --
> > To unsubscribe:   <ma...@jakarta.apache.org>
> > For additional commands: <ma...@jakarta.apache.org>
> > Troubles with the list: <ma...@jakarta.apache.org>
> 
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>

--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Location for applets?

Posted by longinus <lo...@zeus.polsl.gliwice.pl>.
how about codebase attribute?

Yoav Shapira schrieb:
> 
> Howdy,
> 
> > > Do you know were applets should be put in TOMCAT server?
> > >
> >
> > Applet is the kind of web documents like .html.
> > I think that you can put applets together with other static documents.
> 
> I would disagree with that ;)  The applets, per-se, are compiled
> files (.class or maybe in a jar).  Furthermore, the applet must be
> locatable by its fully-qualified class name, e.g. org.mycompany.foo.
> 
> Accordingly, I would put the applet (if .class) in the WEB-INF/classes
> directory, and if it's in a JAR file I'd put it in the WEB-INF/lib
> directory.  The usual stuff applies about if you need them visible to
> other apps, put in tomcat/lib, etc.
> 
> Just my two cents ;)
> Yoav
> 
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>

--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Location for applets?

Posted by Yoav Shapira <sh...@mpi.com>.
Howdy,

> > Do you know were applets should be put in TOMCAT server?
> >
> 
> Applet is the kind of web documents like .html.
> I think that you can put applets together with other static documents.

I would disagree with that ;)  The applets, per-se, are compiled
files (.class or maybe in a jar).  Furthermore, the applet must be
locatable by its fully-qualified class name, e.g. org.mycompany.foo.

Accordingly, I would put the applet (if .class) in the WEB-INF/classes
directory, and if it's in a JAR file I'd put it in the WEB-INF/lib
directory.  The usual stuff applies about if you need them visible to
other apps, put in tomcat/lib, etc.

Just my two cents ;)
Yoav

--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: JAXM + Tomcat

Posted by longinus <lo...@zeus.polsl.gliwice.pl>.
how about the values of the parameter codebase and code?

Tomasz Nowak schrieb:
> 
> longinus wrote:
> 
> > Do you know were applets should be put in TOMCAT server?
> >
> 
> Applet is the kind of web documents like .html.
> I think that you can put applets together with other static documents.
> 
> But I started using tomcat few days ago, than I am not sure. :)
> 
> Best regards.
> --
> Tomasz Nowak
> 
> Institute of Computer Science,    Email: tnowak@ipipan.waw.pl
> Polish Academy of Sciences,       http://pegaz.ipipan.waw.pl
> al. Ordona 21, PL-01-237 Warsaw,  tel. ++48-22 836-28-41
> POLAND                            fax: ++48-22 837-65-64
> 
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>

--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: JAXM + Tomcat

Posted by Tomasz Nowak <tn...@ipipan.waw.pl>.

longinus wrote:

> Do you know were applets should be put in TOMCAT server?
> 

Applet is the kind of web documents like .html.
I think that you can put applets together with other static documents.

But I started using tomcat few days ago, than I am not sure. :)

Best regards.
-- 
Tomasz Nowak

Institute of Computer Science,    Email: tnowak@ipipan.waw.pl
Polish Academy of Sciences,       http://pegaz.ipipan.waw.pl
al. Ordona 21, PL-01-237 Warsaw,  tel. ++48-22 836-28-41
POLAND                            fax: ++48-22 837-65-64


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: JAXM + Tomcat

Posted by longinus <lo...@zeus.polsl.gliwice.pl>.
Do you know were applets should be put in TOMCAT server?

"Craig R. McClanahan" schrieb:
> 
> On Mon, 5 Nov 2001, Tomasz Nowak wrote:
> 
> > Date: Mon, 05 Nov 2001 09:04:09 +0100
> > From: Tomasz Nowak <tn...@ipipan.waw.pl>
> > Reply-To: Tomcat Users List <to...@jakarta.apache.org>
> > To: tomcat-user@jakarta.apache.org
> > Subject: JAXM + Tomcat
> >
> > Hi,
> >
> > does somebody use JAXM classes with Tomcat ?
> >
> > I try to make servlet which extends JAXMServlet.
> > Compilation is ok,
> > but when I start it with Tomcat 4.0 (or JServ)
> > I receive messages like the following:
> >
> > 2001-11-05 08:16:37 StandardWrapper[:HTTPNode]: Marking servlet HTTPNode
> > as unavailable
> > 2001-11-05 08:16:37 StandardContext[]: Servlet  threw load() exception
> > javax.servlet.ServletException: Class HTTPNode is not a Servlet
> >          at org.apache.catalina.core.StandardWrapper.load(Unknown Source)
> >          at
> > org.apache.catalina.core.StandardContext.loadOnStartup(Unknown Source)
> >
> > Have you any idea ?
> >
> > The some code is in JAXM examples or in the article:
> > http://www.javaworld.com/javaworld/jw-09-2001/jw-0914-xmlmessage3.html
> >
> > All JAXM classes I put into jdk1.3/jre/lib/ext
> >
> 
> This is the cause of your problem.  Put the JAXM JAR files in
> "$CATALINA_HOME/lib" instead.
> 
> > Best regards.
> > --
> > Tomasz Nowak
> >
> 
> Craig
> 
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>

--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: JAXM + Tomcat

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Mon, 5 Nov 2001, Tomasz Nowak wrote:

> Date: Mon, 05 Nov 2001 09:04:09 +0100
> From: Tomasz Nowak <tn...@ipipan.waw.pl>
> Reply-To: Tomcat Users List <to...@jakarta.apache.org>
> To: tomcat-user@jakarta.apache.org
> Subject: JAXM + Tomcat
>
> Hi,
>
> does somebody use JAXM classes with Tomcat ?
>
> I try to make servlet which extends JAXMServlet.
> Compilation is ok,
> but when I start it with Tomcat 4.0 (or JServ)
> I receive messages like the following:
>
> 2001-11-05 08:16:37 StandardWrapper[:HTTPNode]: Marking servlet HTTPNode
> as unavailable
> 2001-11-05 08:16:37 StandardContext[]: Servlet  threw load() exception
> javax.servlet.ServletException: Class HTTPNode is not a Servlet
>          at org.apache.catalina.core.StandardWrapper.load(Unknown Source)
>          at
> org.apache.catalina.core.StandardContext.loadOnStartup(Unknown Source)
>
> Have you any idea ?
>
> The some code is in JAXM examples or in the article:
> http://www.javaworld.com/javaworld/jw-09-2001/jw-0914-xmlmessage3.html
>
> All JAXM classes I put into jdk1.3/jre/lib/ext
>

This is the cause of your problem.  Put the JAXM JAR files in
"$CATALINA_HOME/lib" instead.

> Best regards.
> --
> Tomasz Nowak
>

Craig


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>