geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From viola lu <viola...@gmail.com>
Subject Re: Unable to classload servlet class using SharedLib GBean
Date Thu, 16 Sep 2010 02:01:41 GMT
You can also put all your jar files to default share lib folder :
$geronimo_home/var/shared/lib, and then add  sharelib dependency to your
application deployment plan:

<sys:dependency>
    <sys:groupId>geronimo</sys:groupId>
    <sys:artifactId>sharedlib</sys:artifactId>
    <sys:type>car</sys:type>
</sys:dependency>

this also works. And you don't have to change sharelib gbean configuration.

On Thu, Sep 16, 2010 at 9:15 AM, Ivan <xhhsld@gmail.com> wrote:

> IIRC, the SharedLib only takes affect on the runtime.
> One workaround is that first deploy a geronimo service module which
> contains the sharedlib gbean, and then add it as a dependency for your ear
> application, it should work.
>
> 2010/9/15 Anil Chawla <achawla@us.ibm.com>
>
>  Hi,
>> We're trying to use the SharedLib GBean to classload *all* of the
>> libraries for our application. This is because the libraries used by our
>> applications in Geronimo are also needed by our stand-alone Java processes.
>> We obviously don't want to duplicate the libraries for maintenance reasons.
>> We have an EAR containing two WAR files (each requiring the same set of
>> libraries), and we've defined the SharedLib reference within the EAR's
>> geronimo-application.xml. The SharedLib works fine for all of our libraries
>> except that it fails to classload the servlet file referenced in the web.xml
>> of the two WARs. The only way we've been able to get it to work is to
>> package the library containing our servlet class inside the EAR. Why can't
>> the SharedLib load the servlet class?
>>
>> Here is the SharedLib entry in geronimo-application.xml:
>>
>> <gbean name="SharedLib"
>> class="org.apache.geronimo.system.sharedlib.SharedLib">
>> <attribute name="libDirs">
>> /data/support,/data/MyApp/lib,/data/MyApp/libext
>> </attribute>
>> <attribute name="classesDirs">
>> /data/support/conf,/data/MyApp/database,/data/MyApp/conf
>> </attribute>
>> <reference name="ServerInfo">
>> <name>ServerInfo</name>
>> </reference>
>> </gbean>
>>
>> And the servlet definition in web.xml:
>>
>> <servlet>
>> <servlet-name>front_controller</servlet-name>
>> <servlet-class>org.myapp.controller.FrontController</servlet-class>
>> </servlet>
>>
>> The "FrontController" class is defined in /data/MyApp/libext/myapp.jar.
>> When we deploy the EAR, we get the following exception:
>>
>> Caused by: java.lang.ClassNotFoundException:
>> org.myapp.controller.FrontController in classloader
>> MyApp/application_frontend.war/1.0/car
>> at
>> org.apache.geronimo.kernel.config.MultiParentClassLoader.loadOptimizedClass(MultiParentClassLoader.java:447)
>> at
>> org.apache.geronimo.kernel.config.MultiParentClassLoader.loadClass(MultiParentClassLoader.java:281)
>> at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
>> at
>> org.apache.geronimo.jaxws.builder.AdvancedWARWebServiceFinder.getPortInfo(AdvancedWARWebServiceFinder.java:142)
>> ... 22 more
>>
>> Thanks for your help.
>>
>> Anil Chawla
>>
>
>
>
> --
> Ivan
>



-- 
viola

Mime
View raw message