简体   繁体   中英

Can a JBoss sar depend on jar in lib?

I have an old JBoss server running 4.0.5. I have a SAR file in server/myserver/deploy with a jboss-service.xml containing:

<mbean code="com.me.MyStartup" name=":service=MyStartup">
    <depends>jboss.jca:service=RARDeployer</depends>
    <depends>jboss.jca:service=LocalTxCM,name=MyDS</depends>
    <depends>jboss.j2ee:module=myjar1.jar,service=EjbModule</depends>

    <propertytask="com.me.MyClass1" 
        executeOnStart="true" 
        executeOnShutdown="false"
        startupPriority="400"
        alias="MyClass1"/>

The class MyClass1 uses MyClass2 which is in server/myserver/lib. I get a NoClassDefFoundError for MyClass2 when starting JBoss. I don't think you can add dependencies on jars in the lib folder, so I'm not sure what the solution is. Could someone help please (stuck with 4.0.5 on this one, so any upgrade suggestions aren't viable).

Thanks, Paul

Paul,

you need couple of things, jboss-deployment-structure.xml in META-INF, and a resource reference to the jar containing MyClass2.

Step by step how to is here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM