You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by Tim Davidson <tr...@gmail.com> on 2007/01/31 16:52:27 UTC

Servlet fails to deploy

Hi,

I am having a problem with the servlet classpath for my EAR file which
successfully deploys on GlassFish and JBoss. I have a Servlet, MyServlet
which is in a JAR, MyServeltJAR.jar, the jar is referenced in the Class-Path
attribute of the WAR files MANIFEST file, and the servlet is referenced in
web.xml ie.

EAR
  - META-INF/application.xml
  - META-INF/geronimo-application.xml
  + lib/MyServletJAR.jar
       - com.foo.MyServelt.class
  + WAR
       - META-INF/MANIFEST.MF: Class-Path: /lib/MyServletJAR.jar
       - WEB-INF/web.xml: <servlet>com.foo.MyServlet</servlet>
       - WEB-INF/geronimo-web.xml

but Geronimo fails to deply the EAR as it cannot find the Servlet class:


Could not load servlet class com.foo.MyServlet
org.apache.geronimo.common.DeploymentException: Could not load servlet class
com.foo.MyServlet
at org.apache.geronimo.tomcat.deployment.TomcatModuleBuilder.addGBeans(
TomcatModuleBuilder.java:386)
at
org.apache.geronimo.tomcat.deployment.TomcatModuleBuilder$$FastClassByCGLIB$$6f85ec2c.invoke
(<generated>)
at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:53)
...

Caused by: java.lang.ClassNotFoundException: com.foo.MyFrameworkServlet in
classloader default/myapp_myapp.war/1170243138828/car
at org.apache.geronimo.kernel.config.MultiParentClassLoader.loadClass(
MultiParentClassLoader.java:298)
at java.lang.ClassLoader.loadClass(Unknown Source)
...

Do I need to put a reference to MyServletJAR.jar in geronimo-application.xmlor
geronimo-web.xml and if so how do i do that? Or does MyServletJAR.jar need
to contain something else to tell geronimo about the servlet?

Many thanks,

Tim.

Re: Servlet fails to deploy

Posted by David Jencks <da...@yahoo.com>.
There's an automated testsuite integration test for stuff like this  
in trunk/2.0.

https://svn.apache.org/repos/asf/geronimo/server/trunk/testsuite/ 
deployment-testsuite/manifestcp-tests

You might see if that covers the exact situation you are dealing with.

I would expect

lib/library.jar
to resolve from the root of the ear and
../lib/library.jar

to resolve from the ejb jar location.  I haven't read the spec in a  
while but I think this is what it says should happen.

thanks
david jencks

On Feb 1, 2007, at 12:39 PM, Aman Nanner/MxI Technologies wrote:

> Hmm...I had tried that and it didn't work for me.  I'm using Geronimo
> 1.2-beta.  Is that the same version that you were using?
>
> Dario Andrade <da...@datscom.com.br> wrote on 02-01-2007 03:28:18 PM:
>
>>
>> for me, if you put
>>
>> Class-Path: library.jar
>>
>> directly (without path info) in the MANIFEST.MF and the jar itself
>> in the root of the ear, it will work
>>
>>
>> Cheers,
>> Dario Andrade
>>
>> Aman Nanner/MxI Technologies escreveu:
>>
>>> Is this supposed to work the same way when manipulating the Class- 
>>> Path
>>> entry of a Manifest file in an EJB JAR file, rather than a WAR?  It
> seems
>>> that I'm unable to reference any libraries that I put in the root  
>>> of the
>>> EAR file.  I have to place the library JARS directly in the EJB  
>>> module
> and
>>> reference them there from the Manifest.  For example, this works  
>>> for me:
>>>
>>> EAR
>>>  - META-INF/application.xml
>>>  - META-INF/geronimo-application.xml
>>>  + EJB JAR
>>>       - META-INF/lib/library.jar
>>>           -com.foo.Foo.class
>>>       - META-INF/MANIFEST.MF: Class-Path: META-INF/lib/library.jar
>>>       - META-INF/ejb-jar.xml
>>>       - META-INF/openejb-jar.xml
>>>
>>>
>>> but this does not:
>>>
>>> EAR
>>>  - META-INF/application.xml
>>>  - META-INF/geronimo-application.xml
>>>  + lib/library.jar
>>>       - com.foo.Foo.class
>>>  + EJB JAR
>>>       - META-INF/MANIFEST.MF: Class-Path: ./lib/library.jar
>>>       - META-INF/ejb-jar.xml
>>>       - META-INF/openejb-jar.xml
>>>
>>>
>>> "Tim Davidson" <tr...@gmail.com> wrote on 02-01-2007  
>>> 03:47:49 AM:
>>>
>>>
>>>
>>>> hmmm taking your advice and moving the JAR to the root of the EAR
>>>> and updating the manifest class-path accordingly fixed the problem.
>>>> So this got me thinking and I tried it again, using a dot in front
>>>> of the path (./lib/MyServeltJAR.jar) and it worked ok, this was a
>>>> difficult one to spot!
>>>>
>>>> Thanks again,
>>>>
>>>> Tim.
>>>>
>>>>
>>>
>>>
>>>
>>>> On 31/01/07, David Carew < dccarew@gmail.com> wrote:
>>>> I've done this but the utility jar was in the root of the EAR. I
>>>> would suggest putting the utility jar in the root of the EAR file
>>>> and then refer to it in the WAR files manifest using the jar files
>>>> name (without any directory slashes).
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>>> On 1/31/07, Tim Davidson < trdavidson@gmail.com> wrote:
>>>> Hi,
>>>>
>>>> I am having a problem with the servlet classpath for my EAR file
>>>> which successfully deploys on GlassFish and JBoss. I have a  
>>>> Servlet,
>>>> MyServlet which is in a JAR, MyServeltJAR.jar, the jar is  
>>>> referenced
>>>> in the Class-Path attribute of the WAR files MANIFEST file, and the
>>>> servlet is referenced in web.xml ie.
>>>>
>>>> EAR
>>>>  - META-INF/application.xml
>>>>  - META-INF/geronimo-application.xml
>>>>  + lib/MyServletJAR.jar
>>>>       - com.foo.MyServelt.class
>>>>  + WAR
>>>>       - META-INF/MANIFEST.MF: Class-Path: /lib/MyServletJAR.jar
>>>>       - WEB-INF/web.xml: <servlet>com.foo.MyServlet</servlet>
>>>>       - WEB-INF/geronimo-web.xml
>>>>
>>>> but Geronimo fails to deply the EAR as it cannot find the Servlet
> class:
>>>>
>>>>
>>>> Could not load servlet class com.foo.MyServlet
>>>> org.apache.geronimo.common.DeploymentException: Could not load
>>>> servlet class com.foo.MyServlet
>>>> at org.apache.geronimo.tomcat.deployment.TomcatModuleBuilder.
>>>> addGBeans(TomcatModuleBuilder.java:386)
>>>> at org.apache.geronimo.tomcat.deployment.
>>>> TomcatModuleBuilder$$FastClassByCGLIB$$6f85ec2c.invoke(<generated>)
>>>> at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:53)
>>>> ...
>>>>
>>>> Caused by: java.lang.ClassNotFoundException: com.foo.
>>>> MyFrameworkServlet in classloader
>>>>
>>>>
>>> default/myapp_myapp.war/1170243138828/car
>>>
>>>
>>>> at org.apache.geronimo.kernel.config.MultiParentClassLoader.
>>>> loadClass(MultiParentClassLoader.java:298)
>>>> at java.lang.ClassLoader.loadClass(Unknown Source)
>>>> ...
>>>>
>>>> Do I need to put a reference to MyServletJAR.jar in geronimo-
>>>> application.xml or geronimo-web.xml and if so how do i do that? Or
>>>> does MyServletJAR.jar need to contain something else to tell
>>>> geronimo about the servlet?
>>>>
>>>> Many thanks,
>>>>
>>>> Tim.
>>>>
>>>>
>>>
>>
>> _____________________________________________________________________ 
>> _____________
>
>>> * This message is intended only for the use of the individual or
>> entity to which it is addressed, and may contain information that is
>> privileged, confidential and exempt from disclosure under applicable
>> law. Unless you are the addressee (or authorized to receive for the
>> addressee), you may not use, copy or disclose the message or any
>> information contained in the message. If you have received this
>> message in error, please advise the sender by reply e-mail , and
>> delete the message, or call (collect) 001 613 747 4698. *
>>>
>>>
>>
>
> ______________________________________________________________________ 
> ____________
> * This message is intended only for the use of the individual or  
> entity to which it is addressed, and may contain information that  
> is privileged, confidential and exempt from disclosure under  
> applicable law. Unless you are the addressee (or authorized to  
> receive for the addressee), you may not use, copy or disclose the  
> message or any information contained in the message. If you have  
> received this message in error, please advise the sender by reply e- 
> mail , and delete the message, or call (collect) 001 613 747 4698. *
>


