service can't found classes
xaleyba Mar 7, 2007 8:49 AM
Hi
I've a JBoss service as a .sar directory defined with the following structure:
./com/xx/activemq/mbean/service ./lib ./META-INF
I've all needed jars in lib directory and my jboss-service file is defined as follows:
<!-- the SAR META-INF/jboss-service.xml descriptor --> <server> <loader-repository> com.notifications.broker.service:loader=activemq-broker-service.sar <loader-repository-config>java2ParentDelegation=false</loader-repository-config> </loader-repository> <mbean code="com.xx.activemq.mbean.service.ActiveMQNetwork" name="jms.ActiveMQ:service=ActiveMQNetwork"> <attribute name="PropertiesResource">remote-jndi.properties</attribute> <depends>jboss:service=Naming</depends> <depends>user:service=QuartzService,name=QuartzService</depends> </mbean> <!-- Proxy factory for MyService that will call target method on the target service --> <mbean code="org.jboss.invocation.jrmp.server.JRMPProxyFactory" name="jboss.jmx:type=adaptor,name=MyActiveMQNetworkInvokeTarget,protocol=jrmp,service=proxyFactory"> <!-- Use the standard JRMPInvoker from conf/jboss-service.xxml --> <depends optional-attribute-name="InvokerName">jboss:service=invoker,type=jrmp</depends> <!-- The target MBean --> <depends optional-attribute-name="TargetName">jms.ActiveMQ:service=ActiveMQNetwork</depends> <!-- Where to bind the proxy factory --> <attribute name="JndiName">MyActiveMQNetworkInvokeTarget</attribute> <!-- Invoke target method instead of invoke(Invocation mi) --> <attribute name="InvokeTargetMethod">true</attribute> <!-- Comma-separated list of exported interfaces --> <attribute name="ExportedInterfaces">com.xx.activemq.mbean.service.ActiveMQNetworkMBean</attribute> <!-- client-side interceptors --> <attribute name="ClientInterceptors"> <interceptors> <interceptor>org.jboss.proxy.ClientMethodInterceptor</interceptor> <interceptor>org.jboss.proxy.SecurityInterceptor</interceptor> <interceptor>org.jboss.jmx.connector.invoker.client.InvokerAdaptorClientInterceptor</interceptor> <interceptor>org.jboss.invocation.InvokerInterceptor</interceptor> </interceptors> </attribute> </mbean> </server>
Everything worked well till I needed to isolate class loading adding loader-repository-config to the file. Now, when I start JBoss I got the message:
14:39:01,574 INFO [NamingService] Started jndi bootstrap jnpPort=1099, rmiPort=1098, backlog=50, bindAddress=/0.0.0.0, Client SocketFactory=null, Server SocketFactory=org.jboss.net.sockets.DefaultSocketFactory@ad093076 14:39:04,516 INFO [ServiceConfigurator] Problem configuring service jboss.jmx:type=adaptor,name=MyActiveMQNetworkInvokeTarget,protocol=jrmp,service=proxyFactory java.lang.IllegalArgumentException: Failed to find class: com.bs.activemq.mbean.service.ActiveMQNetworkMBean at org.jboss.util.propertyeditor.ClassArrayEditor.setAsText(ClassArrayEditor.java:38) at org.jboss.system.ServiceConfigurator.parseTextSerialData(ServiceConfigurator.java:541) at org.jboss.system.ServiceConfigurator.configure(ServiceConfigurator.java:311) at org.jboss.system.ServiceConfigurator.internalInstall(ServiceConfigurator.java:442) at org.jboss.system.ServiceConfigurator.install(ServiceConfigurator.java:153) at org.jboss.system.ServiceController.install(ServiceController.java:215) at jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source) at java.lang.reflect.Method.invoke(Ljava.lang.Object;[Ljava.lang.Object;I)Ljava.lang.Object;(Unknown Source) at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141) at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80) at org.jboss.mx.server.Invocation.invoke(Invocation.java:72) at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245) at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644) at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176) at $Proxy4.install(Lorg.w3c.dom.Element;Ljavax.management.ObjectName;)Ljava.util.List;(Unknown Source) at org.jboss.deployment.SARDeployer.create(SARDeployer.java:232) at org.jboss.deployment.MainDeployer.create(MainDeployer.java:935) at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:789) at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:753) at jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source) at java.lang.reflect.Method.invoke(Ljava.lang.Object;[Ljava.lang.Object;I)Ljava.lang.Object;(Unknown Source) at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141) at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80) at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:118) at org.jboss.mx.server.Invocation.invoke(Invocation.java:74) at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:127)
I counldn't understand why the service could not see my classes. (and I repeat, without the loader repository tag it wok well).
I've tried to solve it adding a tag but without success.
How could I solve the problem ?
Thanks in advance
C