I'm having the same problem.
On jboss 3.2.7 I was able to add my webapplication.war\WEB-INF\classes directory to the classpath in an xml descriptor. Now jboss 4.0.3 is unable to load the classes.
Instead, is there a way I can deploy the mbeans inside WAR file?
if the war and the jar are using the same classloader repository, the EJBs will be able to load classes deployed in the .war. Repositories are configured in jboss.xml and jboss-web.xml with the <loader-repositpory> tag. However, <loader-repository> is will not be implemented in EJB3 until RC7, slated for release in mid-May.
There is no jar file that I'm trying to use for this exmple. I'm trying to deploy an MBean using an XML descriptor. The classes for the MBean are located in my WAR file. For example classes would exist here:
I put the descriptor for this inside the user-service.xml in the deploy directory. Like this:
<classpath codebase="deploy/webapplication.war/WEB-INF/classes/com/example/mbeans/" archives="*.class" /> <mbean code="com.example.mbeans.Test" name="com.example.mbeans:service=Test"> </mbean>
When jboss attempts to deploy the user-service.xml it can't find a classloader for the classes:
09:56:21,583 ERROR [MainDeployer] Could not create deployment: file:/C:/jboss-4.0.3SP1/server/default/deploy/user-service.xml
org.jboss.deployment.DeploymentException: No ClassLoaders found for: mil.navy.fnmoc.pel.services.mbeans.CacheMonitor; - nested throwable: (java.lang.ClassNotFoundException: No ClassLoaders found for: mil.navy.fnmoc.pel.services.mbeans.CacheMonitor)
The way I understand it the loader repository tag will limit the scope of my classes inside the war file. It seems to me that this is already the case. Am I trying to use this incorrectly?
thanks for the help,
You need to use the JBoss classloader when deploying a web app that contains classes that need to be visible to an ejb3 deployment. You need to set the UseJBossWebLoader attribute to true in the tomcat jboss-service.xml
By default this was set to true. I still get the same error. Is there a similiar setting for webapps with classes that need to be made available to MBeans?