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 / March 2006

Tip: Looking for answers? Try searching our database.

deep do do - UndeclaredThrowableException

Thread view: 
timasmith@hotmail.com - 23 Mar 2006 17:06 GMT
I auto generate my configuration and interface code, so I rarely get
J2ee issues but I split my source into a framework directory and an
application directory and despite having appropriately updated the code
to generate the config files it is throwing this exception...

10:58:51,984 ERROR [LogInterceptor] EJBException in method: public
abstract com.
myframework.ejb.reference.security.Security
com.myframework.ejb.reference.securi
ty.SecurityHome.find() throws
java.rmi.RemoteException,javax.ejb.FinderException
, causedBy:
java.lang.reflect.UndeclaredThrowableException
       at
org.jboss.ejb.plugins.AbstractInstancePool.get(AbstractInstancePool.j
ava:189)...

Can anyone help?

Here are my config files

1) Application-client.xml

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE application-client PUBLIC
         '-//Sun Microsystems, Inc.//DTD J2EE Application Client
1.3//EN'
         'http://java.sun.com/dtd/application-client_1_3.dtd'>
<application-client>
   <display-name>osmineAdmin</display-name>
   <ejb-ref>
       <ejb-ref-name>ejb/PatientSearch</ejb-ref-name>
       <ejb-ref-type>Session</ejb-ref-type>

<home>com.osmine.ejb.registration.patientaccess.PatientSearchHome</home>

<remote>com.osmine.ejb.registration.patientaccess.PatientSearch</remote>
   </ejb-ref>
   <ejb-ref>
       <ejb-ref-name>ejb/PatientUpdate</ejb-ref-name>
       <ejb-ref-type>Session</ejb-ref-type>

<home>com.osmine.ejb.registration.patient.PatientUpdateHome</home>

<remote>com.osmine.ejb.registration.patient.PatientUpdate</remote>
   </ejb-ref>
   <ejb-ref>
       <ejb-ref-name>ejb/ReferenceMap</ejb-ref-name>
       <ejb-ref-type>Session</ejb-ref-type>

<home>com.myframework.ejb.reference.common.ReferenceMapHome</home>

<remote>com.myframework.ejb.reference.common.ReferenceMap</remote>
   </ejb-ref>
   <ejb-ref>
       <ejb-ref-name>ejb/Security</ejb-ref-name>
       <ejb-ref-type>Session</ejb-ref-type>

<home>com.myframework.ejb.reference.security.SecurityHome</home>

<remote>com.myframework.ejb.reference.security.Security</remote>
   </ejb-ref>
</application-client>

2) ejb-jar.xml

<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar xmlns="http://java.sun.com/xml/ns/j2ee" version="2.1"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd">
   <display-name>osmine</display-name>
   <enterprise-beans>
       <session>
           <ejb-name>PatientSearchBean</ejb-name>

<home>com.osmine.ejb.registration.patientaccess.PatientSearchHome</home>

<remote>com.osmine.ejb.registration.patientaccess.PatientSearch</remote>

<ejb-class>com.osmine.ejb.registration.patientaccess.PatientSearchBean</ejb-class>
           <session-type>Stateful</session-type>
           <transaction-type>Container</transaction-type>
           <ejb-local-ref>
               <ejb-ref-name>ejb/PatientSearch</ejb-ref-name>
               <ejb-ref-type>Entity</ejb-ref-type>

<local-home>com.osmine.ejb.registration.patientaccess.LocalPatientSearchHome</local-home>

<local>com.osmine.ejb.registration.patientaccess.LocalPatientSearch</local>
               <ejb-link>LocalPatientSearchBean</ejb-link>
           </ejb-local-ref>
           <resource-ref>
               <res-ref-name>jdbc/osmineDB</res-ref-name>
               <res-type>javax.sql.DataSource</res-type>
               <res-auth>Container</res-auth>
               <res-sharing-scope>Shareable</res-sharing-scope>
           </resource-ref>
           <security-identity>
               <use-caller-identity/>
           </security-identity>
       </session>
       <session>
           <ejb-name>PatientUpdateBean</ejb-name>

<home>com.osmine.ejb.registration.patient.PatientUpdateHome</home>

<remote>com.osmine.ejb.registration.patient.PatientUpdate</remote>