Re: Servlet fails to deploy

Posted by Dario Andrade <da...@datscom.com.br>.
Actually, I am doing that for an J2EE application client and it does 
work the way I mentioned.

I have not tried anything with an EJB jar, maybe a bug in ejbdeployer? 
Why donĀ“t you try filing a bug with a test case. In theory it should work.

I am using geronimo 1.1.1.

Regards,
Dario Andrade

Aman Nanner/MxI Technologies escreveu:

>Hmm...I had tried that and it didn't work for me.  I'm using Geronimo
>1.2-beta.  Is that the same version that you were using?
>
>Dario Andrade <da...@datscom.com.br> wrote on 02-01-2007 03:28:18 PM:
>
>  
>
>>for me, if you put
>>
>>Class-Path: library.jar
>>
>>directly (without path info) in the MANIFEST.MF and the jar itself
>>in the root of the ear, it will work
>>
>>
>>Cheers,
>>Dario Andrade
>>
>>Aman Nanner/MxI Technologies escreveu:
>>
>>    
>>
>>>Is this supposed to work the same way when manipulating the Class-Path
>>>entry of a Manifest file in an EJB JAR file, rather than a WAR?  It
>>>      
>>>
>seems
>  
>
>>>that I'm unable to reference any libraries that I put in the root of the
>>>EAR file.  I have to place the library JARS directly in the EJB module
>>>      
>>>
>and
>  
>
>>>reference them there from the Manifest.  For example, this works for me:
>>>
>>>EAR
>>> - META-INF/application.xml
>>> - META-INF/geronimo-application.xml
>>> + EJB JAR
>>>      - META-INF/lib/library.jar
>>>          -com.foo.Foo.class
>>>      - META-INF/MANIFEST.MF: Class-Path: META-INF/lib/library.jar
>>>      - META-INF/ejb-jar.xml
>>>      - META-INF/openejb-jar.xml
>>>
>>>
>>>but this does not:
>>>
>>>EAR
>>> - META-INF/application.xml
>>> - META-INF/geronimo-application.xml
>>> + lib/library.jar
>>>      - com.foo.Foo.class
>>> + EJB JAR
>>>      - META-INF/MANIFEST.MF: Class-Path: ./lib/library.jar
>>>      - META-INF/ejb-jar.xml
>>>      - META-INF/openejb-jar.xml
>>>
>>>
>>>"Tim Davidson" <tr...@gmail.com> wrote on 02-01-2007 03:47:49 AM:
>>>
>>>
>>>
>>>      
>>>
>>>>hmmm taking your advice and moving the JAR to the root of the EAR
>>>>and updating the manifest class-path accordingly fixed the problem.
>>>>So this got me thinking and I tried it again, using a dot in front
>>>>of the path (./lib/MyServeltJAR.jar) and it worked ok, this was a
>>>>difficult one to spot!
>>>>
>>>>Thanks again,
>>>>
>>>>Tim.
>>>>
>>>>
>>>>        
>>>>
>>>
>>>      
>>>
>>>>On 31/01/07, David Carew < dccarew@gmail.com> wrote:
>>>>I've done this but the utility jar was in the root of the EAR. I
>>>>would suggest putting the utility jar in the root of the EAR file
>>>>and then refer to it in the WAR files manifest using the jar files
>>>>name (without any directory slashes).
>>>>
>>>>
>>>>
>>>>        
>>>>
>>>
>>>      
>>>
>>>>On 1/31/07, Tim Davidson < trdavidson@gmail.com> wrote:
>>>>Hi,
>>>>
>>>>I am having a problem with the servlet classpath for my EAR file
>>>>which successfully deploys on GlassFish and JBoss. I have a Servlet,
>>>>MyServlet which is in a JAR, MyServeltJAR.jar, the jar is referenced
>>>>in the Class-Path attribute of the WAR files MANIFEST file, and the
>>>>servlet is referenced in web.xml ie.
>>>>
>>>>EAR
>>>> - META-INF/application.xml
>>>> - META-INF/geronimo-application.xml
>>>> + lib/MyServletJAR.jar
>>>>      - com.foo.MyServelt.class
>>>> + WAR
>>>>      - META-INF/MANIFEST.MF: Class-Path: /lib/MyServletJAR.jar
>>>>      - WEB-INF/web.xml: <servlet>com.foo.MyServlet</servlet>
>>>>      - WEB-INF/geronimo-web.xml
>>>>
>>>>but Geronimo fails to deply the EAR as it cannot find the Servlet
>>>>        
>>>>
>class:
>  
>
>>>>Could not load servlet class com.foo.MyServlet
>>>>org.apache.geronimo.common.DeploymentException: Could not load
>>>>servlet class com.foo.MyServlet
>>>>at org.apache.geronimo.tomcat.deployment.TomcatModuleBuilder.
>>>>addGBeans(TomcatModuleBuilder.java:386)
>>>>at org.apache.geronimo.tomcat.deployment.
>>>>TomcatModuleBuilder$$FastClassByCGLIB$$6f85ec2c.invoke(<generated>)
>>>>at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:53)
>>>>...
>>>>
>>>>Caused by: java.lang.ClassNotFoundException: com.foo.
>>>>MyFrameworkServlet in classloader
>>>>
>>>>
>>>>        
>>>>
>>>default/myapp_myapp.war/1170243138828/car
>>>
>>>
>>>      
>>>
>>>>at org.apache.geronimo.kernel.config.MultiParentClassLoader.
>>>>loadClass(MultiParentClassLoader.java:298)
>>>>at java.lang.ClassLoader.loadClass(Unknown Source)
>>>>...
>>>>
>>>>Do I need to put a reference to MyServletJAR.jar in geronimo-
>>>>application.xml or geronimo-web.xml and if so how do i do that? Or
>>>>does MyServletJAR.jar need to contain something else to tell
>>>>geronimo about the servlet?
>>>>
>>>>Many thanks,
>>>>
>>>>Tim.
>>>>
>>>>
>>>>        
>>>>
>>__________________________________________________________________________________
>>    
>>
>
>  
>
>>>* This message is intended only for the use of the individual or
>>>      
>>>
>>entity to which it is addressed, and may contain information that is
>>privileged, confidential and exempt from disclosure under applicable
>>law. Unless you are the addressee (or authorized to receive for the
>>addressee), you may not use, copy or disclose the message or any
>>information contained in the message. If you have received this
>>message in error, please advise the sender by reply e-mail , and
>>delete the message, or call (collect) 001 613 747 4698. *
>>    
>>
>>>      
>>>
>
>__________________________________________________________________________________
>* This message is intended only for the use of the individual or entity to which it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. Unless you are the addressee (or authorized to receive for the addressee), you may not use, copy or disclose the message or any information contained in the message. If you have received this message in error, please advise the sender by reply e-mail , and delete the message, or call (collect) 001 613 747 4698. *
>  
>


Re: Servlet fails to deploy

Posted by Aman Nanner/MxI Technologies <am...@mxi.com>.
Hmm...I had tried that and it didn't work for me.  I'm using Geronimo
1.2-beta.  Is that the same version that you were using?

Dario Andrade <da...@datscom.com.br> wrote on 02-01-2007 03:28:18 PM:

>
> for me, if you put
>
> Class-Path: library.jar
>
> directly (without path info) in the MANIFEST.MF and the jar itself
> in the root of the ear, it will work
>
>
> Cheers,
> Dario Andrade
>
> Aman Nanner/MxI Technologies escreveu:
>
> >Is this supposed to work the same way when manipulating the Class-Path
> >entry of a Manifest file in an EJB JAR file, rather than a WAR?  It
seems
> >that I'm unable to reference any libraries that I put in the root of the
> >EAR file.  I have to place the library JARS directly in the EJB module
and
> >reference them there from the Manifest.  For example, this works for me:
> >
> >EAR
> >  - META-INF/application.xml
> >  - META-INF/geronimo-application.xml
> >  + EJB JAR
> >       - META-INF/lib/library.jar
> >           -com.foo.Foo.class
> >       - META-INF/MANIFEST.MF: Class-Path: META-INF/lib/library.jar
> >       - META-INF/ejb-jar.xml
> >       - META-INF/openejb-jar.xml
> >
> >
> >but this does not:
> >
> >EAR
> >  - META-INF/application.xml
> >  - META-INF/geronimo-application.xml
> >  + lib/library.jar
> >       - com.foo.Foo.class
> >  + EJB JAR
> >       - META-INF/MANIFEST.MF: Class-Path: ./lib/library.jar
> >       - META-INF/ejb-jar.xml
> >       - META-INF/openejb-jar.xml
> >
> >
> >"Tim Davidson" <tr...@gmail.com> wrote on 02-01-2007 03:47:49 AM:
> >
> >
> >
> >>hmmm taking your advice and moving the JAR to the root of the EAR
> >>and updating the manifest class-path accordingly fixed the problem.
> >>So this got me thinking and I tried it again, using a dot in front
> >>of the path (./lib/MyServeltJAR.jar) and it worked ok, this was a
> >>difficult one to spot!
> >>
> >>Thanks again,
> >>
> >>Tim.
> >>
> >>
> >
> >
> >
> >>On 31/01/07, David Carew < dccarew@gmail.com> wrote:
> >>I've done this but the utility jar was in the root of the EAR. I
> >>would suggest putting the utility jar in the root of the EAR file
> >>and then refer to it in the WAR files manifest using the jar files
> >>name (without any directory slashes).
> >>
> >>
> >>
> >
> >
> >
> >>On 1/31/07, Tim Davidson < trdavidson@gmail.com> wrote:
> >>Hi,
> >>
> >>I am having a problem with the servlet classpath for my EAR file
> >>which successfully deploys on GlassFish and JBoss. I have a Servlet,
> >>MyServlet which is in a JAR, MyServeltJAR.jar, the jar is referenced
> >>in the Class-Path attribute of the WAR files MANIFEST file, and the
> >>servlet is referenced in web.xml ie.
> >>
> >>EAR
> >>  - META-INF/application.xml
> >>  - META-INF/geronimo-application.xml
> >>  + lib/MyServletJAR.jar
> >>       - com.foo.MyServelt.class
> >>  + WAR
> >>       - META-INF/MANIFEST.MF: Class-Path: /lib/MyServletJAR.jar
> >>       - WEB-INF/web.xml: <servlet>com.foo.MyServlet</servlet>
> >>       - WEB-INF/geronimo-web.xml
> >>
> >>but Geronimo fails to deply the EAR as it cannot find the Servlet
class:
> >>
> >>
> >>Could not load servlet class com.foo.MyServlet
> >>org.apache.geronimo.common.DeploymentException: Could not load
> >>servlet class com.foo.MyServlet
> >>at org.apache.geronimo.tomcat.deployment.TomcatModuleBuilder.
> >>addGBeans(TomcatModuleBuilder.java:386)
> >>at org.apache.geronimo.tomcat.deployment.
> >>TomcatModuleBuilder$$FastClassByCGLIB$$6f85ec2c.invoke(<generated>)
> >>at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:53)
> >>...
> >>
> >>Caused by: java.lang.ClassNotFoundException: com.foo.
> >>MyFrameworkServlet in classloader
> >>
> >>
> >default/myapp_myapp.war/1170243138828/car
> >
> >
> >>at org.apache.geronimo.kernel.config.MultiParentClassLoader.
> >>loadClass(MultiParentClassLoader.java:298)
> >>at java.lang.ClassLoader.loadClass(Unknown Source)
> >>...
> >>
> >>Do I need to put a reference to MyServletJAR.jar in geronimo-
> >>application.xml or geronimo-web.xml and if so how do i do that? Or
> >>does MyServletJAR.jar need to contain something else to tell
> >>geronimo about the servlet?
> >>
> >>Many thanks,
> >>
> >>Tim.
> >>
> >>
> >
>
>__________________________________________________________________________________

> >* This message is intended only for the use of the individual or
> entity to which it is addressed, and may contain information that is
> privileged, confidential and exempt from disclosure under applicable
> law. Unless you are the addressee (or authorized to receive for the
> addressee), you may not use, copy or disclose the message or any
> information contained in the message. If you have received this
> message in error, please advise the sender by reply e-mail , and
> delete the message, or call (collect) 001 613 747 4698. *
> >
> >
>

__________________________________________________________________________________
* This message is intended only for the use of the individual or entity to which it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. Unless you are the addressee (or authorized to receive for the addressee), you may not use, copy or disclose the message or any information contained in the message. If you have received this message in error, please advise the sender by reply e-mail , and delete the message, or call (collect) 001 613 747 4698. *


Re: Servlet fails to deploy

Posted by Aman Nanner/MxI Technologies <am...@mxi.com>.
I have raised a JIRA issue:

https://issues.apache.org/jira/browse/GERONIMO-2818


David Jencks <da...@yahoo.com> wrote on 02-09-2007 01:48:44 PM:

