Javax.ejb.EJBException: Could not instantiate bean
Hi All,
I get the following exception when i run my EJB Client code.
Exception in thread "main" java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.ServerException: EJBException:; nested exception is:
javax.ejb.EJBException: Could not instantiate bean
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:325)
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:460)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
at java.lang.Thread.run(Thread.java:595)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
at org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown Source)
at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:118)
at org.jboss.invocation.InvokerInterceptor.invokeInvoker(InvokerInterceptor.java:227)
at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:167)
at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46)
at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:55)
at org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:169)
at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:86)
at $Proxy1.create(Unknown Source)
Caused by: javax.ejb.EJBException: Could not instantiate bean
at org.jboss.ejb.plugins.AbstractInstancePool.get(AbstractInstancePool.java:180)
at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invokeHome(StatelessSessionInstanceInterceptor.java:78)
at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:90)
at org.jboss.ejb.plugins.CallValidationInterceptor.invokeHome(CallValidationInterceptor.java:41)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:109)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:300)
at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:146)
at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:116)
at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:121)
My Client Code is as follows:
package com.css.sample.client;
import com.css.sample.MyHome;
import com.css.sample.MyRemote;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.rmi.PortableRemoteObject;
public class MyClient {
/** Creates a new instance of MyClient */
public MyClient() { }
public static void main(String args[]) throws Exception {
Context ctx = new InitialContext();
Object objRef = ctx.lookup("MyBean");
MyHome home = (MyHome) PortableRemoteObject.narrow(objRef, MyHome.class);
MyRemote remote = home.create();
String name = remote.printName("Test");
System.out.println("Name : " + name);
ejb-jar.xml
<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar version="2.1" xmlns="http://java.sun.com/xml/ns/j2ee" 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>MySampleEjbBean</display-name>
<enterprise-beans>
<session>
<display-name>MyEjbBean</display-name>
<ejb-name>MyEjbBean</ejb-name>
<home>com.css.sample.MyHome</home>
<remote>com.css.sample.MyRemote</remote>
<ejb-class>com.css.sample.MyEjb</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
</session>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>MyEjbBean</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>NotSupported</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>
jboss.xml:
<?xml version="1.0" encoding="UTF-8"?>
<jboss>
<enterprise-beans>
<session>
<ejb-name>MyEjbBean</ejb-name>
<jndi-name>MyBean</jndi-name>
<configuration-name>Standard Stateless SessionBean</configuration-name>
</session>
</enterprise-beans>
</jboss>
I dont know where the problem occurs. Please help.
There should be a 'caused by' entry in your stack.
If your ejbCreate() method is connecting to the DB and this error only occurs when the DB is down - what exactly is your question?
m
Similar Messages
-
Catch javax.ejb.EJBException: Could not activate; failed to restore state
Software
JDK 1.5
Jboss 4.0.5GA
Problem
I am getting
DEBUG [org.jboss.ejb.plugins.AbstractInstanceCache] Activation failure
javax.ejb.EJBException: Could not activate; failed to restore state
I know this error is as my bean is getting passivated and then when I try to use the Remote Interface that bean this error is thrown
I require a method by which I can catch this error and create a new bean whenever required. Does anyone knows of any way by which I will catch this specific error and create a new Stateful bean.
I mean to say some way by using the Remote Interface to find out whether the bean is active or has been vanished form the memory
Thanks in advance
CSJakhariaThis is the stack trace in the log file which I could see. I cannot understand the reason why it could not activate the Entity Class
2007-02-27 18:45:47,816 DEBUG [org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy] Running RemoverTask
2007-02-27 18:45:47,816 DEBUG [org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy] RemoverTask, PassivatedCount=4
2007-02-27 18:45:47,816 DEBUG [org.jboss.ejb.plugins.AbstractInstanceCache] removePassivated, now=1172582147816, maxLifeAfterPassivation=1200000
2007-02-27 18:45:47,826 DEBUG [org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy] RemoverTask, done
2007-02-27 18:45:54,546 DEBUG [org.jboss.resource.connectionmanager.IdleRemover] run: IdleRemover notifying pools, interval: 450000
2007-02-27 18:47:54,759 DEBUG [org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy] Running RemoverTask
2007-02-27 18:47:54,759 DEBUG [org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy] RemoverTask, PassivatedCount=0
2007-02-27 18:47:54,759 DEBUG [org.jboss.ejb.plugins.AbstractInstanceCache] removePassivated, now=1172582274759, maxLifeAfterPassivation=1200000
2007-02-27 18:47:54,759 DEBUG [org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy] RemoverTask, done
2007-02-27 18:50:46,396 DEBUG [org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy] Running RemoverTask
2007-02-27 18:50:46,396 DEBUG [org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy] RemoverTask, PassivatedCount=1
2007-02-27 18:50:46,396 DEBUG [org.jboss.ejb.plugins.AbstractInstanceCache] removePassivated, now=1172582446396, maxLifeAfterPassivation=1200000
2007-02-27 18:50:46,396 DEBUG [org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy] RemoverTask, done
2007-02-27 18:52:12,169 DEBUG [org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy] Running RemoverTask
2007-02-27 18:52:12,169 DEBUG [org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy] RemoverTask, PassivatedCount=2
2007-02-27 18:52:12,169 DEBUG [org.jboss.ejb.plugins.AbstractInstanceCache] removePassivated, now=1172582532169, maxLifeAfterPassivation=1200000
2007-02-27 18:52:12,279 DEBUG [org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy] RemoverTask, done
2007-02-27 18:52:20,401 DEBUG [org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy] Running RemoverTask
2007-02-27 18:52:20,401 DEBUG [org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy] RemoverTask, PassivatedCount=2
2007-02-27 18:52:20,401 DEBUG [org.jboss.ejb.plugins.AbstractInstanceCache] removePassivated, now=1172582540401, maxLifeAfterPassivation=1200000
2007-02-27 18:52:20,401 DEBUG [org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy] RemoverTask, done
2007-02-27 18:53:24,553 DEBUG [org.jboss.resource.connectionmanager.IdleRemover] run: IdleRemover notifying pools, interval: 450000
2007-02-27 18:57:10,578 DEBUG [org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy] Running RemoverTask
2007-02-27 18:57:10,578 DEBUG [org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy] RemoverTask, PassivatedCount=1
2007-02-27 18:57:10,578 DEBUG [org.jboss.ejb.plugins.AbstractInstanceCache] removePassivated, now=1172582830578, maxLifeAfterPassivation=1200000
2007-02-27 18:57:10,578 DEBUG [org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy] RemoverTask, done
2007-02-27 18:59:45,050 DEBUG [org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy] Running RemoverTask
2007-02-27 18:59:45,050 DEBUG [org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy] RemoverTask, PassivatedCount=0
2007-02-27 18:59:45,050 DEBUG [org.jboss.ejb.plugins.AbstractInstanceCache] removePassivated, now=1172582985050, maxLifeAfterPassivation=1200000
2007-02-27 18:59:45,050 DEBUG [org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy] RemoverTask, done
2007-02-27 19:00:54,560 DEBUG [org.jboss.resource.connectionmanager.IdleRemover] run: IdleRemover notifying pools, interval: 450000
2007-02-27 19:02:25,471 DEBUG [org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy] Running RemoverTask
2007-02-27 19:02:25,471 DEBUG [org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy] RemoverTask, PassivatedCount=2
2007-02-27 19:02:25,471 DEBUG [org.jboss.ejb.plugins.AbstractInstanceCache] removePassivated, now=1172583145471, maxLifeAfterPassivation=1200000
2007-02-27 19:02:25,471 DEBUG [org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy] RemoverTask, done
2007-02-27 19:04:09,050 DEBUG [org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy] Running RemoverTask
2007-02-27 19:04:09,050 DEBUG [org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy] RemoverTask, PassivatedCount=2
2007-02-27 19:04:09,050 DEBUG [org.jboss.ejb.plugins.AbstractInstanceCache] removePassivated, now=1172583249050, maxLifeAfterPassivation=1200000
2007-02-27 19:04:09,050 DEBUG [org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy] RemoverTask, done
2007-02-27 19:08:15,694 DEBUG [org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy] Running RemoverTask
2007-02-27 19:08:15,694 DEBUG [org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy] RemoverTask, PassivatedCount=2
2007-02-27 19:08:15,694 DEBUG [org.jboss.ejb.plugins.AbstractInstanceCache] removePassivated, now=1172583495694, maxLifeAfterPassivation=1200000
2007-02-27 19:08:15,694 DEBUG [org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy] RemoverTask, done
2007-02-27 19:08:24,757 DEBUG [org.jboss.resource.connectionmanager.IdleRemover] run: IdleRemover notifying pools, interval: 450000
2007-02-27 19:17:11,645 DEBUG [org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy] Running RemoverTask
2007-02-27 19:17:11,645 DEBUG [org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy] RemoverTask, PassivatedCount=12
2007-02-27 19:17:11,645 DEBUG [org.jboss.ejb.plugins.AbstractInstanceCache] removePassivated, now=1172584031645, maxLifeAfterPassivation=1200000
2007-02-27 19:17:11,675 DEBUG [org.jboss.resource.connectionmanager.IdleRemover] run: IdleRemover notifying pools, interval: 450000
2007-02-27 19:17:11,685 DEBUG [org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy] RemoverTask, done
2007-02-27 19:17:54,767 DEBUG [org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy] Running RemoverTask
2007-02-27 19:17:54,767 DEBUG [org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy] RemoverTask, PassivatedCount=0
2007-02-27 19:17:54,767 DEBUG [org.jboss.ejb.plugins.AbstractInstanceCache] removePassivated, now=1172584074767, maxLifeAfterPassivation=1200000
2007-02-27 19:17:54,767 DEBUG [org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy] RemoverTask, done
2007-02-27 19:20:46,404 DEBUG [org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy] Running RemoverTask
2007-02-27 19:20:46,414 DEBUG [org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy] RemoverTask, PassivatedCount=2
2007-02-27 19:20:46,414 DEBUG [org.jboss.ejb.plugins.AbstractInstanceCache] removePassivated, now=1172584246414, maxLifeAfterPassivation=1200000
2007-02-27 19:20:46,414 DEBUG [org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy] RemoverTask, done
2007-02-27 19:22:12,177 DEBUG [org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy] Running RemoverTask
2007-02-27 19:22:12,177 DEBUG [org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy] RemoverTask, PassivatedCount=1
2007-02-27 19:22:12,177 DEBUG [org.jboss.ejb.plugins.AbstractInstanceCache] removePassivated, now=1172584332177, maxLifeAfterPassivation=1200000
2007-02-27 19:22:12,177 DEBUG [org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy] RemoverTask, done
2007-02-27 19:22:20,409 DEBUG [org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy] Running RemoverTask
2007-02-27 19:22:20,409 DEBUG [org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy] RemoverTask, PassivatedCount=1
2007-02-27 19:22:20,409 DEBUG [org.jboss.ejb.plugins.AbstractInstanceCache] removePassivated, now=1172584340409, maxLifeAfterPassivation=1200000
2007-02-27 19:22:20,409 DEBUG [org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy] RemoverTask, done
2007-02-27 19:24:41,682 DEBUG [org.jboss.resource.connectionmanager.IdleRemover] run: IdleRemover notifying pools, interval: 450000
2007-02-27 19:27:10,586 DEBUG [org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy] Running RemoverTask
2007-02-27 19:27:10,586 DEBUG [org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy] RemoverTask, PassivatedCount=1
2007-02-27 19:27:10,586 DEBUG [org.jboss.ejb.plugins.AbstractInstanceCache] removePassivated, now=1172584630586, maxLifeAfterPassivation=1200000
2007-02-27 19:27:10,586 DEBUG [org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy] RemoverTask, done
2007-02-27 19:29:45,058 DEBUG [org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy] Running RemoverTask
2007-02-27 19:29:45,058 DEBUG [org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy] RemoverTask, PassivatedCount=0
2007-02-27 19:29:45,058 DEBUG [org.jboss.ejb.plugins.AbstractInstanceCache] removePassivated, now=1172584785058, maxLifeAfterPassivation=1200000
2007-02-27 19:29:45,058 DEBUG [org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy] RemoverTask, done
2007-02-27 19:32:11,689 DEBUG [org.jboss.resource.connectionmanager.IdleRemover] run: IdleRemover notifying pools, interval: 450000
2007-02-27 19:32:25,479 DEBUG [org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy] Running RemoverTask
2007-02-27 19:32:25,479 DEBUG [org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy] RemoverTask, PassivatedCount=1
2007-02-27 19:32:25,479 DEBUG [org.jboss.ejb.plugins.AbstractInstanceCache] removePassivated, now=1172584945479, maxLifeAfterPassivation=1200000
2007-02-27 19:32:25,479 DEBUG [org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy] RemoverTask, done
2007-02-27 19:34:09,058 DEBUG [org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy] Running RemoverTask
2007-02-27 19:34:09,058 DEBUG [org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy] RemoverTask, PassivatedCount=1
2007-02-27 19:34:09,058 DEBUG [org.jboss.ejb.plugins.AbstractInstanceCache] removePassivated, now=1172585049058, maxLifeAfterPassivation=1200000
2007-02-27 19:34:09,058 DEBUG [org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy] RemoverTask, done
2007-02-27 19:38:15,703 DEBUG [org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy] Running RemoverTask
2007-02-27 19:38:15,703 DEBUG [org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy] RemoverTask, PassivatedCount=1
2007-02-27 19:38:15,703 DEBUG [org.jboss.ejb.plugins.AbstractInstanceCache] removePassivated, now=1172585295703, maxLifeAfterPassivation=1200000
2007-02-27 19:38:15,703 DEBUG [org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy] RemoverTask, done
2007-02-27 19:39:41,696 DEBUG [org.jboss.resource.connectionmanager.IdleRemover] run: IdleRemover notifying pools, interval: 450000
2007-02-27 19:41:04,445 DEBUG [org.jboss.ejb.plugins.AbstractInstanceCache] Activation failure
javax.ejb.EJBException: Could not activate; failed to restore state
at org.jboss.ejb.plugins.StatefulSessionFilePersistenceManager.activateSession(StatefulSessionFilePersistenceManager.java:343)
at org.jboss.ejb.plugins.StatefulSessionInstanceCache.activate(StatefulSessionInstanceCache.java:113)
at org.jboss.ejb.plugins.AbstractInstanceCache.doActivate(AbstractInstanceCache.java:457)
at org.jboss.ejb.plugins.StatefulSessionInstanceCache.doActivate(StatefulSessionInstanceCache.java:129)
at org.jboss.ejb.plugins.AbstractInstanceCache.get(AbstractInstanceCache.java:123)
at org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor.invoke(StatefulSessionInstanceInterceptor.java:236)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:136)
at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:648)
at org.jboss.ejb.Container.invoke(Container.java:954)
at sun.reflect.GeneratedMethodAccessor82.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.invocation.jrmp.server.JRMPInvoker$MBeanServerAction.invoke(JRMPInvoker.java:819)
at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:420)
at sun.reflect.GeneratedMethodAccessor93.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.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:460)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.io.FileNotFoundException: E:\jboss-4.0.5.GA\server\default\tmp\sessions\com\common\IDerivedLastNoEntity-eyoauehf-c\eyocxhho-p.ser (The system cannot find the file specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at org.jboss.ejb.plugins.StatefulSessionFilePersistenceManager$FISAction.run(StatefulSessionFilePersistenceManager.java:526)
at java.security.AccessController.doPrivileged(Native Method)
at org.jboss.ejb.plugins.StatefulSessionFilePersistenceManager$FISAction.open(StatefulSessionFilePersistenceManager.java:535)
at org.jboss.ejb.plugins.StatefulSessionFilePersistenceManager.activateSession(StatefulSessionFilePersistenceManager.java:323)
... 29 more
2007-02-27 19:41:23,322 DEBUG [org.jboss.ejb.plugins.AbstractInstanceCache] Activation failure
javax.ejb.EJBException: Could not activate; failed to restore state
at org.jboss.ejb.plugins.StatefulSessionFilePersistenceManager.activateSession(StatefulSessionFilePersistenceManager.java:343)
at org.jboss.ejb.plugins.StatefulSessionInstanceCache.activate(StatefulSessionInstanceCache.java:113)
at org.jboss.ejb.plugins.AbstractInstanceCache.doActivate(AbstractInstanceCache.java:457)
at org.jboss.ejb.plugins.StatefulSessionInstanceCache.doActivate(StatefulSessionInstanceCache.java:129)
at org.jboss.ejb.plugins.AbstractInstanceCache.get(AbstractInstanceCache.java:123)
at org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor.invoke(StatefulSessionInstanceInterceptor.java:236)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:136)
at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:648)
at org.jboss.ejb.Container.invoke(Container.java:954)
at sun.reflect.GeneratedMethodAccessor82.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.invocation.jrmp.server.JRMPInvoker$MBeanServerAction.invoke(JRMPInvoker.java:819)
at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:420)
at sun.reflect.GeneratedMethodAccessor93.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.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:460)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.io.FileNotFoundException: E:\jboss-4.0.5.GA\server\default\tmp\sessions\com\prathamwoods\ITransProductionEntity-eyoauek7-d\eyocxrao-x.ser (The system cannot find the file specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at org.jboss.ejb.plugins.StatefulSessionFilePersistenceManager$FISAction.run(StatefulSessionFilePersistenceManager.java:526)
at java.security.AccessController.doPrivileged(Native Method)
at org.jboss.ejb.plugins.StatefulSessionFilePersistenceManager$FISAction.open(StatefulSessionFilePersistenceManager.java:535)
at org.jboss.ejb.plugins.StatefulSessionFilePersistenceManager.activateSession(StatefulSessionFilePersistenceManager.java:323)
... 29 more
2007-02-27 19:42:22,968 DEBUG [org.jboss.ejb.plugins.AbstractInstanceCache] Activation failure
javax.ejb.EJBException: Could not activate; failed to restore state
at org.jboss.ejb.plugins.StatefulSessionFilePersistenceManager.activateSession(StatefulSessionFilePersistenceManager.java:343)
at org.jboss.ejb.plugins.StatefulSessionInstanceCache.activate(StatefulSessionInstanceCache.java:113)
at org.jboss.ejb.plugins.AbstractInstanceCache.doActivate(AbstractInstanceCache.java:457)
at org.jboss.ejb.plugins.StatefulSessionInstanceCache.doActivate(StatefulSessionInstanceCache.java:129)
at org.jboss.ejb.plugins.AbstractInstanceCache.get(AbstractInstanceCache.java:123)
at org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor.invoke(StatefulSessionInstanceInterceptor.java:236)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:136)
at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:648)
at org.jboss.ejb.Container.invoke(Container.java:954)
at sun.reflect.GeneratedMethodAccessor82.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.invocation.jrmp.server.JRMPInvoker$MBeanServerAction.invoke(JRMPInvoker.java:819)
at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:420)
at sun.reflect.GeneratedMethodAccessor93.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.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:460)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.io.FileNotFoundException: E:\jboss-4.0.5.GA\server\default\tmp\sessions\com\prathamwoods\ITransProductionEntity-eyoauek7-d\eyocxrao-x.ser (The system cannot find the file specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at org.jboss.ejb.plugins.StatefulSessionFilePersistenceManager$FISAction.run(StatefulSessionFilePersistenceManager.java:526)
at java.security.AccessController.doPrivileged(Native Method)
at org.jboss.ejb.plugins.StatefulSessionFilePersistenceManager$FISAction.open(StatefulSessionFilePersistenceManager.java:535)
at org.jboss.ejb.plugins.StatefulSessionFilePersistenceManager.activateSession(StatefulSessionFilePersistenceManager.java:323)
... 29 more
2007-02-27 19:47:12,514 DEBUG [org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy] Running RemoverTask
2007-02-27 19:47:12,534 DEBUG [org.jboss.resource.connectionmanager.IdleRemover] run: IdleRemover notifying pools, interval: 450000
2007-02-27 19:47:13,566 DEBUG [org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy] RemoverTask, PassivatedCount=0
2007-02-27 19:47:13,666 DEBUG [org.jboss.ejb.plugins.AbstractInstanceCache] removePassivated, now=1172585833646, maxLifeAfterPassivation=1200000
2007-02-27 19:47:13,716 DEBUG [org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy] RemoverTask, done
2007-02-27 19:47:54,775 DEBUG [org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy] Running RemoverTaskThanks in advance
CSJakharia -
When i am calling a method getewebLevel() from the service layer getting this exception, in the view controller java file, but when i am calling this method from the Model layer, main file it's giving me correct result... but when extending to the view layer getting this :-- i have created the data controls and also added the bindings to the .jsff files
javax.ejb.EJBException: Could not unmarshal method ID; nested exception is:
java.rmi.UnmarshalException: Method not found: 'getewebLevel(Ljava.lang.String;)'; nested exception is: java.rmi.UnmarshalException: Method not found: 'getewebLevel(Ljava.lang.String;)'
java.rmi.UnmarshalException: Method not found: 'getewebLevel(Ljava.lang.String;)'
Edited by: 971944 on Dec 11, 2012 11:17 PMWhere is the method getewebLevel located - in Model or ViewController ?
-
Javax ejb CreateException: Could not create stateless EJB
Hi,
I have a JavaEE (EJB3.0) project deployed on glassfish2.1 as -.ear (exported from eclipse3.4 to the autodeploy-folder) with -.ejb.jar, -.webui.war, general-lib-base.jar (some other...)
The session bean is invoked by a jsf-managed bean. Have a pure annotation +@ejb+ in managed bean (identifiing the ejb-interface (+@Remote+) ...the ejb is annotated with +@stateless+
get the following error message:
*...nested exception is: javax.ejb.CreateException: Could not create stateless EJB*
as beginner in the JavaEE-field I'm looking for some help concerning the possible causes.
thank's for any comment...
(also posted in the Enterprise JavaBeans-forum possibly better there)problem fixed: in the deployment-descriptor ejb-jar.xml a spezification of the session-bean hung around ...very annoying!
-
Hi all,
I use Weblogic 6.1 SOAP
If any body know what does this mean and how this may be resolved please
help me
I try to send JavaBean class "A" which includes an array of JavaBean class
"B" which includes an array of string objects
from server side to the client.
class A {
B[] aBeans
setABeans(B[] aBeans) {}
getABeans() {}
class B {
String[] props;
setProps(String[] props) {}
getProps() {}
And only half of the method invocation is ok - data is transmitted by soap
and is displayed
at the client side in "verbose=true" mode and i see that data is received
completely but the client side JavaBean class "A"
was not initialized because the exception was thrown when soap trying to
instantiate JavaBean class "B":
SAXException: Could not instantiate bean: B
I looked at jdk API and the InstantiationException is thrown only if class
is an interface or an abstract class,
but class "B" is not abstract or interface, it is simple JavaBean class.
What is the trouble?
Help me plsHi, Pieter!
Thanks in advance, this solve a problem.
"Pieter Degraeuwe" <[email protected]> wrote in message
news:3be00299$[email protected]..
>
Hi!
I think I know the problem.
Does your JavaBean has a default constructor (a parameterlessconstructor).
>
Try it!
greetings
Pieter
"Michael T" <[email protected]> wrote:
Hi all,
I use Weblogic 6.1 SOAP
If any body know what does this mean and how this may be resolved please
help me
I try to send JavaBean class "A" which includes an array of JavaBean
class
"B" which includes an array of string objects
from server side to the client.
class A {
B[] aBeans
setABeans(B[] aBeans) {}
getABeans() {}
class B {
String[] props;
setProps(String[] props) {}
getProps() {}
And only half of the method invocation is ok - data is transmitted by
soap
and is displayed
at the client side in "verbose=true" mode and i see that data is received
completely but the client side JavaBean class "A"
was not initialized because the exception was thrown when soap trying
to
instantiate JavaBean class "B":
SAXException: Could not instantiate bean: B
I looked at jdk API and the InstantiationException is thrown only if
class
is an interface or an abstract class,
but class "B" is not abstract or interface, it is simple JavaBean class.
What is the trouble?
Help me pls -
LocalSessionFactoryBean - Could not instantiate bean class
Hello,
I am facing a problem with the instantiation of the LocaSessionFactoryBean in a sample Spring 3.0.4 - Hibernate 3.2.6, WebLogic 10.3.3 and Oracle 10g. I am run an web application using JDeveloper 11.1.1.3.0 with the integrated WebLogic Server 11gR1. Trying to make the existing web application that is currently running on Oracle Web Server to run on WebLogic.
I have gone through other LocalSessionFactoryBean related postings but could not find any solutions for my problem.
Here's the server.log during web application deployment and startup -
org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'pocDaoTarget' defined in class path resource [spring-chbs.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'sessionFactory' defined in ServletContext resource [WEB-INF/xml/spring/spring-j2eeservices.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationExcepti on: Could not instantiate bean class [org.springframework.orm.hibernate3.LocalSessionFac toryBean]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError
at org.springframework.beans.factory.support.BeanDefi nitionValueResolver.resolveReference(BeanDefinitio nValueResolver.java:275)
Caused by: org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'sessionFactory' defined in ServletContext resource [WEB-INF/xml/spring/spring-j2eeservices.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationExcepti on: Could not instantiate bean class [org.springframework.orm.hibernate3.LocalSessionFac toryBean]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.instantiateBean(Abstrac tAutowireCapableBeanFactory.j
Caused by: org.springframework.beans.BeanInstantiationExcepti on: Could not instantiate bean class [org.springframework.orm.hibernate3.LocalSessionFac toryBean]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError
at org.springframework.beans.BeanUtils.instantiateCla ss(BeanUtils.java:115)
Caused by: java.lang.NoClassDefFoundError
at org.springframework.orm.hibernate3.LocalSessionFac toryBean.class$(LocalSessionFactoryBean.java:174)
(Note : I have verified that org.springframework.orm.hibernate3.LocalSessionFactoryBean.class exists in org.springframework.orm-3.0.4.RELEASE.jar)
Caused by: java.lang.ClassNotFoundException: org.hibernate.cfg.Configuration
at java.net.URLClassLoader$1.run(URLClassLoader.java: 202)
(Note : I have verified that org.hibrnate.cfg.Configuration.class exists in hibernate-3.2.6.ga.jar)
spring-chbs.xml:
Code:
<bean id="pocDaoTarget"
class="myproj.component.chbs.dao.PocDaoImpl">
<property name="sessionFactory">
<ref bean="sessionFactory"/>
</property>
</bean>
spring-j2eeservices.xml :
Code:
<!-- JNDI DataSource for J2EE environments -->
<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="java:comp/env/jdbc/J2EEDS"/>
</bean>
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource">
<ref bean="dataSource"/>
</property>
<property name="mappingJarLocations">
<list>
<value>WEB-INF/lib/hibernate-config.jar</value>
<!--value>classpath:hibernate-config.jar</value-->
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="session_factory_name">HibernateSessionFactory</prop>
<prop key="jndi.class">weblogic.jndi.WLInitialContextFactory</prop>
<prop key="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</prop>
<prop key="hibernate.show_sql">true</prop>
</props>
</property>
</bean>
Any help would be greatly appreciated.
ThanksHi Raphael,
Thanks for your response.
The last part of the console log output during run –
Error creating bean with name 'pocDaoTarget' defined in class path resource [spring-chbs.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [WEB-INF/xml/spring/spring-j2eeservices.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.orm.hibernate3.LocalSessionFactoryBean]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError
Servlet Path: C:\Documents and Settings\tariq.ahsan\Application Data\JDeveloper\system11.1.1.3.37.56.60\o.j2ee\drs\AppServerConversion\MaWebWebApp.warBegin Initialize Spring ApplicationContext for MA
End Initialize Spring ApplicationContext for MA
Servlet Path: C:\Documents and Settings\tariq.ahsan\Application Data\JDeveloper\system11.1.1.3.37.56.60\o.j2ee\drs\AppServerConversion\PaWebWebApp.warBegin Initialize Spring ApplicationContext for PA
End Initialize Spring ApplicationContext for PA
[10:35:57 AM] Application Redeployed Successfully.
[10:35:57 AM] The following URL context root(s) were defined and can be used as a starting point to test your application:
[10:35:57 AM] http://192.168.11.207:7101/MaWeb
[10:35:57 AM] http://192.168.11.207:7101/paweb
[10:35:57 AM] http://192.168.11.207:7101/CFMSWeb
[10:35:57 AM] Elapsed time for deployment: 28 seconds
[10:35:57 AM] ---- Deployment finished. ----
Run startup time: 28203 ms.
[Application AppServerConversion deployed to Server Instance IntegratedWebLogicServer]
Target URL -- http://127.0.0.1:7101/CFMSWeb/login.jsp
Is one of the above folder - C:\Documents and Settings\tariq.ahsan\Application Data\JDeveloper\system11.1.1.3.37.56.60\o.j2ee\drs\AppServerConversion\MaWebWebApp.war (MaWebWebApp.war is a folder) part of the IntegratedWebLogicServer deployment? Do you mean the spring and possibly the hibernate jars need to be in the WEB-INF/lib under the above folder path?
Thanks -
Hi Guys,
I am not much familiar with Java. I have developed my java program using jdk1.6 and am trying to register java bean using jdk.1.3.1.08 sun.beans.ole.packager utility and when i reach step 5 and click register i am getting below error message. Can someone help me understand what i am doing wrong. The class file is located in excel\test\Getfileinfo.class and it does have constructor definition in it. Thanks.
c:\jdk1.3.1_08\jre>.\bin\java -cp .\lib\rt.jar;.\lib\jaws.jar sun.beans.ole.Packager
The definition for excel.test.GetFileInfo in the JAR file
has a format error.
WARNING: Could not instantiate bean "excel.test.GetFileInfo" from JAR "C:\excel.jar"
But were unable to load the class "excel.test.GetFileInfo" because of
java.lang.ClassNotFoundException: excel.test.GetFileInfo
Common reasons for this failure include:
(1) The class is not defined in the correct package
it should be in the package "excel.test"
(2) The class has not been given the correct name
it should be called "GetFileInfo"
(3) The class file contains the wrong class or no class at allThis is a very general error in spring. If the jvm cannot find the class in classpath which you have defined in your spring bean configuration file it throws this error.
Try placing the hibernate3.jar and spring-orm.jar or any other concerned jar files inside the /WEB-INF/lib directory.Only adding jar files in classpath will not suffice.
Best will be put all the jar files in the /WEB-INF/lib directory and then add the jar files in classpath from here.
Edited by: supratim on Apr 9, 2011 3:39 AM -
BeanInstantiationException: Could not instantiate bean class
Hi,
I am working on a small part of j2ee app and creating a couple beans. Now I get stuck here:
This is my bean class:
public class KomplexniPseudoOsoba extends POsoby{
public KomplexniPseudoOsoba() {
super();
public class KomplexniOsoba extends PAdresy{
public KomplexniOsoba() {
super();
I want the inner KomplexniOsoba class to be my bean. Now when i add it to webmvc-config.xml (using springframework) like this:
<bean id="KomplexniOsoba" name="KomplexniOsoba"
class="cz.edu.mub.pef.ja.xkosteln.model.KomplexniPseudoOsoba$KomplexniOsoba">
</bean>
I get
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'KomplexniOsoba' defined in ServletContext resource [WEB-INF/spring/webmvc-config.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [cz.edu.mub.pef.ja.xkosteln.model.KomplexniPseudoOsoba$KomplexniOsoba]: No default constructor found; nested exception is java.lang.NoSuchMethodException: cz.edu.mub.pef.ja.xkosteln.model.KomplexniPseudoOsoba$KomplexniOsoba.<init>()
What am I doing wrong the constructor is there!koszta5 wrote:
Thanks man :D Such a trivial mistake....
and BTW I absolutely love Oracle forums... some people were sad when Oracle bought Sun but I HAVE TO say that the support went WAY UP. I love the speed with which people reply here. ... It is incredible compared to e.g. Spring forums...I don't know anything about the spring forums, but most of the people who respond in the oracle java forums are the same people who responded in the sun java forums (and in a similar fashion).
Thank you :)no problem. -
Hello i am getting an error on my home.create method.
The following exception is returned:
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:504)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:381)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
root cause
java.rmi.ServerException: EJBException:; nested exception is:
javax.ejb.EJBException: Could not instantiate bean
org.jboss.ejb.plugins.LogInterceptor.handleException(LogInterceptor.java:368)
org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:139)
org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyFactoryFinderInterceptor.java:107)
org.jboss.ejb.SessionContainer.internalInvokeHome(SessionContainer.java:632)
org.jboss.ejb.Container.invoke(Container.java:948)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:585)
org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:260)
org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
org.jboss.invocation.local.LocalInvoker$MBeanServerAction.invoke(LocalInvoker.java:169)
org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:118)
org.jboss.invocation.InvokerInterceptor.invokeLocal(InvokerInterceptor.java:209)
org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:195)
org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:61)
org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:70)
org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:184)
org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:100)
$Proxy94.create(Unknown Source)
org.apache.jsp.jwiz_jsp._jspService(jwiz_jsp.java:63)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
Please helpTry the following forum (about EJB technology)
http://forum.java.sun.com/forum.jspa?forumID=13 -
BMP question : got javax.ejb.EJBException error Object state not saved
Could anybody please help me? I could not figure out what i did wrong.
I got the javax.ejb.EJBException error: Object state not saved
when i test the getname() method for findByPrimaryKey() and findAll() methods.
Here is my code:
package org.school.idxc;
import javax.sql.*;
import javax.naming.*;
import javax.ejb.*;
import javax.sql.*;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Enumeration;
import java.util.Vector;
* Bean implementation class for Enterprise Bean: status
public class statusBean implements javax.ejb.EntityBean {
private javax.ejb.EntityContext myEntityCtx;
private int id;
private String name;
private DataSource ds;
private String dbname = "jdbc/idxc";
private Connection con;
* ejbActivate
public void ejbActivate() {
* ejbLoad
public void ejbLoad() {
System.out.println("Entering EJBLoad");
try
Integer primaryKey = (Integer) myEntityCtx.getPrimaryKey();
String sqlstmt = "select id, name from from status where id =?";
con = ds.getConnection();
PreparedStatement stmt = con.prepareStatement(sqlstmt);
stmt.setInt (1,primaryKey.intValue());
ResultSet rs = stmt.executeQuery();
if (rs.next())
this.id = rs.getInt(1);
this.name = rs.getString (2).trim();
stmt.close();
} // if
else
stmt.close();
throw new NoSuchEntityException ("Invalid id " + id);
}// else
} // try
catch (SQLException e)
System.out.println("EJBLOad : " + e.getMessage());
} // catch
finally
try
if (con != null)
con.close();
}// try
catch (SQLException e)
System.out.println("EJBLOad finally" + e.getMessage());
} // catch
}// finally
* ejbPassivate
public void ejbPassivate() {
* ejbRemove
public void ejbRemove() throws javax.ejb.RemoveException {
System.out.println ("Entering ejb Removed");
try
String sqlstmt = "delete from status where id=" + id;
con = ds.getConnection();
Statement stmt = con.createStatement();
stmt.executeUpdate(sqlstmt);
stmt.close();
}// try
catch (SQLException e)
System.out.println("Ejb Remove" + e.getMessage());
} // catch
finally
try
if (con!=null)
con.close();
}// try
catch (SQLException e)
System.out.println ("EJBRemoved " + e.getMessage());
} // catch
} // finally
* ejbStore
public void ejbStore() {
System.out.println("Entering the ejbStore");
try
String sqlstmt = "update status set id=" + id + ",name='" + name + "' where id=" + id;
con = ds.getConnection();
Statement stmt = con.createStatement();
if (stmt.executeUpdate(sqlstmt) != 1)
throw new EJBException ("Object state not saved");
stmt.close();
} // try
catch (SQLException e)
System.out.println ("EJBStore : " + e.getMessage());
}// catch
finally
try
if (con != null)
con.close();
} // try
catch(SQLException e)
System.out.println ("EJBStore finally " + e.getMessage());
} // catch
} // finally
* getEntityContext
public javax.ejb.EntityContext getEntityContext() {
return myEntityCtx;
* setEntityContext
public void setEntityContext(javax.ejb.EntityContext ctx) {
myEntityCtx = ctx;
try
InitialContext initial = new InitialContext();
ds = (DataSource)initial.lookup(dbname);
} // try
catch (NamingException e)
throw new EJBException ("set Entity context : Invalid database");
}// catch
* unsetEntityContext
public void unsetEntityContext() {
myEntityCtx = null;
* ejbCreate
public Integer ejbCreate(Integer key, String name) throws javax.ejb.CreateException {
this.id = key.intValue();
this.name = name;
System.out.println ("Entering ejbCreated!!!");
try
String sqlstmt = "insert into status(id,name) values (" + id + ",'" + (name == null ? "" : name) + "')";
con = ds.getConnection();
Statement stmt = con.createStatement();
stmt.executeUpdate(sqlstmt);
stmt.close();
}// try
catch (SQLException e)
System.out.println("EJBCreate : SQLEXception ");
}// catch
finally
try
if (con!=null)
con.close();
}// try
catch (SQLException e)
System.out.println ("EJB Created Finally : SQLException");
e.getMessage();
} // catch
}// finally
this.id = key.intValue();
this.name = name;
return key ;
* ejbPostCreate
public void ejbPostCreate(Integer id, String name) throws javax.ejb.CreateException {
* ejbFindByPrimaryKey
public Integer ejbFindByPrimaryKey(
Integer key) throws javax.ejb.FinderException {
try
String sqlstmt = "select id from status where id=" + key.intValue();
con = ds.getConnection();
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery(sqlstmt);
if (!rs.next())
throw new ObjectNotFoundException();
} // if
rs.close();
stmt.close();
} // try
catch (SQLException e)
System.out.println ("EJBFindBYPrimaryKey " + e.getMessage());
} // catch
finally
try
if (con!=null)
con.close();
}// try
catch (SQLException e)
System.out.println ("EJB Find by primary key" + e.getMessage());
}// catch
}// finally
return key;
* @return Returns the name.
public String getName() {
return this.name;
* @return Returns id
public int getId() {
return this.id;
* @param name The name to set.
public void setName(String xname) {
this.name = xname;
* ejbFindByLastnameContaining
public Enumeration ejbFindAllNamne () throws javax.ejb.FinderException
try
String sqlstmt = "select id from status order by id";
con = ds.getConnection();
Statement s = con.createStatement();
ResultSet rs = s.executeQuery(sqlstmt);
Vector keys = new Vector();
while (rs.next())
keys.add(new Integer(rs.getInt(1)));
}// while
rs.close();
s.close();
con.close();
return keys.elements();
} // try
catch (SQLException e)
throw new FinderException (e.toString());
} // catch
}Hi,
if you look at your error message you will see the problem. In your code you've missed to implement
public void ejbPassivate {}
so your code looks like this
import java.lang.Object;
import javax.ejb.SessionBean;
import javax.ejb.SessionContext;
import java.rmi.RemoteException;
import java.lang.Math;
import java.util.Random;
import java.io.*;
/** * Title: * Description: * Copyright: Copyright (c) 2001 * Company: * @author * @version 1.0 */
public class DiceEJB implements SessionBean, Serializable
public int[] Roll()
Random rng = new Random();
int[] diceArray = new int[5];
for(int i =0; i < diceArray.length;i++)
diceArray[i] = (Math.abs (rng.nextInt()) % 6) +1;
return diceArray;
public DiceEJB(){}
public void ejbCreate() {}
public void ejbRemove() {}
public void ejbActivate() {}
public void ejbPassivate() {}
public void setSessionContext (SessionContext sc)
private void writeObject(ObjectOutputStream oos) throws IOException
oos.defaultWriteObject();
private void readObject(ObjectInputStream ois) throws ClassNotFoundException, IOException
ois.defaultReadObject();
bye -
Hi,
Can you any one help me to resolve this exception below. The conext is I
have successfully deplyed a bean and when i call the bean remot method I am
getting the following exception.
Can you any one help me in what situations we will get this type of
exception. I am using jdk1.3
Thanks
Kumar
*************** EXCEPTIN IS BELOW *****************************
PayDateRespondRequestBean lookup successful
creating session bean instance
Calling operation operation
java.io.InvalidClassException: javax.ejb.EJBException; Local class not
compatible: stream classdesc serialVersionUID=-9219910240172116449 local
class serialVers
ionUID=796770993296843510
at
java.io.ObjectStreamClass.validateLocalClass(ObjectStreamClass.java:523)
at java.io.ObjectStreamClass.setClass(ObjectStreamClass.java:567)
at
java.io.ObjectInputStream.inputClassDescriptor(ObjectInputStream.java:936)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:366)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:236)
at
weblogic.rjvm.ClassTableEntry.readExternal(ClassTableEntry.java:29)
at
java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1212)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:386)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:236)
at
weblogic.rjvm.InboundMsgAbbrev.readObject(InboundMsgAbbrev.java:66)
at weblogic.rjvm.InboundMsgAbbrev.read(InboundMsgAbbrev.java:38)
at
weblogic.rjvm.MsgAbbrevJVMConnection.readMsgAbbrevs(MsgAbbrevJVMConnection.j
ava:175)
at
weblogic.rjvm.MsgAbbrevInputStream.readMessageContext(MsgAbbrevInputStream.j
ava:154)
at
weblogic.rjvm.ConnectionManager.dispatch(ConnectionManager.java:582)
at
weblogic.rjvm.t3.T3JVMConnection.dispatch(T3JVMConnection.java:454)
at
weblogic.socket.JavaSocketMuxer.processSockets2(JavaSocketMuxer.java:311)
at
weblogic.socket.JavaSocketMuxer.processSockets(JavaSocketMuxer.java:225)
at
weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:24)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
--------------- nested within: ------------------
weblogic.utils.AssertionError: ***** ASSERTION FAILED *****[ Exception
creating response stream ] - with nested exception:
[java.io.InvalidClassException: javax.ejb.EJBException; Local class not
compatible: stream classdesc serialVersionUID=-9219910240172116449 local
class serialVersionUID=796770993296843510]
at
weblogic.rjvm.MsgAbbrevJVMConnection.readMsgAbbrevs(MsgAbbrevJVMConnection.j
ava:184)
at
weblogic.rjvm.MsgAbbrevInputStream.readMessageContext(MsgAbbrevInputStream.j
ava:154)
at
weblogic.rjvm.ConnectionManager.dispatch(ConnectionManager.java:582)
at
weblogic.rjvm.t3.T3JVMConnection.dispatch(T3JVMConnection.java:454)
at
weblogic.socket.JavaSocketMuxer.processSockets2(JavaSocketMuxer.java:311)
at
weblogic.socket.JavaSocketMuxer.processSockets(JavaSocketMuxer.java:225)
at
weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:24)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
Error accessing PayDateRespondRequest bean
weblogic.rjvm.PeerGoneException: ; nested exception is:
weblogic.utils.NestedException: ***** ASSERTION FAILED
****[ Exception
creating response stream ] - with nested exception:
[weblogic.utils.AssertionError: ***** ASSERTION FAILED *****[ Exception
creating
response stream ] - with nested exception:Yes, this solved my problem. I was having two versions of javax.ejb package.
--Sajith
"Nils Winkler" <[email protected]> wrote in message
news:[email protected]...
Hi,
it looks like you have two different versions of the same class in the
classpath. Your client is expecting version A, but the server is
returning an instance of version B. Make sure that you only have one
version of the class in your classpath. If you're starting the client as
a separate app, also make sure that it's using the same classes as the
server.
Hope that helps,
Nils
Sajith wrote:
Hi,
Can you any one help me to resolve this exception below. The conext is I
have successfully deplyed a bean and when i call the bean remot method I
am
getting the following exception.
Can you any one help me in what situations we will get this type of
exception. I am using jdk1.3
Thanks
Kumar
*************** EXCEPTIN IS BELOW *****************************
PayDateRespondRequestBean lookup successful
creating session bean instance
Calling operation operation
java.io.InvalidClassException: javax.ejb.EJBException; Local class not
compatible: stream classdesc serialVersionUID=-9219910240172116449 local
class serialVers
ionUID=796770993296843510
at
java.io.ObjectStreamClass.validateLocalClass(ObjectStreamClass.java:523)
atjava.io.ObjectStreamClass.setClass(ObjectStreamClass.java:567)
at
java.io.ObjectInputStream.inputClassDescriptor(ObjectInputStream.java:936)
atjava.io.ObjectInputStream.readObject(ObjectInputStream.java:366)
atjava.io.ObjectInputStream.readObject(ObjectInputStream.java:236)
at
weblogic.rjvm.ClassTableEntry.readExternal(ClassTableEntry.java:29)
at
java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1212)
atjava.io.ObjectInputStream.readObject(ObjectInputStream.java:386)
atjava.io.ObjectInputStream.readObject(ObjectInputStream.java:236)
at
weblogic.rjvm.InboundMsgAbbrev.readObject(InboundMsgAbbrev.java:66)
at weblogic.rjvm.InboundMsgAbbrev.read(InboundMsgAbbrev.java:38)
at
weblogic.rjvm.MsgAbbrevJVMConnection.readMsgAbbrevs(MsgAbbrevJVMConnection.j
ava:175)
at
weblogic.rjvm.MsgAbbrevInputStream.readMessageContext(MsgAbbrevInputStream.j
ava:154)
at
weblogic.rjvm.ConnectionManager.dispatch(ConnectionManager.java:582)
at
weblogic.rjvm.t3.T3JVMConnection.dispatch(T3JVMConnection.java:454)
at
weblogic.socket.JavaSocketMuxer.processSockets2(JavaSocketMuxer.java:311)
at
weblogic.socket.JavaSocketMuxer.processSockets(JavaSocketMuxer.java:225)
at
weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:24)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
--------------- nested within: ------------------
weblogic.utils.AssertionError: ***** ASSERTION FAILED *****[ Exception
creating response stream ] - with nested exception:
[java.io.InvalidClassException: javax.ejb.EJBException; Local class not
compatible: stream classdesc serialVersionUID=-9219910240172116449 local
class serialVersionUID=796770993296843510]
at
weblogic.rjvm.MsgAbbrevJVMConnection.readMsgAbbrevs(MsgAbbrevJVMConnection.j
ava:184)
at
weblogic.rjvm.MsgAbbrevInputStream.readMessageContext(MsgAbbrevInputStream.j
ava:154)
at
weblogic.rjvm.ConnectionManager.dispatch(ConnectionManager.java:582)
at
weblogic.rjvm.t3.T3JVMConnection.dispatch(T3JVMConnection.java:454)
at
weblogic.socket.JavaSocketMuxer.processSockets2(JavaSocketMuxer.java:311)
at
weblogic.socket.JavaSocketMuxer.processSockets(JavaSocketMuxer.java:225)
at
weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:24)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
Error accessing PayDateRespondRequest bean
weblogic.rjvm.PeerGoneException: ; nested exception is:
weblogic.utils.NestedException: ***** ASSERTION FAILED
****[ Exception
creating response stream ] - with nested exception:
[weblogic.utils.AssertionError: ***** ASSERTION FAILED *****[ Exception
creating
response stream ] - with nested exception:--
============================
[email protected] -
EJB Reference could not be resolved (javax.naming.NameNotFoundException)
I am new to EJBs and am trying to get a simple Java client to run which I've generated from a EJB3.0 session bean.
The code for the client (LoanAppFacadeClient.java) is
package buslogic;
import java.util.Hashtable;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
public class LoanAppFacadeClient {
public static void main(String [] args) {
try {
final Context context = getInitialContext();
LoanAppFacade loanAppFacade = (LoanAppFacade)context.lookup("java:comp/env/ejb/LoanAppFacade");
// Call any of the Remote methods below to access the EJB
// System.out.println( loanAppFacade.getLoans( ) );
loanAppFacade.addLoan( "Galactic Loans", 30, "fixed", 6.25 );
String ssn = "123-12-1234";
System.out.println(loanAppFacade.getCreditRating( ssn ));
} catch (Exception ex) {
ex.printStackTrace();
private static Context getInitialContext() throws NamingException {
Hashtable env = new Hashtable();
// Standalone OC4J connection details
env.put( Context.INITIAL_CONTEXT_FACTORY, "oracle.j2ee.naming.ApplicationClientInitialContextFactory" );
env.put( Context.SECURITY_PRINCIPAL, "oc4jadmin" );
env.put( Context.SECURITY_CREDENTIALS, "welcome1" );
env.put(Context.PROVIDER_URL, "ormi://localhost:23791/LoanApp");
return new InitialContext( env );
When the trying to run the client I get a warning:
"WARNING: EJB Reference "ejb/LoanAppFacade" could not be resolved."
followed by the error
"javax.naming.NameNotFoundException: java:comp/env/ejb/LoanAppFacade not found in Lab1_BusinessServices-app-client"
When the client was created I right-clicked on the session bean (LoanAppFacadeBean which implements LoanAppFacade) and chose New Sample Java Client.
This automatically creates the java client and also created the following xml file (application-client.xml)
<?xml version = '1.0' encoding = 'windows-1252'?>
<application-client 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/application-client_1_4.xsd" version="1.4" xmlns="http://java.sun.com/xml/ns/j2ee">
<display-name>Lab1_BusinessServices-app-client</display-name>
<ejb-ref>
<ejb-ref-name>ejb/LoanAppFacade</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<remote>buslogic.LoanAppFacade</remote>
<ejb-link>LoanAppFacade</ejb-link>
</ejb-ref>
</application-client>
Could someone please help me to fix these errors?
Thanks,
AndrewI used windows for years whereby I stored all photos in folders. As macs don't use this concept I am finding it hard to organize my photos.
You can do this on your Mac too. Just don't use iPhoto. But iPhoto is a lot more flexible.
For instance:
I usually sort them by month so when I say move to an album I mean I create an album called for example '2013 March' so I can easily find specific photos/videos.
Click on the Magnifying Glass lower left to reveal the search box. Then click on the magnifying glass in the search box, and select Date. Now you can instantly find all the photos from a particular month, or day.
File -> New Smart Album will allow you to create an automatic album for any date or date range you choose.
Select one of the affected videos in the iPhoto Window and go File -> Reveal in Finder -> Original. A Finder Window should open with the file selected. Does it play? -
Hi !
I have a little problem. When I deploy my jar file, I have the next message :
"javax.ejb.EJBException: Method is not a known CMP field accessor, CMR field accessor, or ejbSelect method: methodName=compareTo"
Is there someone to tell me why ? ^_^
I didn't put the source code in this topic, not to pollute it, but if you need it, tell me ;)
Thx for your help.Hi Spidey !
Thx for you help but... Giving my method doesn't require the use of EJBQL, I don't think I have to define it in my deployment descriptor (this is not a query)...
I give you an idea of my (experimental ^_^) source code :
public class CountryBean implements EntityBean{
public int compareTo(Country c){
SOP("COMPARE TO");
return 0;
public class MySession implements SessionBean{
public int doIt(){
MyComparator comparator = new MyComparator();
return comparator.compare(country1, country2);
public class MyComparator implements Comparator{
public int compare(Object o1, Object o2){
return compare((Country)o1, (Country)o2);
public int compare(Country c1, Country c2){
SOP("COMPARE");
return c1.compareTo(c2);
When I call doIt(), the message "COMPARE" is written and just after, there's this message (the message "COMPARE TO" is never written):
"11:29:44,204 ERROR [LogInterceptor] TransactionRolledbackException, causedBy:
javax.ejb.EJBException: Method is not a known CMP field accessor, CMR field accessor, or ejbSelect method: methodName=compareTo
at org.jboss.ejb.plugins.cmp.bridge.EntityBridgeInvocationHandler.invoke(EntityBridgeInvocationHandler.java:110)
at org.jboss.proxy.compiler.Runtime.invoke(Runtime.java:59)
at CountryBean$Proxy.compareTo(<generated>)"
I hope this is clear ^__^
Thx for helping me ;) -
Java.lang.ExceptionInInitializerError,Could not instantiate TransactionMana
hi all,
<b>i am using SAP Netweaver Developer studio. have problem using hibernate in a EJB Modul Project. i have create a stateless session bean to writie the bussiness logic using my hibernate mapping classes, but somehow i get the error:</b>
Details: com.sap.engine.services.ejb.exceptions.BaseEJBException: Exception in method createPerson.
at src.ejb.HibernateLocalLocalObjectImpl0.createPerson(HibernateLocalLocalObjectImpl0.java:407)
at com.servlet.TestServlet.doPost(TestServlet.java:66)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:391)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:265)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:345)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:323)
at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:865)
at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:240)
at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)
at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:148)
at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:37)
at com.sap.engine.core.cluster.impl6.session.UnorderedChannel$MessageRunner.run(UnorderedChannel.java:71)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:94)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:162)
Caused by: java.lang.ExceptionInInitializerError
at src.hibernate.HibernateSessionFactory.<clinit>(HibernateSessionFactory.java:29)
at src.ejb.HibernateBean.createPerson(HibernateBean.java:158)
at src.ejb.HibernateLocalLocalObjectImpl0.createPerson(HibernateLocalLocalObjectImpl0.java:391)
... 17 more
Caused by: org.hibernate.HibernateException: Could not instantiate TransactionManagerLookup
at org.hibernate.transaction.TransactionManagerLookupFactory.getTransactionManagerLookup(TransactionManagerLookupFactory.java:47)
at org.hibernate.transaction.JTATransactionFactory.configure(JTATransactionFactory.java:48)
at org.hibernate.transaction.TransactionFactoryFactory.buildTransactionFactory(TransactionFactoryFactory.java:51)
at org.hibernate.cfg.SettingsFactory.createTransactionFactory(SettingsFactory.java:401)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:129)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1933)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1216)
at src.hibernate.HibernateSessionFactory.<clinit>(HibernateSessionFactory.java:24)
... 19 more
<b>is there anybody can tell me why i am getting this error? i was sitting in front of the computer for days now, but could find out where i am doing wrong.
i have tested my hibernate classes without session beans(in a normal java Project, every thing works fine. and i tried to do exactly what they have done in the HibernateExampleEHCache examples, to combine my hibernate with session beans together, but couldn't get the programm running. </b>Are you sure this is the right value for the class name?
org.hibernate.transaction.SAPWebASTransactionManagerLookup
<b>No, i am not sure. i just copied it from a example. but i think i will not need it. so i have deleted them now.</b>
Looks as well like you have implemented a primary index scheme (next value) that is not supported by your DB ?
See error on DUAL
<b>I just used sequence for the primary key in my Person.hbm.xml. even i change it to native, it comes back with the same error too.</b>
<b>Person.hbm.xml:</b>
<class name="src.hibernate.Person" table="TMP_PERSON">
<id name="id" column="PERSONID">
<generator class="native"/>
<b>java class:</b>
public class Person {
private Long id;
getter and setter
<b>my method in a stateless session bean:</b>
public Long createPerson(
String surname,
String firstname,
String tel,
String email) {
Session session = null;
Transaction tx = null;
try {
session = HibernateSessionFactory.openSession();
tx = session.beginTransaction();
Person aPerson = new Person();
aPerson.setSurname(surname);
aPerson.setFirstname(firstname);
aPerson.setTelNr(tel);
aPerson.setEmail(email);
Long personId = (Long)session.save(aPerson);
tx.commit();
return personId;
} catch (HibernateException e) {
if (tx != null)
tx.rollback();
throw new HibernateException(e);
} finally {
HibernateSessionFactory.closeSession(session); -
DeploymentException: Could not instantiate EJBObject
I get a DeploymentException trying to deploy the most simple bean imaginable.
Looks like the problem is with an internal WebLogic object <beanName>_EO. I ran ejbc and it generated the classes, but for some reason the jar won't deploy.
Here is the stack trace:
weblogic.ejb.common.DeploymentException: Could not instantiate EJBObject.; nested exception is: javax.naming.NameNotFoundException: 'com/iic/test/util/echo_EO'; remaining name 'com/iic/test/util/echo_EO' javax.naming.NameNotFoundException: 'com/iic/test/util/echo_EO'; remaining name 'com/iic/test/util/echo_EO' at weblogic.jndi.toolkit.BasicWLContext.resolveName(BasicWLContext.java:745) at weblogic.jndi.toolkit.BasicWLContext.resolveNameToStore(BasicWLContext.java:656) at weblogic.jndi.toolkit.BasicWLContext.resolveNameToParentStore(BasicWLContext.java:707) at weblogic.jndi.toolkit.BasicWLContext.rebind(BasicWLContext.java:229) at weblogic.jndi.toolkit.ReplicatedWLContext.rebind(ReplicatedWLContext.java:91) at weblogic.jndi.toolkit.BasicWLContext.rebind(BasicWLContext.java:580) at weblogic.ejb.internal.StatelessEJBHome.setup(StatelessEJBHome.java:127) at weblogic.ejb.internal.EJBHomeImpl.setup(EJBHomeImpl.java:600) at weblogic.ejb.internal.EJBDeploymentImpl.setupBeanHome(EJBDeploymentImpl.java:576) at weblogic.ejb.internal.EJBDeploymentImpl.deployBeans(EJBDeploymentImpl.java:384) at weblogic.ejb.internal.EJBDeploymentImpl.deploy(EJBDeploymentImpl.java:335) at weblogic.ejb.internal.EJBJarDeployment.deploy(EJBJarDeployment.java:231) at weblogic.ejb.internal.EJBManagerImpl.deploy(EJBManagerImpl.java:363) at weblogic.ejb.internal.EJBManagerImpl.deployNew(EJBManagerImpl.java:352) at weblogic.ejb.internal.EJBManagerImpl.deploy(EJBManagerImpl.java:319) at weblogic.ejb.internal.EJBManagerImpl.deployBeans(EJBManagerImpl.java:629) at weblogic.ejb.internal.EJBManagerImpl.<init>(EJBManagerImpl.java:242) at weblogic.t3.srvr.T3Srvr.start(T3Srvr.java:1295) at weblogic.t3.srvr.T3Srvr.main(T3Srvr.java:825) at java.lang.reflect.Method.invoke(Native Method) at weblogic.Server.startServerDynamically(Server.java:99) at weblogic.Server.main(Server.java:65) at weblogic.Server.main(Server.java:55)
Anyone have any clues?
-rgI get a DeploymentException trying to deploy the most simple bean imaginable.
Looks like the problem is with an internal WebLogic object <beanName>_EO. I ran ejbc and it generated the classes, but for some reason the jar won't deploy.
Here is the stack trace:
weblogic.ejb.common.DeploymentException: Could not instantiate EJBObject.; nested exception is: javax.naming.NameNotFoundException: 'com/iic/test/util/echo_EO'; remaining name 'com/iic/test/util/echo_EO' javax.naming.NameNotFoundException: 'com/iic/test/util/echo_EO'; remaining name 'com/iic/test/util/echo_EO' at weblogic.jndi.toolkit.BasicWLContext.resolveName(BasicWLContext.java:745) at weblogic.jndi.toolkit.BasicWLContext.resolveNameToStore(BasicWLContext.java:656) at weblogic.jndi.toolkit.BasicWLContext.resolveNameToParentStore(BasicWLContext.java:707) at weblogic.jndi.toolkit.BasicWLContext.rebind(BasicWLContext.java:229) at weblogic.jndi.toolkit.ReplicatedWLContext.rebind(ReplicatedWLContext.java:91) at weblogic.jndi.toolkit.BasicWLContext.rebind(BasicWLContext.java:580) at weblogic.ejb.internal.StatelessEJBHome.setup(StatelessEJBHome.java:127) at weblogic.ejb.internal.EJBHomeImpl.setup(EJBHomeImpl.java:600) at weblogic.ejb.internal.EJBDeploymentImpl.setupBeanHome(EJBDeploymentImpl.java:576) at weblogic.ejb.internal.EJBDeploymentImpl.deployBeans(EJBDeploymentImpl.java:384) at weblogic.ejb.internal.EJBDeploymentImpl.deploy(EJBDeploymentImpl.java:335) at weblogic.ejb.internal.EJBJarDeployment.deploy(EJBJarDeployment.java:231) at weblogic.ejb.internal.EJBManagerImpl.deploy(EJBManagerImpl.java:363) at weblogic.ejb.internal.EJBManagerImpl.deployNew(EJBManagerImpl.java:352) at weblogic.ejb.internal.EJBManagerImpl.deploy(EJBManagerImpl.java:319) at weblogic.ejb.internal.EJBManagerImpl.deployBeans(EJBManagerImpl.java:629) at weblogic.ejb.internal.EJBManagerImpl.<init>(EJBManagerImpl.java:242) at weblogic.t3.srvr.T3Srvr.start(T3Srvr.java:1295) at weblogic.t3.srvr.T3Srvr.main(T3Srvr.java:825) at java.lang.reflect.Method.invoke(Native Method) at weblogic.Server.startServerDynamically(Server.java:99) at weblogic.Server.main(Server.java:65) at weblogic.Server.main(Server.java:55)
Anyone have any clues?
-rg
Maybe you are looking for
-
Fact sheet to show up Campaign Elements
Hi, Is it possible to show Campaign Elements in Fact sheet. Campaign element needs to be based on the customer which is in Target group of that particular BP. It is not on the basis of Employee responsible of campaign element. Say for example if cus
-
How can my wife and I combine our iTunes?
My wife and I have been dragging our feet and have finally broke down and want to have one iTunes to manage both of our music and sync our iPhones with. However, I cannot figure out how to do this, without one of us just giving up our music that we
-
The Consistence appearance of Forms when called from a page's Portlets
Hi, I have created forms,reports(i.e portlets) and added these portlets in a page and created appropriate tabs for them and for pages i used styles to give them a consistent look. Some of Forms and reports calls other forms but that forms do'nt show
-
Hello, How to enable interface link trap in cisco ASR9010? and how to verify it? I have enabled it on my ios-xr, i"m getting all traps except interface link trap. Thank you.
-
Plant disappears in extended attributes
Hello SRM Experts, Systems: SRM-Server 550, ERP2005 scenario: classic After a Upgrade from SRM 3.5 to SRM 5.0 I like to enter a plant in PPOMA_BBP extended Attributes. I can select the backend system and the plant but when I save it, the whole entry