<ejb-class>com.osmine.ejb.registration.patient.PatientUpdateBean</ejb-class>
           <session-type>Stateful</session-type>
           <transaction-type>Container</transaction-type>
           <ejb-local-ref>
               <ejb-ref-name>ejb/PatientUpdate</ejb-ref-name>
               <ejb-ref-type>Entity</ejb-ref-type>

<local-home>com.osmine.ejb.registration.patient.LocalPatientUpdateHome</local-home>

<local>com.osmine.ejb.registration.patient.LocalPatientUpdate</local>
               <ejb-link>LocalPatientUpdateBean</ejb-link>
           </ejb-local-ref>
           <resource-ref>
               <res-ref-name>jdbc/osmineDB</res-ref-name>
               <res-type>javax.sql.DataSource</res-type>
               <res-auth>Container</res-auth>
               <res-sharing-scope>Shareable</res-sharing-scope>
           </resource-ref>
           <security-identity>
               <use-caller-identity/>
           </security-identity>
       </session>
       <entity>
           <ejb-name>ReferenceMapBean</ejb-name>

<home>com.myframework.ejb.reference.common.ReferenceMapHome</home>

<remote>com.myframework.ejb.reference.common.ReferenceMap</remote>

<ejb-class>com.myframework.ejb.reference.common.ReferenceMapBean</ejb-class>
           <persistence-type>Bean</persistence-type>
           <prim-key-class>java.lang.String</prim-key-class>
           <reentrant>false</reentrant>
           <transaction-type>Container</transaction-type>
           <ejb-local-ref>
               <ejb-ref-name>ejb/ReferenceMap</ejb-ref-name>
               <ejb-ref-type>Entity</ejb-ref-type>

<local-home>com.myframework.ejb.reference.common.LocalReferenceMapHome</local-home>

<local>com.myframework.ejb.reference.common.LocalReferenceMap</local>
               <ejb-link>LocalReferenceMapBean</ejb-link>
           </ejb-local-ref>
           <resource-ref>
               <res-ref-name>jdbc/osmineDB</res-ref-name>
               <res-type>javax.sql.DataSource</res-type>
               <res-auth>Container</res-auth>
               <res-sharing-scope>Shareable</res-sharing-scope>
           </resource-ref>
           <security-identity>
               <use-caller-identity/>
           </security-identity>
       </entity>
       <entity>
           <ejb-name>SecurityBean</ejb-name>

<home>com.myframework.ejb.reference.security.SecurityHome</home>

<remote>com.myframework.ejb.reference.security.Security</remote>

<ejb-class>com.myframework.ejb.reference.security.SecurityBean</ejb-class>
           <persistence-type>Bean</persistence-type>
           <prim-key-class>java.lang.String</prim-key-class>
           <reentrant>false</reentrant>
           <transaction-type>Container</transaction-type>
           <ejb-local-ref>
               <ejb-ref-name>ejb/Security</ejb-ref-name>
               <ejb-ref-type>Entity</ejb-ref-type>

<local-home>com.myframework.ejb.reference.security.LocalSecurityHome</local-home>

<local>com.myframework.ejb.reference.security.LocalSecurity</local>
               <ejb-link>LocalSecurityBean</ejb-link>
           </ejb-local-ref>
           <resource-ref>
               <res-ref-name>jdbc/osmineDB</res-ref-name>
               <res-type>javax.sql.DataSource</res-type>
               <res-auth>Container</res-auth>
               <res-sharing-scope>Shareable</res-sharing-scope>
           </resource-ref>
           <security-identity>
               <use-caller-identity/>
           </security-identity>
       </entity>
   </enterprise-beans>
   <assembly-descriptor>
       <security-role>
           <role-name>osmineAdmin</role-name>
       </security-role>
       <method-permission>
           <role-name>osmineAdmin</role-name>
           <method>
               <ejb-name>PatientSearchBean</ejb-name>
               <method-name>*</method-name>
           </method>
       </method-permission>
       <container-transaction>
           <method>
               <ejb-name>PatientSearchBean</ejb-name>
               <method-name>*</method-name>
           </method>
           <trans-attribute>NotSupported</trans-attribute>
    </container-transaction>
       <method-permission>
           <role-name>osmineAdmin</role-name>
           <method>
               <ejb-name>PatientUpdateBean</ejb-name>
               <method-name>*</method-name>
           </method>
       </method-permission>
       <container-transaction>
           <method>
               <ejb-name>PatientUpdateBean</ejb-name>
               <method-name>*</method-name>
           </method>
           <trans-attribute>NotSupported</trans-attribute>
    </container-transaction>
       <method-permission>
           <role-name>osmineAdmin</role-name>
           <method>
               <ejb-name>ReferenceMapBean</ejb-name>
               <method-name>*</method-name>
           </method>
       </method-permission>
       <container-transaction>
           <method>
               <ejb-name>ReferenceMapBean</ejb-name>
               <method-name>*</method-name>
           </method>
           <trans-attribute>Required</trans-attribute>
    </container-transaction>
       <method-permission>
           <role-name>osmineAdmin</role-name>
           <method>
               <ejb-name>SecurityBean</ejb-name>
               <method-name>*</method-name>
           </method>
       </method-permission>
       <container-transaction>
           <method>
               <ejb-name>SecurityBean</ejb-name>
               <method-name>*</method-name>
           </method>
           <trans-attribute>Required</trans-attribute>
    </container-transaction>
   </assembly-descriptor>
