Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / JavaBeans / October 2003

Tip: Looking for answers? Try searching our database.

Problem running client with JBoss

Thread view: 
Robert Wagner - 11 Oct 2003 13:02 GMT
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)
 <snip>
       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.<init>(XMBean.java:214)
       at org.jboss.mx.modelmbean.XMBean.<init>(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.<init>(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>
    <description>jBoss test application</description>
    <display-name>Test</display-name>
    <enterprise-beans>
        <session>
           <description>Models a music CD collection</description>
            <display-name>JBoss Management EJB (MEJB)</display-name>
            <ejb-name>Interest</ejb-name>
            <home>com.web_tomorrow.interest.InterestHome</home>
            <remote>com.web_tomorrow.interest.Interest</remote>
            <ejb-class>com.web_tomorrow.interest.InterestBean</ejb-class>
            <session-type>Stateless</session-type>
            <transaction-type>Container</transaction-type>
        </session>
    </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">

<jboss>
 <enterprise-beans>
   <session>
     <ejb-name>Interest</ejb-name>
     <jndi-name>interest.Interest</jndi-name>
   </session>
   <secure>false</secure>
 </enterprise-beans>
</jboss>

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;
}
Bob Kranson - 13 Oct 2003 16:03 GMT
I think you need to throw naming exception and not remote exception in the
bean InterestBean.java.  My reference code imports import javax.naming.*; to
the XXXBean.java class.

I base this on the topmost exception:
> javax.management.MBeanException: Exception thrown in the MBean's
> constructor

HTH,
BobK

> 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
[quoted text clipped - 17 lines]
> constructor
>         at com.sun.jmx.mbeanserver.MBeanInstantiatorImpl.instantiate(MBeanInstantiatorI
mpl.java:259)
>         at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.createMBean(DefaultMBe
anServerInterceptor.java:298)
>         at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.createMBean(DefaultMBe
anServerInterceptor.java:207)
>         at
com.sun.jmx.mbeanserver.JmxMBeanServer.createMBean(JmxMBeanServer.java:405)
>         at
org.jboss.system.client.ClientServiceMBeanSupport.internalReadResolve(Client
ServiceMBeanSupport.java:71)
>   <snip>
>         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)
[quoted text clipped - 3 lines]
> 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.<init>(XMBean.java:214)
>         at org.jboss.mx.modelmbean.XMBean.<init>(XMBean.java:240)
>         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> Method)
>         at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAcces
sorImpl.java:39)
>         at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstruc
torAccessorImpl.java:27)
>         at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
>         at com.sun.jmx.mbeanserver.MBeanInstantiatorImpl.instantiate(MBeanInstantiatorI
mpl.java:234)
>         ... 42 more
> Caused by: javax.management.RuntimeOperationsException: Exception
> occured in ModelMBeanOperationInfo constructor
>         at
javax.management.modelmbean.ModelMBeanOperationInfo.<init>(ModelMBeanOperati
onInfo.java:278)
>         at
org.jboss.mx.metadata.JBossXMBean10.buildOperationInfo(JBossXMBean10.java:35
3)
>         at
org.jboss.mx.metadata.JBossXMBean10.buildMBeanMetaData(JBossXMBean10.java:22
1)
>         at
org.jboss.mx.metadata.JBossXMBean10.build(JBossXMBean10.java:108)
>         ... 50 more
> Caused by: java.lang.IllegalArgumentException: Invalid descriptor
[quoted text clipped - 106 lines]
>     throws RemoteException, CreateException;
> }


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.