> That looks like a bug, could you file a jira issue please?
>
> thanks
> david jencks
>
> On Feb 9, 2007, at 9:02 AM, Aman Nanner/MxI Technologies wrote:
>
> > It seems like the behaviour is different depending on whether I
> > deploy the
> > EAR as "inPlace" or not.  I was deploying an expanded EAR "inPlace"
> > and it
> > seems that I needed the "../" prefix before each JAR in my Manifest
> > class
> > path.  I tried deploying an EAR containing actual JAR archives
> > without the
> > "inPlace" attribute, and I had to change my Manifest classpath
> > references
> > by removing the "../" prefix to make it work.
> >
> > My guess is that the deployer creates a different folder hiearchy when
> > deplying an application without the "inPlace" attribute.
> >
> > Dario Andrade <da...@datscom.com.br> wrote on 02-01-2007 03:28:18 PM:
> >
> >>
> >> for me, if you put
> >>
> >> Class-Path: library.jar
> >>
> >> directly (without path info) in the MANIFEST.MF and the jar itself
> >> in the root of the ear, it will work
> >>
> >>
> >> Cheers,
> >> Dario Andrade
> >>
> >> Aman Nanner/MxI Technologies escreveu:
> >>
> >>> Is this supposed to work the same way when manipulating the Class-
> >>> Path
> >>> entry of a Manifest file in an EJB JAR file, rather than a WAR?  It
> > seems
> >>> that I'm unable to reference any libraries that I put in the root
> >>> of the
> >>> EAR file.  I have to place the library JARS directly in the EJB
> >>> module
> > and
> >>> reference them there from the Manifest.  For example, this works
> >>> for me:
> >>>
> >>> EAR
> >>>  - META-INF/application.xml
> >>>  - META-INF/geronimo-application.xml
> >>>  + EJB JAR
> >>>       - META-INF/lib/library.jar
> >>>           -com.foo.Foo.class
> >>>       - META-INF/MANIFEST.MF: Class-Path: META-INF/lib/library.jar
> >>>       - META-INF/ejb-jar.xml
> >>>       - META-INF/openejb-jar.xml
> >>>
> >>>
> >>> but this does not:
> >>>
> >>> EAR
> >>>  - META-INF/application.xml
> >>>  - META-INF/geronimo-application.xml
> >>>  + lib/library.jar
> >>>       - com.foo.Foo.class
> >>>  + EJB JAR
> >>>       - META-INF/MANIFEST.MF: Class-Path: ./lib/library.jar
> >>>       - META-INF/ejb-jar.xml
> >>>       - META-INF/openejb-jar.xml
> >>>
> >>>
> >>> "Tim Davidson" <tr...@gmail.com> wrote on 02-01-2007
> >>> 03:47:49 AM:
> >>>
> >>>
> >>>
> >>>> hmmm taking your advice and moving the JAR to the root of the EAR
> >>>> and updating the manifest class-path accordingly fixed the problem.
> >>>> So this got me thinking and I tried it again, using a dot in front
> >>>> of the path (./lib/MyServeltJAR.jar) and it worked ok, this was a
> >>>> difficult one to spot!
> >>>>
> >>>> Thanks again,
> >>>>
> >>>> Tim.
> >>>>
> >>>>
> >>>
> >>>
> >>>
> >>>> On 31/01/07, David Carew < dccarew@gmail.com> wrote:
> >>>> I've done this but the utility jar was in the root of the EAR. I
> >>>> would suggest putting the utility jar in the root of the EAR file
> >>>> and then refer to it in the WAR files manifest using the jar files
> >>>> name (without any directory slashes).
> >>>>
> >>>>
> >>>>
> >>>
> >>>
> >>>
> >>>> On 1/31/07, Tim Davidson < trdavidson@gmail.com> wrote:
> >>>> Hi,
> >>>>
> >>>> I am having a problem with the servlet classpath for my EAR file
> >>>> which successfully deploys on GlassFish and JBoss. I have a
> >>>> Servlet,
> >>>> MyServlet which is in a JAR, MyServeltJAR.jar, the jar is
> >>>> referenced
> >>>> in the Class-Path attribute of the WAR files MANIFEST file, and the
> >>>> servlet is referenced in web.xml ie.
> >>>>
> >>>> EAR
> >>>>  - META-INF/application.xml
> >>>>  - META-INF/geronimo-application.xml
> >>>>  + lib/MyServletJAR.jar
> >>>>       - com.foo.MyServelt.class
> >>>>  + WAR
> >>>>       - META-INF/MANIFEST.MF: Class-Path: /lib/MyServletJAR.jar
> >>>>       - WEB-INF/web.xml: <servlet>com.foo.MyServlet</servlet>
> >>>>       - WEB-INF/geronimo-web.xml
> >>>>
> >>>> but Geronimo fails to deply the EAR as it cannot find the Servlet
> > class:
> >>>>
> >>>>
> >>>> Could not load servlet class com.foo.MyServlet
> >>>> org.apache.geronimo.common.DeploymentException: Could not load
> >>>> servlet class com.foo.MyServlet
> >>>> at org.apache.geronimo.tomcat.deployment.TomcatModuleBuilder.
> >>>> addGBeans(TomcatModuleBuilder.java:386)
> >>>> at org.apache.geronimo.tomcat.deployment.
> >>>> TomcatModuleBuilder$$FastClassByCGLIB$$6f85ec2c.invoke(<generated>)
> >>>> at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:53)
> >>>> ...
> >>>>
> >>>> Caused by: java.lang.ClassNotFoundException: com.foo.
> >>>> MyFrameworkServlet in classloader
> >>>>
> >>>>
> >>> default/myapp_myapp.war/1170243138828/car
> >>>
> >>>
> >>>> at org.apache.geronimo.kernel.config.MultiParentClassLoader.
> >>>> loadClass(MultiParentClassLoader.java:298)
> >>>> at java.lang.ClassLoader.loadClass(Unknown Source)
> >>>> ...
> >>>>
> >>>> Do I need to put a reference to MyServletJAR.jar in geronimo-
> >>>> application.xml or geronimo-web.xml and if so how do i do that? Or
> >>>> does MyServletJAR.jar need to contain something else to tell
> >>>> geronimo about the servlet?
> >>>>
> >>>> Many thanks,
> >>>>
> >>>> Tim.
> >>>>
> >>>>
> >>>
> >>
> >> _____________________________________________________________________
> >> _____________
> >
> >>> * This message is intended only for the use of the individual or
> >> entity to which it is addressed, and may contain information that is
> >> privileged, confidential and exempt from disclosure under applicable
> >> law. Unless you are the addressee (or authorized to receive for the
> >> addressee), you may not use, copy or disclose the message or any
> >> information contained in the message. If you have received this
> >> message in error, please advise the sender by reply e-mail , and
> >> delete the message, or call (collect) 001 613 747 4698. *
> >>>
> >>>
> >>
> >
> > ______________________________________________________________________
> > ____________
> > * This message is intended only for the use of the individual or
> > entity to which it is addressed, and may contain information that
> > is privileged, confidential and exempt from disclosure under
> > applicable law. Unless you are the addressee (or authorized to
> > receive for the addressee), you may not use, copy or disclose the
> > message or any information contained in the message. If you have
> > received this message in error, please advise the sender by reply e-
> > mail , and delete the message, or call (collect) 001 613 747 4698. *
> >
>

__________________________________________________________________________________
* This message is intended only for the use of the individual or entity to which it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. Unless you are the addressee (or authorized to receive for the addressee), you may not use, copy or disclose the message or any information contained in the message. If you have received this message in error, please advise the sender by reply e-mail , and delete the message, or call (collect) 001 613 747 4698. *


Re: Servlet fails to deploy

Posted by David Jencks <da...@yahoo.com>.
That looks like a bug, could you file a jira issue please?

thanks
david jencks

On Feb 9, 2007, at 9:02 AM, Aman Nanner/MxI Technologies wrote:

