Re: problem with servlet in a .jar

If you have your servlets in a jar file, then don't have any class files under
servlets.
My servlets directory is empty and I don't get problems.

Benoit Mahe wrote:

> lacall wrote:
>
> > I did try to unzip the .jar file; now I see in the documentation that I have
> > to restart the server for it to pick up changes to servlet classes not
> > located in the "servlets" directory.
>
> Yes, because these classes are loaded by the system ClassLoader.
>
> > This seems to apply also to
> > subdirectories off the servlets directory.
>
> The autoreload feature works only for the servlet classes not for all classes.
>
> > This is a problem, though for now
> > I can simply .jar up my supporting classes and change the servlet classes
> > themselves so they are not in a package's subdirectory. Any other
> > suggestions I should consider? Thanks.
>
> Well, I don't see what's wrong with your configuration. This should works.
>
> Regards, Benoit.
>
> >
> >
> > Thanks,
> > Luke Call
> > EDM Group
> > Micron Technology, Boise
> >
> > -----Original Message-----
> > From: Benoit Mahe [mailto:Benoit.Mahe@sophia.inria.fr]
> > Sent: Tuesday, March 30, 1999 8:16 AM
> > To: lacall
> > Cc: 'www-jigsaw@w3.org'
> > Subject: Re: problem with servlet in a .jar
> >
> > Well, that's strange, the ClassLoader should be the system ClassLoader
> > because the servlet class is in the CLASSPATH. Did you try to unzip
> > the jar file?
> >
> > Regards, Benoit.
> >
> > lacall wrote:
> >
> > > I'm trying to use a servlet in a jar file. I added a jar file containing
> > all
> > > the servlet's classes to the jigsaw startup classpath, then added a
> > > ServletWrapper resource to the servlets resource with the fully-qualified
> > > class name. Then when I click "commit" I get a popup message (which I
> > > unfortunately I didn't write down), and I also see the below error listed
> > in
> > > the jigsaw console window. (Incidentally, the .jar file listed in the
> > jigsaw
> > > startup classpath isn't under the jigsaw directory, but is in a different
> > > directory on my computer, but I'm not sure that that would matter.)
> > >
> > > Then after about 10 minutes I went back and clicked the "commit" button
> > and
> > > it did not give the same error, and I still can't run my servlet. I'm a
> > > developer but not familiar with what's really going on in this case...
> > What
> > > does the error mean (given that the class it says it can't find is indeed
> > in
> > > the jar file)?  And does it matter that I have the .jar file elsewhere
> > > besides in a subdirectory from jigsaw? Thanks very much for your help and
> > > for a useful product.
> > >
> > > The error message:
> > > -----------------------
> > > java.lang.IllegalAccessError: cannot access interface
> > > com/micron/edm/crossLibSch
> > > /CrossLibSchCaller from class
> > com/micron/edm/crossLibSch/CrossLibSchServlet
> > >         at java.lang.ClassLoader.defineClass0(Native Method)
> > >         at java.lang.ClassLoader.defineClass(ClassLoader.java:378)
> > >         at java.lang.ClassLoader.defineClass(ClassLoader.java:330)
> > >         at
> > > org.w3c.jigsaw.servlet.AutoReloadServletLoader.loadClassFile(Compiled
> > >  Code)
> > >         at
> > > org.w3c.jigsaw.servlet.AutoReloadServletLoader.getNewClass(AutoReload
> > > ServletLoader.java)
> > >         at
> > > org.w3c.jigsaw.servlet.AutoReloadServletLoader.loadClass(AutoReloadSe
> > > rvletLoader.java)
> > >         at
> > > org.w3c.jigsaw.servlet.ServletWrapper.launchServlet(ServletWrapper.ja
> > > va)
> > >         at
> > > org.w3c.jigsaw.servlet.ServletWrapper.setValue(ServletWrapper.java)
> > >         at org.w3c.jigsaw.admin.BrokerFrame.remoteSetValues(Compiled Code)
> > >         at org.w3c.jigsaw.admin.BrokerFrame.extended(Compiled Code)
> > >         at org.w3c.jigsaw.frames.HTTPFrame.perform(Compiled Code)
> > >         at org.w3c.tools.resources.FramedResource.performFrames(Compiled
> > > Code)
> > >         at org.w3c.tools.resources.FramedResource.perform(Compiled Code)
> > >         at org.w3c.jigsaw.admin.AdminServer.perform(Compiled Code)
> > >         at org.w3c.jigsaw.http.Client.processRequest(Compiled Code)
> > >         at org.w3c.jigsaw.http.Client.startConnection(Compiled Code)
> > >         at org.w3c.jigsaw.http.socket.SocketClient.run(SocketClient.java)
> > >         at org.w3c.util.CachedThread.run(Compiled Code)
> > >
> > > Thanks,
> > > Luke Call
> > > EDM Group
> > > Micron Technology, Boise
> >
> > --
> > - Benoît Mahé -------------------------------------------------------
> >                       World Wide Web Consortium (W3C)
> >                     Architecture domain - Jigsaw Team
> >
> >   http://www.w3.org/People/Mahe - bmahe@w3.org - +33.4.92.38.79.89
> > ---------------------------------------------------------------------
>
> --
> - Benoît Mahé -------------------------------------------------------
>                       World Wide Web Consortium (W3C)
>                     Architecture domain - Jigsaw Team
>
>   http://www.w3.org/People/Mahe - bmahe@w3.org - +33.4.92.38.79.89
> ---------------------------------------------------------------------



--
Chris Turner, http://www.cycom.co.uk/

Received on Thursday, 1 April 1999 04:18:48 UTC