</ejb-jar>

3) jboss-client.xml

<jboss-client>
  <jndi-name>oshis-client</jndi-name>

  <ejb-ref>
     <ejb-ref-name>ejb/PatientSearch</ejb-ref-name>
     <jndi-name>PatientSearchName</jndi-name>
  </ejb-ref>

  <ejb-ref>
     <ejb-ref-name>ejb/PatientUpdate</ejb-ref-name>
     <jndi-name>PatientUpdateName</jndi-name>
  </ejb-ref>

  <ejb-ref>
     <ejb-ref-name>ejb/ReferenceMap</ejb-ref-name>
     <jndi-name>ReferenceMapName</jndi-name>
  </ejb-ref>

  <ejb-ref>
     <ejb-ref-name>ejb/Security</ejb-ref-name>
     <jndi-name>SecurityName</jndi-name>
  </ejb-ref>

</jboss-client>

4) jboss.xml

<!DOCTYPE jboss PUBLIC
         "-//JBoss//DTD JBOSS 4.0//EN"
         "http://www.jboss.org/j2ee/dtd/jboss_4_0.dtd">
<jboss>
   <security-domain>java:/jaas/oshis</security-domain>
   <enterprise-beans>
       <session>
           <ejb-name>PatientSearchBean</ejb-name>
           <jndi-name>PatientSearchName</jndi-name>
           <local-jndi-name>LocalPatientSearchName</local-jndi-name>
        </session>
       <session>
           <ejb-name>PatientUpdateBean</ejb-name>
           <jndi-name>PatientUpdateName</jndi-name>
           <local-jndi-name>LocalPatientUpdateName</local-jndi-name>
        </session>
       <entity>
           <ejb-name>ReferenceMapBean</ejb-name>
           <jndi-name>ReferenceMapName</jndi-name>
           <local-jndi-name>LocalReferenceMapName</local-jndi-name>
        </entity>
       <entity>
           <ejb-name>SecurityBean</ejb-name>
           <jndi-name>SecurityName</jndi-name>
           <local-jndi-name>LocalSecurityName</local-jndi-name>
        </entity>
   </enterprise-beans>
</jboss>
timasmith@hotmail.com - 23 Mar 2006 17:33 GMT
 Note all my methods throw Exception so there should be nothing
unthrowable

 Here is the fully error stack

11:29:51,640 ERROR [LogInterceptor] EJBException in method: public
abstract com.
myframework.ejb.reference.security.Security
com.myframework.ejb.reference.securi
ty.SecurityHome.find() throws
java.rmi.RemoteException,javax.ejb.FinderException
, causedBy:
java.lang.reflect.UndeclaredThrowableException
       at
org.jboss.ejb.plugins.AbstractInstancePool.get(AbstractInstancePool.j
ava:189)
       at
org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInst
anceInterceptor.java:98)
       at
org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInte
rceptor.java:61)
       at
org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCrea
tionInterceptor.java:28)
       at
org.jboss.ejb.plugins.CallValidationInterceptor.invokeHome(CallValida
tionInterceptor.java:41)
       at
org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInte
rceptor.java:110)
       at
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxIntercep
torCMT.java:335)
       at
org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.ja
va:146)
       at
org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityIntercep
tor.java:130)
       at
org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:1
21)
       at
org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyF
actoryFinderInterceptor.java:93)
       at
org.jboss.ejb.EntityContainer.internalInvokeHome(EntityContainer.java
:508)
       at org.jboss.ejb.Container.invoke(Container.java:894)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
       at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at