> It seems like the behaviour is different depending on whether I  
> deploy the
> EAR as "inPlace" or not.  I was deploying an expanded EAR "inPlace"  
> and it
> seems that I needed the "../" prefix before each JAR in my Manifest  
> class
> path.  I tried deploying an EAR containing actual JAR archives  
> without the
> "inPlace" attribute, and I had to change my Manifest classpath  
> references
> by removing the "../" prefix to make it work.
>
> My guess is that the deployer creates a different folder hiearchy when
> deplying an application without the "inPlace" attribute.
>
> Dario Andrade <da...@datscom.com.br> wrote on 02-01-2007 03:28:18 PM:
>
>>
>> for me, if you put
>>
>> Class-Path: library.jar
>>
>> directly (without path info) in the MANIFEST.MF and the jar itself
>> in the root of the ear, it will work
>>
>>
>> Cheers,
>> Dario Andrade
>>
>> Aman Nanner/MxI Technologies escreveu:
>>
>>> Is this supposed to work the same way when manipulating the Class- 
>>> Path
>>> entry of a Manifest file in an EJB JAR file, rather than a WAR?  It
> seems
>>> that I'm unable to reference any libraries that I put in the root  
>>> of the
>>> EAR file.  I have to place the library JARS directly in the EJB  
>>> module
> and
>>> reference them there from the Manifest.  For example, this works  
>>> for me:
>>>
>>> EAR
>>>  - META-INF/application.xml
>>>  - META-INF/geronimo-application.xml
>>>  + EJB JAR
>>>       - META-INF/lib/library.jar
>>>           -com.foo.Foo.class
>>>       - META-INF/MANIFEST.MF: Class-Path: META-INF/lib/library.jar
>>>       - META-INF/ejb-jar.xml
>>>       - META-INF/openejb-jar.xml
>>>
>>>
>>> but this does not:
>>>
>>> EAR
>>>  - META-INF/application.xml
>>>  - META-INF/geronimo-application.xml
>>>  + lib/library.jar
>>>       - com.foo.Foo.class
>>>  + EJB JAR
>>>       - META-INF/MANIFEST.MF: Class-Path: ./lib/library.jar
>>>       - META-INF/ejb-jar.xml
>>>       - META-INF/openejb-jar.xml
>>>
>>>
>>> "Tim Davidson" <tr...@gmail.com> wrote on 02-01-2007  
>>> 03:47:49 AM:
>>>
>>>
>>>
>>>> hmmm taking your advice and moving the JAR to the root of the EAR
>>>> and updating the manifest class-path accordingly fixed the problem.
>>>> So this got me thinking and I tried it again, using a dot in front
>>>> of the path (./lib/MyServeltJAR.jar) and it worked ok, this was a
>>>> difficult one to spot!
>>>>
>>>> Thanks again,
>>>>
>>>> Tim.
>>>>
>>>>
>>>
>>>
>>>
>>>> On 31/01/07, David Carew < dccarew@gmail.com> wrote:
>>>> I've done this but the utility jar was in the root of the EAR. I
>>>> would suggest putting the utility jar in the root of the EAR file
>>>> and then refer to it in the WAR files manifest using the jar files
>>>> name (without any directory slashes).
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>>> On 1/31/07, Tim Davidson < trdavidson@gmail.com> wrote:
>>>> Hi,
>>>>
>>>> I am having a problem with the servlet classpath for my EAR file
>>>> which successfully deploys on GlassFish and JBoss. I have a  
>>>> Servlet,
>>>> MyServlet which is in a JAR, MyServeltJAR.jar, the jar is  
>>>> referenced
>>>> in the Class-Path attribute of the WAR files MANIFEST file, and the
>>>> servlet is referenced in web.xml ie.
>>>>
>>>> EAR
>>>>  - META-INF/application.xml
>>>>  - META-INF/geronimo-application.xml
>>>>  + lib/MyServletJAR.jar
>>>>       - com.foo.MyServelt.class
>>>>  + WAR
>>>>       - META-INF/MANIFEST.MF: Class-Path: /lib/MyServletJAR.jar
>>>>       - WEB-INF/web.xml: <servlet>com.foo.MyServlet</servlet>
>>>>       - WEB-INF/geronimo-web.xml
>>>>
>>>> but Geronimo fails to deply the EAR as it cannot find the Servlet
> class:
>>>>
>>>>
>>>> Could not load servlet class com.foo.MyServlet
>>>> org.apache.geronimo.common.DeploymentException: Could not load
>>>> servlet class com.foo.MyServlet
>>>> at org.apache.geronimo.tomcat.deployment.TomcatModuleBuilder.
>>>> addGBeans(TomcatModuleBuilder.java:386)
>>>> at org.apache.geronimo.tomcat.deployment.
>>>> TomcatModuleBuilder$$FastClassByCGLIB$$6f85ec2c.invoke(<generated>)
>>>> at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:53)
>>>> ...
>>>>
>>>> Caused by: java.lang.ClassNotFoundException: com.foo.
>>>> MyFrameworkServlet in classloader
>>>>
>>>>
>>> default/myapp_myapp.war/1170243138828/car
>>>
>>>
>>>> at org.apache.geronimo.kernel.config.MultiParentClassLoader.
>>>> loadClass(MultiParentClassLoader.java:298)
>>>> at java.lang.ClassLoader.loadClass(Unknown Source)
>>>> ...
>>>>
>>>> Do I need to put a reference to MyServletJAR.jar in geronimo-
>>>> application.xml or geronimo-web.xml and if so how do i do that? Or
>>>> does MyServletJAR.jar need to contain something else to tell
>>>> geronimo about the servlet?
>>>>
>>>> Many thanks,
>>>>
>>>> Tim.
>>>>
>>>>
>>>
>>
>> _____________________________________________________________________ 
>> _____________
>
>>> * This message is intended only for the use of the individual or
>> entity to which it is addressed, and may contain information that is
>> privileged, confidential and exempt from disclosure under applicable
>> law. Unless you are the addressee (or authorized to receive for the
>> addressee), you may not use, copy or disclose the message or any
>> information contained in the message. If you have received this
>> message in error, please advise the sender by reply e-mail , and
>> delete the message, or call (collect) 001 613 747 4698. *
>>>
>>>
>>
>
> ______________________________________________________________________ 
> ____________
> * This message is intended only for the use of the individual or  
> entity to which it is addressed, and may contain information that  
> is privileged, confidential and exempt from disclosure under  
> applicable law. Unless you are the addressee (or authorized to  
> receive for the addressee), you may not use, copy or disclose the  
> message or any information contained in the message. If you have  
> received this message in error, please advise the sender by reply e- 
> mail , and delete the message, or call (collect) 001 613 747 4698. *
>


Re: Servlet fails to deploy

Posted by Aman Nanner/MxI Technologies <am...@mxi.com>.
It seems like the behaviour is different depending on whether I deploy the
EAR as "inPlace" or not.  I was deploying an expanded EAR "inPlace" and it
seems that I needed the "../" prefix before each JAR in my Manifest class
path.  I tried deploying an EAR containing actual JAR archives without the
"inPlace" attribute, and I had to change my Manifest classpath references
by removing the "../" prefix to make it work.

My guess is that the deployer creates a different folder hiearchy when
deplying an application without the "inPlace" attribute.

Dario Andrade <da...@datscom.com.br> wrote on 02-01-2007 03:28:18 PM:

>
> for me, if you put
>
> Class-Path: library.jar
>
> directly (without path info) in the MANIFEST.MF and the jar itself
> in the root of the ear, it will work
>
>
> Cheers,
> Dario Andrade
>
> Aman Nanner/MxI Technologies escreveu:
>
> >Is this supposed to work the same way when manipulating the Class-Path
> >entry of a Manifest file in an EJB JAR file, rather than a WAR?  It
seems
> >that I'm unable to reference any libraries that I put in the root of the
> >EAR file.  I have to place the library JARS directly in the EJB module
and
> >reference them there from the Manifest.  For example, this works for me:
> >
> >EAR
> >  - META-INF/application.xml
> >  - META-INF/geronimo-application.xml
> >  + EJB JAR
> >       - META-INF/lib/library.jar
> >           -com.foo.Foo.class
> >       - META-INF/MANIFEST.MF: Class-Path: META-INF/lib/library.jar
> >       - META-INF/ejb-jar.xml
> >       - META-INF/openejb-jar.xml
> >
> >
> >but this does not:
> >
> >EAR
> >  - META-INF/application.xml
> >  - META-INF/geronimo-application.xml
> >  + lib/library.jar
> >       - com.foo.Foo.class
> >  + EJB JAR
> >       - META-INF/MANIFEST.MF: Class-Path: ./lib/library.jar
> >       - META-INF/ejb-jar.xml
> >       - META-INF/openejb-jar.xml
> >
> >
> >"Tim Davidson" <tr...@gmail.com> wrote on 02-01-2007 03:47:49 AM:
> >
> >
> >
> >>hmmm taking your advice and moving the JAR to the root of the EAR
> >>and updating the manifest class-path accordingly fixed the problem.
> >>So this got me thinking and I tried it again, using a dot in front
> >>of the path (./lib/MyServeltJAR.jar) and it worked ok, this was a
> >>difficult one to spot!
> >>
> >>Thanks again,
> >>
> >>Tim.
> >>
> >>
> >
> >
> >
> >>On 31/01/07, David Carew < dccarew@gmail.com> wrote:
> >>I've done this but the utility jar was in the root of the EAR. I
> >>would suggest putting the utility jar in the root of the EAR file
> >>and then refer to it in the WAR files manifest using the jar files
> >>name (without any directory slashes).
> >>
> >>
> >>
> >
> >
> >
> >>On 1/31/07, Tim Davidson < trdavidson@gmail.com> wrote:
> >>Hi,
> >>
> >>I am having a problem with the servlet classpath for my EAR file
> >>which successfully deploys on GlassFish and JBoss. I have a Servlet,
> >>MyServlet which is in a JAR, MyServeltJAR.jar, the jar is referenced
> >>in the Class-Path attribute of the WAR files MANIFEST file, and the
> >>servlet is referenced in web.xml ie.
> >>
> >>EAR
> >>  - META-INF/application.xml
> >>  - META-INF/geronimo-application.xml
> >>  + lib/MyServletJAR.jar
> >>       - com.foo.MyServelt.class
> >>  + WAR
> >>       - META-INF/MANIFEST.MF: Class-Path: /lib/MyServletJAR.jar
> >>       - WEB-INF/web.xml: <servlet>com.foo.MyServlet</servlet>
> >>       - WEB-INF/geronimo-web.xml
> >>
> >>but Geronimo fails to deply the EAR as it cannot find the Servlet
class:
> >>
> >>
> >>Could not load servlet class com.foo.MyServlet
> >>org.apache.geronimo.common.DeploymentException: Could not load
> >>servlet class com.foo.MyServlet
> >>at org.apache.geronimo.tomcat.deployment.TomcatModuleBuilder.
> >>addGBeans(TomcatModuleBuilder.java:386)
> >>at org.apache.geronimo.tomcat.deployment.
> >>TomcatModuleBuilder$$FastClassByCGLIB$$6f85ec2c.invoke(<generated>)
> >>at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:53)
> >>...
> >>
> >>Caused by: java.lang.ClassNotFoundException: com.foo.
> >>MyFrameworkServlet in classloader
> >>
> >>
> >default/myapp_myapp.war/1170243138828/car
> >
> >
> >>at org.apache.geronimo.kernel.config.MultiParentClassLoader.
> >>loadClass(MultiParentClassLoader.java:298)
> >>at java.lang.ClassLoader.loadClass(Unknown Source)
> >>...
> >>
> >>Do I need to put a reference to MyServletJAR.jar in geronimo-
> >>application.xml or geronimo-web.xml and if so how do i do that? Or
> >>does MyServletJAR.jar need to contain something else to tell
> >>geronimo about the servlet?
> >>
> >>Many thanks,
> >>
> >>Tim.
> >>
> >>
> >
>
>__________________________________________________________________________________

