2 Replies Latest reply on Oct 21, 2003 12:06 PM by Alex Paransky

    Problem Running a client to JBoss

    droyad Newbie

      I've been having trouble getting any application to access the bean on the JBoss Server. It always comes up with the error below. Java files and .xml files are also included. If someone could give some suggestions, it would be much appreciated as I'm at the end of my tether.

      It looks like something is wrong with the XML file, but what?


      - JDK 1.4 Beta 2
      - JBoss 4.0.0DR2
      - EJB Installs correctly in jboss, the problem occurs when trying to run the client


      Exception
      =========


      FATAL [main] (ClientServiceMBeanSupport.java:76) - Could not set up mbean server or mbeans in client
      javax.management.MBeanException: Exception thrown in the MBean's constructor
      at com.sun.jmx.mbeanserver.MBeanInstantiatorImpl.instantiate(MBeanInstantiatorImpl.java:259)
      at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.createMBean(DefaultMBeanServerInterceptor.java:298)
      at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.createMBean(DefaultMBeanServerInterceptor.java:207)
      at com.sun.jmx.mbeanserver.JmxMBeanServer.createMBean(JmxMBeanServer.java:405)
      at org.jboss.system.client.ClientServiceMBeanSupport.internalReadResolve(ClientServiceMBeanSupport.java:71)

      at java.rmi.MarshalledObject.get(MarshalledObject.java:135)
      at org.jnp.interfaces.MarshalledValuePair.get(MarshalledValuePair.java:30)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:522)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:479)
      at javax.naming.InitialContext.lookup(InitialContext.java:347)
      at InterestClient.main(InterestClient.java:44)
      Caused by: org.jboss.mx.util.JBossNotCompliantMBeanException: Error parsing the XML file:
      at org.jboss.mx.metadata.JBossXMBean10.build(JBossXMBean10.java:117)
      at org.jboss.mx.metadata.XMLMetaData.build(XMLMetaData.java:270)
      at org.jboss.mx.modelmbean.XMBean.(XMBean.java:214)
      at org.jboss.mx.modelmbean.XMBean.(XMBean.java:240)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
      at com.sun.jmx.mbeanserver.MBeanInstantiatorImpl.instantiate(MBeanInstantiatorImpl.java:234)
      ... 42 more
      Caused by: javax.management.RuntimeOperationsException: Exception occured in ModelMBeanOperationInfo constructor
      at javax.management.modelmbean.ModelMBeanOperationInfo.(ModelMBeanOperationInfo.java:278)
      at org.jboss.mx.metadata.JBossXMBean10.buildOperationInfo(JBossXMBean10.java:353)
      at org.jboss.mx.metadata.JBossXMBean10.buildMBeanMetaData(JBossXMBean10.java:221)
      at org.jboss.mx.metadata.JBossXMBean10.build(JBossXMBean10.java:108)
      ... 50 more
      Caused by: java.lang.IllegalArgumentException: Invalid descriptor passed in parameter
      ... 54 more
      javax.naming.CommunicationException [Root exception is java.io.InvalidObjectException: Problem setting up mbean server o
      r mbeans in client: javax.management.MBeanException: Exception thrown in the MBean's constructor]

      <Same as first above>



      EJB-JSP.xml
      ============

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">

      <ejb-jar>
      jBoss test application
      <display-name>Test</display-name>
      <enterprise-beans>

      Models a music CD collection
      <display-name>JBoss Management EJB (MEJB)</display-name>
      <ejb-name>Interest</ejb-name>
      com.web_tomorrow.interest.InterestHome
      com.web_tomorrow.interest.Interest
      <ejb-class>com.web_tomorrow.interest.InterestBean</ejb-class>
      <session-type>Stateless</session-type>
      <transaction-type>Container</transaction-type>

      </enterprise-beans>

      </ejb-jar>

      jboss.xml
      =========

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 3.0//EN" "http://www.jboss.org/j2ee/dtd/jboss_3_0.dtd">


      <enterprise-beans>

      <ejb-name>Interest</ejb-name>
      <jndi-name>interest.Interest</jndi-name>

      false
      </enterprise-beans>




      interest.java
      =============
      package com.web_tomorrow.interest;
      import javax.ejb.EJBObject;
      import java.rmi.RemoteException;



      public interface Interest extends EJBObject
      {

      public double calculateCompoundInterest(double principle,
      double rate, double periods) throws RemoteException;
      }


      interestBean.java
      =================

      package com.web_tomorrow.interest;
      import java.rmi.RemoteException;
      import javax.ejb.SessionBean;
      import javax.ejb.SessionContext;



      public class InterestBean implements SessionBean {

      public double calculateCompoundInterest(double principle,
      double rate, double periods) {
      System.out.println ("Someone called `calculateCompoundInterest!'");
      return principle * Math.pow(1+rate, periods) - principle;
      }


      public InterestBean() {}

      public void ejbCreate() {}

      public void ejbRemove() {}

      public void ejbActivate() {}

      public void ejbPassivate() {}

      public void setSessionContext(SessionContext sc) {}
      }


      InterestHome.java
      =================

      package com.web_tomorrow.interest;
      import java.io.Serializable;
      import java.rmi.RemoteException;
      import javax.ejb.CreateException;
      import javax.ejb.EJBHome;



      public interface InterestHome extends EJBHome {

      Interest create()
      throws RemoteException, CreateException;
      }