org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatch
er.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.invocation.jrmp.server.JRMPInvoker$MBeanServerAction.invoke
(JRMPInvoker.java:805)
       at
org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:
406)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
       at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at
sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
       at sun.rmi.transport.Transport$1.run(Transport.java:153)
       at java.security.AccessController.doPrivileged(Native Method)
       at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
       at
sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:4
60)
       at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport
.java:701)
       at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.NoClassDefFoundError:
com/myframework/framework/exceptions/
NullArgumentException
       at
com.myframework.ejb.reference.security.SecurityBean.<init>(SecurityBe
an.java:23)
       at
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

       at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct
orAccessorImpl.java:39)
       at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC
onstructorAccessorImpl.java:27)
       at
java.lang.reflect.Constructor.newInstance(Constructor.java:494)
       at java.lang.Class.newInstance0(Class.java:350)
       at java.lang.Class.newInstance(Class.java:303)
       at
org.jboss.ejb.plugins.BMPPersistenceManager.createBeanClassInstance(B
MPPersistenceManager.java:113)
       at
org.jboss.resource.connectionmanager.CachedConnectionInterceptor.crea
teBeanClassInstance(CachedConnectionInterceptor.java:211)
       at
org.jboss.ejb.EntityContainer.createBeanClassInstance(EntityContainer
.java:224)
       at
org.jboss.ejb.plugins.AbstractInstancePool.get(AbstractInstancePool.j
ava:168)
       ... 34 more
11:29:51,921 ERROR [LogInterceptor] EJBException in method: public
abstract com.
myframework.ejb.reference.security.Security
com.myframework.ejb.reference.securi
ty.SecurityHome.find() throws
java.rmi.RemoteException,javax.ejb.FinderException
, causedBy:
java.lang.reflect.UndeclaredThrowableException
       at
org.jboss.ejb.plugins.AbstractInstancePool.get(AbstractInstancePool.j
ava:189)
       at
org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInst
anceInterceptor.java:98)
       at
org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInte
rceptor.java:61)
       at
org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCrea
tionInterceptor.java:28)
       at
org.jboss.ejb.plugins.CallValidationInterceptor.invokeHome(CallValida
tionInterceptor.java:41)
       at
org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInte
rceptor.java:110)
       at
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxIntercep
torCMT.java:335)
       at
org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.ja
va:146)
       at
org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityIntercep
tor.java:130)
       at
org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:1
21)
       at
org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyF
actoryFinderInterceptor.java:93)
       at
org.jboss.ejb.EntityContainer.internalInvokeHome(EntityContainer.java
:508)
       at org.jboss.ejb.Container.invoke(Container.java:894)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
       at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at
org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatch
er.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.invocation.jrmp.server.JRMPInvoker$MBeanServerAction.invoke
(JRMPInvoker.java:805)
       at
org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:
406)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
       at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at
sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
       at sun.rmi.transport.Transport$1.run(Transport.java:153)
       at java.security.AccessController.doPrivileged(Native Method)
       at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
       at
sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:4
60)
       at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport
.java:701)
       at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.NoClassDefFoundError:
com/myframework/framework/exceptions/
NullArgumentException
       at
com.myframework.ejb.reference.security.SecurityBean.<init>(SecurityBe
an.java:23)
       at
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

       at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct
orAccessorImpl.java:39)
       at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC
onstructorAccessorImpl.java:27)
       at
java.lang.reflect.Constructor.newInstance(Constructor.java:494)
       at java.lang.Class.newInstance0(Class.java:350)
       at java.lang.Class.newInstance(Class.java:303)
       at
org.jboss.ejb.plugins.BMPPersistenceManager.createBeanClassInstance(B
MPPersistenceManager.java:113)
       at
org.jboss.resource.connectionmanager.CachedConnectionInterceptor.crea
teBeanClassInstance(CachedConnectionInterceptor.java:211)
       at
org.jboss.ejb.EntityContainer.createBeanClassInstance(EntityContainer
.java:224)
       at
org.jboss.ejb.plugins.AbstractInstancePool.get(AbstractInstancePool.j
ava:168)
       ... 34 more
timasmith@hotmail.com - 23 Mar 2006 17:37 GMT
found it - classnotfound exception

my .ear file in the jboss deployment directory did not have one of the
new directories...


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.