> >* This message is intended only for the use of the individual or
> entity to which it is addressed, and may contain information that is
> privileged, confidential and exempt from disclosure under applicable
> law. Unless you are the addressee (or authorized to receive for the
> addressee), you may not use, copy or disclose the message or any
> information contained in the message. If you have received this
> message in error, please advise the sender by reply e-mail , and
> delete the message, or call (collect) 001 613 747 4698. *
> >
> >
>

__________________________________________________________________________________
* This message is intended only for the use of the individual or entity to which it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. Unless you are the addressee (or authorized to receive for the addressee), you may not use, copy or disclose the message or any information contained in the message. If you have received this message in error, please advise the sender by reply e-mail , and delete the message, or call (collect) 001 613 747 4698. *


Re: Servlet fails to deploy

Posted by Dario Andrade <da...@datscom.com.br>.
for me, if you put

Class-Path: library.jar

directly (without path info) in the MANIFEST.MF and the jar itself in the root of the ear, it will work


Cheers,
Dario Andrade

Aman Nanner/MxI Technologies escreveu:

>Is this supposed to work the same way when manipulating the Class-Path
>entry of a Manifest file in an EJB JAR file, rather than a WAR?  It seems
>that I'm unable to reference any libraries that I put in the root of the
>EAR file.  I have to place the library JARS directly in the EJB module and
>reference them there from the Manifest.  For example, this works for me:
>
>EAR
>  - META-INF/application.xml
>  - META-INF/geronimo-application.xml
>  + EJB JAR
>       - META-INF/lib/library.jar
>           -com.foo.Foo.class
>       - META-INF/MANIFEST.MF: Class-Path: META-INF/lib/library.jar
>       - META-INF/ejb-jar.xml
>       - META-INF/openejb-jar.xml
>
>
>but this does not:
>
>EAR
>  - META-INF/application.xml
>  - META-INF/geronimo-application.xml
>  + lib/library.jar
>       - com.foo.Foo.class
>  + EJB JAR
>       - META-INF/MANIFEST.MF: Class-Path: ./lib/library.jar
>       - META-INF/ejb-jar.xml
>       - META-INF/openejb-jar.xml
>
>
>"Tim Davidson" <tr...@gmail.com> wrote on 02-01-2007 03:47:49 AM:
>
>  
>
>>hmmm taking your advice and moving the JAR to the root of the EAR
>>and updating the manifest class-path accordingly fixed the problem.
>>So this got me thinking and I tried it again, using a dot in front
>>of the path (./lib/MyServeltJAR.jar) and it worked ok, this was a
>>difficult one to spot!
>>
>>Thanks again,
>>
>>Tim.
>>    
>>
>
>  
>
>>On 31/01/07, David Carew < dccarew@gmail.com> wrote:
>>I've done this but the utility jar was in the root of the EAR. I
>>would suggest putting the utility jar in the root of the EAR file
>>and then refer to it in the WAR files manifest using the jar files
>>name (without any directory slashes).
>>
>>    
>>
>
>  
>
>>On 1/31/07, Tim Davidson < trdavidson@gmail.com> wrote:
>>Hi,
>>
>>I am having a problem with the servlet classpath for my EAR file
>>which successfully deploys on GlassFish and JBoss. I have a Servlet,
>>MyServlet which is in a JAR, MyServeltJAR.jar, the jar is referenced
>>in the Class-Path attribute of the WAR files MANIFEST file, and the
>>servlet is referenced in web.xml ie.
>>
>>EAR
>>  - META-INF/application.xml
>>  - META-INF/geronimo-application.xml
>>  + lib/MyServletJAR.jar
>>       - com.foo.MyServelt.class
>>  + WAR
>>       - META-INF/MANIFEST.MF: Class-Path: /lib/MyServletJAR.jar
>>       - WEB-INF/web.xml: <servlet>com.foo.MyServlet</servlet>
>>       - WEB-INF/geronimo-web.xml
>>
>>but Geronimo fails to deply the EAR as it cannot find the Servlet class:
>>
>>
>>Could not load servlet class com.foo.MyServlet
>>org.apache.geronimo.common.DeploymentException: Could not load
>>servlet class com.foo.MyServlet
>>at org.apache.geronimo.tomcat.deployment.TomcatModuleBuilder.
>>addGBeans(TomcatModuleBuilder.java:386)
>>at org.apache.geronimo.tomcat.deployment.
>>TomcatModuleBuilder$$FastClassByCGLIB$$6f85ec2c.invoke(<generated>)
>>at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:53)
>>...
>>
>>Caused by: java.lang.ClassNotFoundException: com.foo.
>>MyFrameworkServlet in classloader
>>    
>>
>default/myapp_myapp.war/1170243138828/car
>  
>
>>at org.apache.geronimo.kernel.config.MultiParentClassLoader.
>>loadClass(MultiParentClassLoader.java:298)
>>at java.lang.ClassLoader.loadClass(Unknown Source)
>>...
>>
>>Do I need to put a reference to MyServletJAR.jar in geronimo-
>>application.xml or geronimo-web.xml and if so how do i do that? Or
>>does MyServletJAR.jar need to contain something else to tell
>>geronimo about the servlet?
>>
>>Many thanks,
>>
>>Tim.
>>    
>>
>
>__________________________________________________________________________________
>* This message is intended only for the use of the individual or entity to which it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. Unless you are the addressee (or authorized to receive for the addressee), you may not use, copy or disclose the message or any information contained in the message. If you have received this message in error, please advise the sender by reply e-mail , and delete the message, or call (collect) 001 613 747 4698. *
>  
>


Re: Servlet fails to deploy

Posted by Aman Nanner/MxI Technologies <am...@mxi.com>.
Interesting, I changed the Class-Path references from "./lib/library.jar"
to "../lib/library.jar" (double period instead of single period), and it
worked.  So it seems that the initial base directory for Manifest classpath
references for an EJB module is the EJB module itself, whereas for WAR
files, the initial base directory is the EAR file.  Is this done by design?

Aman Nanner/MxI Technologies <am...@mxi.com> wrote on 02-01-2007
03:12:07 PM:

> Is this supposed to work the same way when manipulating the Class-Path
> entry of a Manifest file in an EJB JAR file, rather than a WAR?  It seems
> that I'm unable to reference any libraries that I put in the root of the
> EAR file.  I have to place the library JARS directly in the EJB module
and
> reference them there from the Manifest.  For example, this works for me:
>
> EAR
>   - META-INF/application.xml
>   - META-INF/geronimo-application.xml
>   + EJB JAR
>        - META-INF/lib/library.jar
>            -com.foo.Foo.class
>        - META-INF/MANIFEST.MF: Class-Path: META-INF/lib/library.jar
>        - META-INF/ejb-jar.xml
>        - META-INF/openejb-jar.xml
>
>
> but this does not:
>
> EAR
>   - META-INF/application.xml
>   - META-INF/geronimo-application.xml
>   + lib/library.jar
>        - com.foo.Foo.class
>   + EJB JAR
>        - META-INF/MANIFEST.MF: Class-Path: ./lib/library.jar
>        - META-INF/ejb-jar.xml
>        - META-INF/openejb-jar.xml
>
>
> "Tim Davidson" <tr...@gmail.com> wrote on 02-01-2007 03:47:49 AM:
>
> > hmmm taking your advice and moving the JAR to the root of the EAR
> > and updating the manifest class-path accordingly fixed the problem.
> > So this got me thinking and I tried it again, using a dot in front
> > of the path (./lib/MyServeltJAR.jar) and it worked ok, this was a
> > difficult one to spot!
> >
> > Thanks again,
> >
> > Tim.
>
> > On 31/01/07, David Carew < dccarew@gmail.com> wrote:
> > I've done this but the utility jar was in the root of the EAR. I
> > would suggest putting the utility jar in the root of the EAR file
> > and then refer to it in the WAR files manifest using the jar files
> > name (without any directory slashes).
> >
>
> > On 1/31/07, Tim Davidson < trdavidson@gmail.com> wrote:
> > Hi,
> >
> > I am having a problem with the servlet classpath for my EAR file
> > which successfully deploys on GlassFish and JBoss. I have a Servlet,
> > MyServlet which is in a JAR, MyServeltJAR.jar, the jar is referenced
> > in the Class-Path attribute of the WAR files MANIFEST file, and the
> > servlet is referenced in web.xml ie.
> >
> > EAR
> >   - META-INF/application.xml
> >   - META-INF/geronimo-application.xml
> >   + lib/MyServletJAR.jar
> >        - com.foo.MyServelt.class
> >   + WAR
> >        - META-INF/MANIFEST.MF: Class-Path: /lib/MyServletJAR.jar
> >        - WEB-INF/web.xml: <servlet>com.foo.MyServlet</servlet>
> >        - WEB-INF/geronimo-web.xml
> >
> > but Geronimo fails to deply the EAR as it cannot find the Servlet
class:
> >
> >
> > Could not load servlet class com.foo.MyServlet
> > org.apache.geronimo.common.DeploymentException: Could not load
> > servlet class com.foo.MyServlet
> > at org.apache.geronimo.tomcat.deployment.TomcatModuleBuilder.
> > addGBeans(TomcatModuleBuilder.java:386)
> > at org.apache.geronimo.tomcat.deployment.
> > TomcatModuleBuilder$$FastClassByCGLIB$$6f85ec2c.invoke(<generated>)
> > at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:53)
> > ...
> >
> > Caused by: java.lang.ClassNotFoundException: com.foo.
> > MyFrameworkServlet in classloader
> default/myapp_myapp.war/1170243138828/car
> > at org.apache.geronimo.kernel.config.MultiParentClassLoader.
> > loadClass(MultiParentClassLoader.java:298)
> > at java.lang.ClassLoader.loadClass(Unknown Source)
> > ...
> >
> > Do I need to put a reference to MyServletJAR.jar in geronimo-
> > application.xml or geronimo-web.xml and if so how do i do that? Or
> > does MyServletJAR.jar need to contain something else to tell
> > geronimo about the servlet?
> >
> > Many thanks,
> >
> > Tim.
>
>
__________________________________________________________________________________

> * This message is intended only for the use of the individual or
> entity to which it is addressed, and may contain information that is
> privileged, confidential and exempt from disclosure under applicable
> law. Unless you are the addressee (or authorized to receive for the
> addressee), you may not use, copy or disclose the message or any
> information contained in the message. If you have received this
> message in error, please advise the sender by reply e-mail , and
> delete the message, or call (collect) 001 613 747 4698. *
>

__________________________________________________________________________________
* This message is intended only for the use of the individual or entity to which it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. Unless you are the addressee (or authorized to receive for the addressee), you may not use, copy or disclose the message or any information contained in the message. If you have received this message in error, please advise the sender by reply e-mail , and delete the message, or call (collect) 001 613 747 4698. *


Re: Servlet fails to deploy

Posted by Aman Nanner/MxI Technologies <am...@mxi.com>.
Is this supposed to work the same way when manipulating the Class-Path
entry of a Manifest file in an EJB JAR file, rather than a WAR?  It seems
that I'm unable to reference any libraries that I put in the root of the
EAR file.  I have to place the library JARS directly in the EJB module and
reference them there from the Manifest.  For example, this works for me:

EAR
  - META-INF/application.xml
  - META-INF/geronimo-application.xml
  + EJB JAR
       - META-INF/lib/library.jar
           -com.foo.Foo.class
       - META-INF/MANIFEST.MF: Class-Path: META-INF/lib/library.jar
       - META-INF/ejb-jar.xml
       - META-INF/openejb-jar.xml


but this does not:

EAR
  - META-INF/application.xml
  - META-INF/geronimo-application.xml
  + lib/library.jar
       - com.foo.Foo.class
  + EJB JAR
       - META-INF/MANIFEST.MF: Class-Path: ./lib/library.jar
       - META-INF/ejb-jar.xml
       - META-INF/openejb-jar.xml


"Tim Davidson" <tr...@gmail.com> wrote on 02-01-2007 03:47:49 AM:

> hmmm taking your advice and moving the JAR to the root of the EAR
> and updating the manifest class-path accordingly fixed the problem.
> So this got me thinking and I tried it again, using a dot in front
> of the path (./lib/MyServeltJAR.jar) and it worked ok, this was a
> difficult one to spot!
>
> Thanks again,
>
> Tim.

> On 31/01/07, David Carew < dccarew@gmail.com> wrote:
> I've done this but the utility jar was in the root of the EAR. I
> would suggest putting the utility jar in the root of the EAR file
> and then refer to it in the WAR files manifest using the jar files
> name (without any directory slashes).
>

> On 1/31/07, Tim Davidson < trdavidson@gmail.com> wrote:
> Hi,
>
> I am having a problem with the servlet classpath for my EAR file
> which successfully deploys on GlassFish and JBoss. I have a Servlet,
> MyServlet which is in a JAR, MyServeltJAR.jar, the jar is referenced
> in the Class-Path attribute of the WAR files MANIFEST file, and the
> servlet is referenced in web.xml ie.
>
> EAR
>   - META-INF/application.xml
>   - META-INF/geronimo-application.xml
>   + lib/MyServletJAR.jar
>        - com.foo.MyServelt.class
>   + WAR
>        - META-INF/MANIFEST.MF: Class-Path: /lib/MyServletJAR.jar
>        - WEB-INF/web.xml: <servlet>com.foo.MyServlet</servlet>
>        - WEB-INF/geronimo-web.xml
>
> but Geronimo fails to deply the EAR as it cannot find the Servlet class:
>
>
> Could not load servlet class com.foo.MyServlet
> org.apache.geronimo.common.DeploymentException: Could not load
> servlet class com.foo.MyServlet
> at org.apache.geronimo.tomcat.deployment.TomcatModuleBuilder.
> addGBeans(TomcatModuleBuilder.java:386)
> at org.apache.geronimo.tomcat.deployment.
> TomcatModuleBuilder$$FastClassByCGLIB$$6f85ec2c.invoke(<generated>)
> at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:53)
> ...
>
> Caused by: java.lang.ClassNotFoundException: com.foo.
> MyFrameworkServlet in classloader
default/myapp_myapp.war/1170243138828/car
> at org.apache.geronimo.kernel.config.MultiParentClassLoader.
> loadClass(MultiParentClassLoader.java:298)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> ...
>
> Do I need to put a reference to MyServletJAR.jar in geronimo-
> application.xml or geronimo-web.xml and if so how do i do that? Or
> does MyServletJAR.jar need to contain something else to tell
> geronimo about the servlet?
>
> Many thanks,
>
> Tim.

__________________________________________________________________________________
* This message is intended only for the use of the individual or entity to which it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. Unless you are the addressee (or authorized to receive for the addressee), you may not use, copy or disclose the message or any information contained in the message. If you have received this message in error, please advise the sender by reply e-mail , and delete the message, or call (collect) 001 613 747 4698. *


Re: Servlet fails to deploy

Posted by Tim Davidson <tr...@gmail.com>.
hmmm taking your advice and moving the JAR to the root of the EAR and
updating the manifest class-path accordingly fixed the problem. So this got
me thinking and I tried it again, using a dot in front of the path (./lib/
MyServeltJAR.jar) and it worked ok, this was a difficult one to spot!

Thanks again,

Tim.

On 31/01/07, David Carew <dc...@gmail.com> wrote:
>
> I've done this but the utility jar was in the root of the EAR. I would
> suggest putting the utility jar in the root of the EAR file and then refer
> to it in the WAR files manifest using the jar files name (without any
> directory slashes).
>
> On 1/31/07, Tim Davidson <tr...@gmail.com> wrote:
> >
> > Hi,
> >
> > I am having a problem with the servlet classpath for my EAR file which
> > successfully deploys on GlassFish and JBoss. I have a Servlet, MyServlet
> > which is in a JAR, MyServeltJAR.jar, the jar is referenced in the
> > Class-Path attribute of the WAR files MANIFEST file, and the servlet is
> > referenced in web.xml ie.
> >
> > EAR
> >   - META-INF/application.xml
> >   - META-INF/geronimo-application.xml
> >   + lib/MyServletJAR.jar
> >        - com.foo.MyServelt.class
> >   + WAR
> >        - META-INF/MANIFEST.MF: Class-Path: /lib/MyServletJAR.jar
> >        - WEB-INF/web.xml: <servlet>com.foo.MyServlet</servlet>
> >        - WEB-INF/geronimo-web.xml
> >
> > but Geronimo fails to deply the EAR as it cannot find the Servlet class:
> >
> >
> > Could not load servlet class com.foo.MyServlet
> > org.apache.geronimo.common.DeploymentException: Could not load servlet
> > class com.foo.MyServlet
> > at org.apache.geronimo.tomcat.deployment.TomcatModuleBuilder.addGBeans(
> > TomcatModuleBuilder.java:386)
> > at
> > org.apache.geronimo.tomcat.deployment.TomcatModuleBuilder$$FastClassByCGLIB$$6f85ec2c.invoke(<generated>)
> >
> > at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:53)
> > ...
> >
> > Caused by: java.lang.ClassNotFoundException: com.foo.MyFrameworkServletin classloader default/myapp_myapp.war/1170243138828/car
> > at org.apache.geronimo.kernel.config.MultiParentClassLoader.loadClass(
> > MultiParentClassLoader.java:298)
> >  at java.lang.ClassLoader.loadClass(Unknown Source)
> > ...
> >
> > Do I need to put a reference to MyServletJAR.jar in
> > geronimo-application.xml or geronimo-web.xml and if so how do i do that?
> > Or does MyServletJAR.jar need to contain something else to tell geronimo
> > about the servlet?
> >
> > Many thanks,
> >
> > Tim.
> >
>
>

Re: Servlet fails to deploy

Posted by David Carew <dc...@gmail.com>.
I've done this but the utility jar was in the root of the EAR. I would
suggest putting the utility jar in the root of the EAR file and then refer
to it in the WAR files manifest using the jar files name (without any
directory slashes).

On 1/31/07, Tim Davidson <tr...@gmail.com> wrote:
>
> Hi,
>
> I am having a problem with the servlet classpath for my EAR file which
> successfully deploys on GlassFish and JBoss. I have a Servlet, MyServlet
> which is in a JAR, MyServeltJAR.jar, the jar is referenced in the
> Class-Path attribute of the WAR files MANIFEST file, and the servlet is
> referenced in web.xml ie.
>
> EAR
>   - META-INF/application.xml
>   - META-INF/geronimo-application.xml
>   + lib/MyServletJAR.jar
>        - com.foo.MyServelt.class
>   + WAR
>        - META-INF/MANIFEST.MF: Class-Path: /lib/MyServletJAR.jar
>        - WEB-INF/web.xml: <servlet>com.foo.MyServlet</servlet>
>        - WEB-INF/geronimo-web.xml
>
> but Geronimo fails to deply the EAR as it cannot find the Servlet class:
>
>
> Could not load servlet class com.foo.MyServlet
> org.apache.geronimo.common.DeploymentException: Could not load servlet
> class com.foo.MyServlet
> at org.apache.geronimo.tomcat.deployment.TomcatModuleBuilder.addGBeans(
> TomcatModuleBuilder.java:386)
> at
> org.apache.geronimo.tomcat.deployment.TomcatModuleBuilder$$FastClassByCGLIB$$6f85ec2c.invoke
> (<generated>)
> at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:53)
> ...
>
> Caused by: java.lang.ClassNotFoundException: com.foo.MyFrameworkServlet in
> classloader default/myapp_myapp.war/1170243138828/car
> at org.apache.geronimo.kernel.config.MultiParentClassLoader.loadClass(
> MultiParentClassLoader.java:298)
>  at java.lang.ClassLoader.loadClass(Unknown Source)
> ...
>
> Do I need to put a reference to MyServletJAR.jar in
> geronimo-application.xml or geronimo-web.xml and if so how do i do that?
> Or does MyServletJAR.jar need to contain something else to tell geronimo
> about the servlet?
>
> Many thanks,
>
> Tim.
>

Re: Servlet fails to deploy

Posted by David Jencks <da...@yahoo.com>.
Are you telling us the whole story :-) ?  Where is  
com.foo.MyFrameworkServlet?

This or something like it should work.  I have trouble remembering  
the rules about slashes, so I would try removing the leading slash  
from /lib/MyServletJAR.jar in the war's manifest classpath.

thanks
david jencks

On Jan 31, 2007, at 7:52 AM, Tim Davidson wrote:

> Hi,
>
> I am having a problem with the servlet classpath for my EAR file  
> which successfully deploys on GlassFish and JBoss. I have a  
> Servlet, MyServlet which is in a JAR, MyServeltJAR.jar, the jar is  
> referenced in the Class-Path attribute of the WAR files MANIFEST  
> file, and the servlet is referenced in web.xml ie.
>
> EAR
>   - META-INF/application.xml
>   - META-INF/geronimo-application.xml
>   + lib/MyServletJAR.jar
>        - com.foo.MyServelt.class
>   + WAR
>        - META-INF/MANIFEST.MF: Class-Path: /lib/MyServletJAR.jar
>        - WEB-INF/web.xml: <servlet>com.foo.MyServlet</servlet>
>        - WEB-INF/geronimo-web.xml
>
> but Geronimo fails to deply the EAR as it cannot find the Servlet  
> class:
>
>
> Could not load servlet class com.foo.MyServlet
> org.apache.geronimo.common.DeploymentException: Could not load  
> servlet class com.foo.MyServlet
> at  
> org.apache.geronimo.tomcat.deployment.TomcatModuleBuilder.addGBeans 
> (TomcatModuleBuilder.java:386)
> at org.apache.geronimo.tomcat.deployment.TomcatModuleBuilder$ 
> $FastClassByCGLIB$$6f85ec2c.invoke(<generated>)
> at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:53)
> ...
>
> Caused by: java.lang.ClassNotFoundException:  
> com.foo.MyFrameworkServlet in classloader default/myapp_myapp.war/ 
> 1170243138828/car
> at  
> org.apache.geronimo.kernel.config.MultiParentClassLoader.loadClass 
> (MultiParentClassLoader.java:298)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> ...
>
> Do I need to put a reference to MyServletJAR.jar in geronimo- 
> application.xml or geronimo-web.xml and if so how do i do that? Or  
> does MyServletJAR.jar need to contain something else to tell  
> geronimo about the servlet?
>
> Many thanks,
>
> Tim.