EjbCreate problem
HI
When I deploy my ejb, I am getting an exception java.lang.IllegalStateException: FieldManager.fieldNotFound in class jrun.JRunCustomerBean " . My Remote class name is Customer and the abstract schema name also is customer. When I access the ej from JSP, it gives me an error "javax.ejb.CreateException: Create failed because primary key is null. " .Please tell me what could be the reason
thanks
The primary key fields should be set in the ejbCreate()
method.
Similar Messages
-
Getting error while creating rows in database
Hi ,
I am new to java and currently working on EJBs .
The tables i have are ABC and XYZ and their columns are
ABC - fk1,fk2 // these make the composite primary key
XYZ- fk1 // which is primary key for this table
I am trying to create multiple rows in ABC table which has a CMR field for the XYZ .
if i try to create single row there is no error and if i remove the CMR field then also there is no error
i am getting the following error
pe8.1|javax.enterprise.system.container.ejb.entity.lifecycle|_ThreadID=16;|JDO74008: Bean 'MonitoredJobRequestTypeBean' method ejbCreate: problems during ejbCreate; parameters: RTO_TESTING_SURESG, 16666
com.sun.jdo.api.persistence.support.JDOUnsupportedOptionException: JDO76207: Update of a primary key field is not allowed.
at com.sun.jdo.spi.persistence.support.sqlstore.SQLStateManager.assertPKUpdate(SQLStateManager.java:4069)
at com.sun.jdo.spi.persistence.support.sqlstore.SQLStateManager.nullifyForeignKey(SQLStateManager.java:
please help me
bye ,
SureshHow can you create multiple rows by calling one entity bean..Each bean is supposed to be reflection of a row of a table rite,....
please write down your code so that it is easy to understrand your problem
regards
shanu -
Java.lang.NoSuchMethodException
Hi,
I'm a beginner in learning CMP EJB. I've encountered the below error, when I tried to create a CMP EJB using a servlet.
I am using pointbase as my database.
INFO: CORE3276: Installing a new configuration
INFO: CORE3280: A new configuration was successfully installed
INFO: WEB4004: Closing web application environment for virtual server [server1]
INFO: LDR5010: All ejb(s) of [StorageDeviceApp] loaded successfully!
WARNING: CORE3229: Quality of service (QOS) is disabled in the HTTP service. Un
able to turn on QOS features.
INFO: CORE3276: Installing a new configuration
INFO: WEB0100: Loading web module [StorageDeviceApp:servlet.war] in virtual serv
er [server1] at [defaultContext]
INFO: WEB0116: Using alternate deployment descriptor [C:\Sun\AppServer7\domains\
domain1\server1\applications\j2ee-apps\StorageDeviceApp_1\servlet_war/../servlet
.xml] for web module [StorageDeviceApp:servlet.war]
INFO: CORE3282: stdout: looking up java:comp/env/ejb/jndiStorageDevice
INFO: CORE3282: stdout: lookup ok
INFO: CORE3282: stdout: creating stocker 88
INFO: CORE3282: stdout: setting entity context
INFO: CORE3282: stdout: finished setting context
WARNING: CORE3283: stderr: java.lang.NoSuchMethodException: setdataSourceName
WARNING: CORE3283: stderr: at com.sun.enterprise.util.Utility.invokeSetMeth
odCaseInsensitive(Utility.java:373)
WARNING: CORE3283: stderr: at com.sun.enterprise.repository.JdbcConnectionP
ool.createDataSource(JdbcConnectionPool.java:238)
WARNING: CORE3283: stderr: at com.sun.enterprise.resource.JdbcUrlAllocator.
createResource(JdbcUrlAllocator.java:80)
SEVERE: RAR5027:Unexpected exception in resource pooling
com.sun.enterprise.resource.PoolingException
at com.sun.enterprise.resource.JdbcUrlAllocator.createResource(JdbcUrlAl
locator.java:100)
at com.sun.enterprise.resource.IASNonSharedResourcePool.createSteadyReso
urces(IASNonSharedResourcePool.java:856)
at com.sun.enterprise.resource.IASNonSharedResourcePool.initPool(IASNonS
haredResourcePool.java:416)
at com.sun.enterprise.resource.IASNonSharedResourcePool.internalGetResou
rce(IASNonSharedResourcePool.java:625)
at com.sun.enterprise.resource.IASNonSharedResourcePool.getResource(IASN
onSharedResourcePool.java:520)
at com.sun.enterprise.resource.PoolManagerImpl.getResourceFromPool(PoolM
anagerImpl.java:263)
at com.sun.enterprise.resource.JdbcXAConnection.<init>(JdbcXAConnection.
java:74)
at com.sun.enterprise.resource.SystemJdbc10XaAllocator.createResource(Sy
stemJdbc10XaAllocator.java:52)
at com.sun.enterprise.resource.IASNonSharedResourcePool.createSteadyReso
urces(IASNonSharedResourcePool.java:856)
at com.sun.enterprise.resource.IASNonSharedResourcePool.initPool(IASNonS
haredResourcePool.java:416)
at com.sun.enterprise.resource.IASNonSharedResourcePool.internalGetResou
rce(IASNonSharedResourcePool.java:625)
at com.sun.enterprise.resource.IASNonSharedResourcePool.getResource(IASN
onSharedResourcePool.java:520)
at com.sun.enterprise.resource.PoolManagerImpl.getResourceFromPool(PoolM
anagerImpl.java:263)
at com.sun.enterprise.resource.SystemJdbcDataSource.internalGetConnectio
n(SystemJdbcDataSource.java:226)
at com.sun.enterprise.resource.SystemJdbcDataSource.getConnection(System
JdbcDataSource.java:154)
at com.sun.jdo.spi.persistence.support.sqlstore.ejb.TransactionHelperImp
l.getConnection(TransactionHelperImpl.java:171)
at com.sun.jdo.spi.persistence.support.sqlstore.ejb.EJBHelper.getConnect
ion(EJBHelper.java:169)
at com.sun.jdo.spi.persistence.support.sqlstore.impl.SQLPersistenceManag
erFactory.getDBName(SQLPersistenceManagerFactory.java:781)
at com.sun.jdo.spi.persistence.support.sqlstore.impl.SQLPersistenceManag
erFactory.getFromPool(SQLPersistenceManagerFactory.java:709)
at com.sun.jdo.spi.persistence.support.sqlstore.impl.SQLPersistenceManag
erFactory.getPersistenceManager(SQLPersistenceManagerFactory.java:598)
at com.sun.jdo.spi.persistence.support.sqlstore.impl.PersistenceManagerF
actoryImpl.getPersistenceManager(PersistenceManagerFactoryImpl.java:770)
at com.sun.jdo.spi.persistence.support.sqlstore.impl.PersistenceManagerF
actoryImpl.getPersistenceManager(PersistenceManagerFactoryImpl.java:660)
at device.StorageDeviceBean_826330090_ConcreteImpl.jdoGetPersistenceMana
ger(StorageDeviceBean_826330090_ConcreteImpl.java:539)
at device.StorageDeviceBean_826330090_ConcreteImpl.ejbCreate(StorageDevi
ceBean_826330090_ConcreteImpl.java:255)
at device.StorageDeviceBean_826330090_ConcreteImpl_RemoteHomeImpl.create
(StorageDeviceBean_826330090_ConcreteImpl_RemoteHomeImpl.java:27)
at device._StorageDeviceHome_Stub.create(Unknown Source)
at StorageDeviceServlet.init(StorageDeviceServlet.java:40)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.
java:921)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:81
3)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContex
t.java:3346)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3
592)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:638)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:345
at org.apache.catalina.startup.Embedded.start(Embedded.java:957)
at com.iplanet.ias.web.WebContainer.start(WebContainer.java:426)
at com.iplanet.ias.web.WebContainer.startInstance(WebContainer.java:514)
at com.iplanet.ias.server.J2EERunner.confPostInit(J2EERunner.java:170)
com.sun.enterprise.repository.J2EEResourceException
java.lang.NoSuchMethodE
WARNING: Cannot get database metadata: database product name.
java.sql.SQLException: com.sun.enterprise.repository.J2EEResourceException
java.lang.NoSuchMethodException: setdataSourceName
at com.sun.enterprise.resource.SystemJdbcDataSource.internalGetConnectio
n(SystemJdbcDataSource.java:252)
at com.sun.enterprise.resource.SystemJdbcDataSource.getConnection(System
JdbcDataSource.java:154)
at com.sun.jdo.spi.persistence.support.sqlstore.ejb.TransactionHelperImp
l.getConnection(TransactionHelperImpl.java:171)
at com.sun.jdo.spi.persistence.support.sqlstore.ejb.EJBHelper.getConnect
ion(EJBHelper.java:169)
at com.sun.jdo.spi.persistence.support.sqlstore.impl.SQLPersistenceManag
erFactory.getDBName(SQLPersistenceManagerFactory.java:781)
at com.sun.jdo.spi.persistence.support.sqlstore.impl.SQLPersistenceManag
erFactory.getFromPool(SQLPersistenceManagerFactory.java:709)
at com.sun.jdo.spi.persistence.support.sqlstore.impl.SQLPersistenceManag
erFactory.getPersistenceManager(SQLPersistenceManagerFactory.java:598)
at com.sun.jdo.spi.persistence.support.sqlstore.impl.PersistenceManagerF
actoryImpl.getPersistenceManager(PersistenceManagerFactoryImpl.java:770)
at com.sun.jdo.spi.persistence.support.sqlstore.impl.PersistenceManagerF
actoryImpl.getPersistenceManager(PersistenceManagerFactoryImpl.java:660)
at device.StorageDeviceBean_826330090_ConcreteImpl.jdoGetPersistenceMana
ger(StorageDeviceBean_826330090_ConcreteImpl.java:539)
at device.StorageDeviceBean_826330090_ConcreteImpl.ejbCreate(StorageDevi
ceBean_826330090_ConcreteImpl.java:255)
at device.StorageDeviceBean_826330090_ConcreteImpl_RemoteHomeImpl.create
(StorageDeviceBean_826330090_ConcreteImpl_RemoteHomeImpl.java:27)
at device._StorageDeviceHome_Stub.create(Unknown Source)
at StorageDeviceServlet.init(StorageDeviceServlet.java:40)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.
java:921)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:81
3)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContex
t.java:3346)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3
592)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:638)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:345
at org.apache.catalina.startup.Embedded.start(Embedded.java:957)
at com.iplanet.ias.web.WebContainer.start(WebContainer.java:426)
at com.iplanet.ias.web.WebContainer.startInstance(WebContainer.java:514)
at com.iplanet.ias.server.J2EERunner.confPostInit(J2EERunner.java:170)
INFO: Bean StorageDevice method ejbCreate: problems during ejbCreate; parameters
: Stocker88, 88
com.sun.jdo.api.persistence.support.JDOFatalInternalException: Failed to get the
vendor type for the data store.
NestedException: java.sql.SQLException: com.sun.enterprise.repository.J2EEResour
ceException
java.lang.NoSuchMethodException: setdataSourceName
at com.sun.jdo.spi.persistence.support.sqlstore.impl.SQLPersistenceManag
erFactory.getDBName(SQLPersistenceManagerFactory.java:802)
at com.sun.jdo.spi.persistence.support.sqlstore.impl.SQLPersistenceManag
erFactory.getFromPool(SQLPersistenceManagerFactory.java:709)
at com.sun.jdo.spi.persistence.support.sqlstore.impl.SQLPersistenceManag
erFactory.getPersistenceManager(SQLPersistenceManagerFactory.java:598)
at com.sun.jdo.spi.persistence.support.sqlstore.impl.PersistenceManagerF
actoryImpl.getPersistenceManager(PersistenceManagerFactoryImpl.java:770)
at com.sun.jdo.spi.persistence.support.sqlstore.impl.PersistenceManagerF
actoryImpl.getPersistenceManager(PersistenceManagerFactoryImpl.java:660)
at device.StorageDeviceBean_826330090_ConcreteImpl.jdoGetPersistenceMana
ger(StorageDeviceBean_826330090_ConcreteImpl.java:539)
at device.StorageDeviceBean_826330090_ConcreteImpl.ejbCreate(StorageDevi
ceBean_826330090_ConcreteImpl.java:255)
at device.StorageDeviceBean_826330090_ConcreteImpl_RemoteHomeImpl.create
(StorageDeviceBean_826330090_ConcreteImpl_RemoteHomeImpl.java:27)
at device._StorageDeviceHome_Stub.create(Unknown Source)
at StorageDeviceServlet.init(StorageDeviceServlet.java:40)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.
java:921)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:81
3)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContex
t.java:3346)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3
592)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:638)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:345
at org.apache.catalina.startup.Embedded.start(Embedded.java:957)
at com.iplanet.ias.web.WebContainer.start(WebContainer.java:426)
at com.iplanet.ias.web.WebContainer.startInstance(WebContainer.java:514)
at com.iplanet.ias.server.J2EERunner.confPostInit(J2EERunner.java:170)
WARNING: CORE3283: stderr: at com.sun.enterprise.resource.IASNonSharedResou
rcePool.createSteadyResources(IASNonSharedResourcePool.java:856)
WARNING: CORE3283: stderr: at com.sun.enterprise.resource.IASNonSharedResou
rcePool.initPool(IASNonSharedResourcePool.java:416)
WARNING: CORE3283: stderr: at com.sun.enterprise.resource.IASNonSharedResou
rcePool.internalGetResource(IASNonSharedResourcePool.java:625)
WARNING: CORE3283: stderr: at com.sun.enterprise.resource.IASNonSharedResou
rcePool.getResource(IASNonSharedResourcePool.java:520)
WARNING: CORE3283: stderr: at com.sun.enterprise.resource.PoolManagerImpl.g
etResourceFromPool(PoolManagerImpl.java:263)
WARNING: CORE3283: stderr: at com.sun.enterprise.resource.JdbcXAConnection.
<init>(JdbcXAConnection.java:74)
WARNING: CORE3283: stderr: at com.sun.enterprise.resource.SystemJdbc10XaAll
ocator.createResource(SystemJdbc10XaAllocator.java:52)
WARNING: CORE3283: stderr: at com.sun.enterprise.resource.IASNonSharedResou
rcePool.createSteadyResources(IASNonSharedResourcePool.java:856)
WARNING: CORE3283: stderr: at com.sun.enterprise.resource.IASNonSharedResou
rcePool.initPool(IASNonSharedResourcePool.java:416)
WARNING: CORE3283: stderr: at com.sun.enterprise.resource.IASNonSharedResou
rcePool.internalGetResource(IASNonSharedResourcePool.java:625)
WARNING: CORE3283: stderr: at com.sun.enterprise.resource.IASNonSharedResou
rcePool.getResource(IASNonSharedResourcePool.java:520)
WARNING: CORE3283: stderr: at com.sun.enterprise.resource.PoolManagerImpl.g
etResourceFromPool(PoolManagerImpl.java:263)
WARNING: CORE3283: stderr: at com.sun.enterprise.resource.SystemJdbcDataSou
rce.internalGetConnection(SystemJdbcDataSource.java:226)
WARNING: CORE3283: stderr: at com.sun.enterprise.resource.SystemJdbcDataSou
rce.getConnection(SystemJdbcDataSource.java:154)
WARNING: CORE3283: stderr: at com.sun.jdo.spi.persistence.support.sqlstore.
ejb.TransactionHelperImpl.getConnection(TransactionHelperImpl.java:171)
WARNING: CORE3283: stderr: at com.sun.jdo.spi.persistence.support.sqlstore.
ejb.EJBHelper.getConnection(EJBHelper.java:169)
WARNING: CORE3283: stderr: at com.sun.jdo.spi.persistence.support.sqlstore.
impl.SQLPersistenceManagerFactory.getDBName(SQLPersistenceManagerFactory.java:78
1)
WARNING: CORE3283: stderr: at com.sun.jdo.spi.persistence.support.sqlstore.
impl.SQLPersistenceManagerFactory.getFromPool(SQLPersistenceManagerFactory.java:
709)
WARNING: CORE3283: stderr: at com.sun.jdo.spi.persistence.support.sqlstore.
impl.SQLPersistenceManagerFactory.getPersistenceManager(SQLPersistenceManagerFac
tory.java:598)
WARNING: CORE3283: stderr: at com.sun.jdo.spi.persistence.support.sqlstore.
impl.PersistenceManagerFactoryImpl.getPersistenceManager(PersistenceManagerFacto
ryImpl.java:770)
WARNING: CORE3283: stderr: at com.sun.jdo.spi.persistence.support.sqlstore.
impl.PersistenceManagerFactoryImpl.getPersistenceManager(PersistenceManagerFacto
ryImpl.java:660)
WARNING: CORE3283: stderr: at device.StorageDeviceBean_826330090_ConcreteIm
pl.jdoGetPersistenceManager(StorageDeviceBean_826330090_ConcreteImpl.java:539)
WARNING: CORE3283: stderr: at device.StorageDeviceBean_826330090_ConcreteIm
pl.ejbCreate(StorageDeviceBean_826330090_ConcreteImpl.java:255)
WARNING: CORE3283: stderr: at device.StorageDeviceBean_826330090_ConcreteIm
pl_RemoteHomeImpl.create(StorageDeviceBean_826330090_ConcreteImpl_RemoteHomeImpl
.java:27)
WARNING: CORE3283: stderr: at device._StorageDeviceHome_Stub.create(Unknown
Source)
WARNING: CORE3283: stderr: at StorageDeviceServlet.init(StorageDeviceServle
t.java:40)
WARNING: CORE3283: stderr: at org.apache.catalina.core.StandardWrapper.load
Servlet(StandardWrapper.java:921)
WARNING: CORE3283: stderr: at org.apache.catalina.core.StandardWrapper.load
(StandardWrapper.java:813)
WARNING: CORE3283: stderr: at org.apache.catalina.core.StandardContext.load
OnStartup(StandardContext.java:3346)
WARNING: CORE3283: stderr: at org.apache.catalina.core.StandardContext.star
t(StandardContext.java:3592)
WARNING: CORE3283: stderr: at org.apache.catalina.core.ContainerBase.start(
ContainerBase.java:1123)
WARNING: CORE3283: stderr: at org.apache.catalina.core.StandardHost.start(S
tandardHost.java:638)
WARNING: CORE3283: stderr: at org.apache.catalina.core.ContainerBase.start(
ContainerBase.java:1123)
WARNING: CORE3283: stderr: at org.apache.catalina.core.StandardEngine.start
(StandardEngine.java:345)
WARNING: CORE3283: stderr: at org.apache.catalina.startup.Embedded.start(Em
bedded.java:957)
WARNING: CORE3283: stderr: at com.iplanet.ias.web.WebContainer.start(WebCon
tainer.java:426)
WARNING: CORE3283: stderr: at com.iplanet.ias.web.WebContainer.startInstanc
e(WebContainer.java:514)
WARNING: CORE3283: stderr: at com.iplanet.ias.server.J2EERunner.confPostIni
t(J2EERunner.java:170)
WARNING: CORE3283: stderr: Caught an exception.
WARNING: CORE3283: stderr: java.rmi.ServerException: RemoteException occurred in
server thread; nested exception is:
WARNING: CORE3283: stderr: java.rmi.RemoteException: nested exception is: c
om.sun.jdo.api.persistence.support.JDOFatalInternalException: Failed to get the
vendor type for the data store.
WARNING: CORE3283: stderr: NestedException: java.sql.SQLException: com.sun.enter
prise.repository.J2EEResourceException
WARNING: CORE3283: stderr: java.lang.NoSuchMethodException: setdataSourceName; n
ested exception is:
WARNING: CORE3283: stderr: com.sun.jdo.api.persistence.support.JDOFatalInte
rnalException: Failed to get the vendor type for the data store.
WARNING: CORE3283: stderr: NestedException: java.sql.SQLException: com.sun.enter
prise.repository.J2EEResourceException
WARNING: CORE3283: stderr: java.lang.NoSuchMethodException: setdataSourceName
WARNING: CORE3283: stderr: at com.sun.corba.ee.internal.javax.rmi.CORBA.Uti
l.wrapException(Util.java:364)
WARNING: CORE3283: stderr: at javax.rmi.CORBA.Util.wrapException(Util.java:
277)
WARNING: CORE3283: stderr: at device._StorageDeviceHome_Stub.create(Unknown
Source)
WARNING: CORE3283: stderr: at StorageDeviceServlet.init(StorageDeviceServle
t.java:40)
WARNING: CORE3283: stderr: at org.apache.catalina.core.StandardWrapper.load
Servlet(StandardWrapper.java:921)
WARNING: CORE3283: stderr: at org.apache.catalina.core.StandardWrapper.load
(StandardWrapper.java:813)
WARNING: CORE3283: stderr: at org.apache.catalina.core.StandardContext.load
OnStartup(StandardContext.java:3346)
WARNING: CORE3283: stderr: at org.apache.catalina.core.StandardContext.star
t(StandardContext.java:3592)
WARNING: CORE3283: stderr: at org.apache.catalina.core.ContainerBase.start(
ContainerBase.java:1123)
WARNING: CORE3283: stderr: at org.apache.catalina.core.StandardHost.start(S
tandardHost.java:638)
WARNING: CORE3283: stderr: at org.apache.catalina.core.ContainerBase.start(
ContainerBase.java:1123)
WARNING: CORE3283: stderr: at org.apache.catalina.core.StandardEngine.start
(StandardEngine.java:345)
WARNING: CORE3283: stderr: at org.apache.catalina.startup.Embedded.start(Em
bedded.java:957)
WARNING: CORE3283: stderr: at com.iplanet.ias.web.WebContainer.start(WebCon
tainer.java:426)
WARNING: CORE3283: stderr: at com.iplanet.ias.web.WebContainer.startInstanc
e(WebContainer.java:514)
WARNING: CORE3283: stderr: at com.iplanet.ias.server.J2EERunner.confPostIni
t(J2EERunner.java:170)
WARNING: CORE3283: stderr: Caused by: java.rmi.RemoteException: nested exception
is: com.sun.jdo.api.persistence.support.JDOFatalInternalException: Failed to ge
t the vendor type for the data store.
WARNING: CORE3283: stderr: NestedException: java.sql.SQLException: com.sun.enter
prise.repository.J2EEResourceException
WARNING: CORE3283: stderr: java.lang.NoSuchMethodException: setdataSourceName; n
ested exception is:
WARNING: CORE3283: stderr: com.sun.jdo.api.persistence.support.JDOFatalInte
rnalException: Failed to get the vendor type for the data store.
WARNING: CORE3283: stderr: NestedException: java.sql.SQLException: com.sun.enter
prise.repository.J2EEResourceException
WARNING: CORE3283: stderr: java.lang.NoSuchMethodException: setdataSourceName
WARNING: CORE3283: stderr: at com.sun.enterprise.iiop.POAProtocolMgr.mapExc
eption(POAProtocolMgr.java:451)
WARNING: CORE3283: stderr: at com.sun.ejb.containers.BaseContainer.postInvo
ke(BaseContainer.java:545)
INFO: CORE3280: A new configuration was successfully installed
INFO: WEB4004: Closing web application environment for virtual server [server1]
WARNING: CORE3283: stderr: at device.StorageDeviceBean_826330090_ConcreteIm
pl_RemoteHomeImpl.create(StorageDeviceBean_826330090_ConcreteImpl_RemoteHomeImpl
.java:33)
WARNING: CORE3283: stderr: at device._StorageDeviceHome_Stub.create(Unknown
Source)
WARNING: CORE3283: stderr: ... 13 more
WARNING: CORE3283: stderr: Caused by: com.sun.jdo.api.persistence.support.JDOFat
alInternalException: Failed to get the vendor type for the data store.
WARNING: CORE3283: stderr: NestedException: java.sql.SQLException: com.sun.enter
prise.repository.J2EEResourceException
WARNING: CORE3283: stderr: java.lang.NoSuchMethodException: setdataSourceName
WARNING: CORE3283: stderr: at com.sun.jdo.spi.persistence.support.sqlstore.
impl.SQLPersistenceManagerFactory.getDBName(SQLPersistenceManagerFactory.java:80
2)
WARNING: CORE3283: stderr: at com.sun.jdo.spi.persistence.support.sqlstore.
impl.SQLPersistenceManagerFactory.getFromPool(SQLPersistenceManagerFactory.java:
709)
WARNING: CORE3283: stderr: at com.sun.jdo.spi.persistence.support.sqlstore.
impl.SQLPersistenceManagerFactory.getPersistenceManager(SQLPersistenceManagerFac
tory.java:598)
WARNING: CORE3283: stderr: at com.sun.jdo.spi.persistence.support.sqlstore.
impl.PersistenceManagerFactoryImpl.getPersistenceManager(PersistenceManagerFacto
ryImpl.java:770)
WARNING: CORE3283: stderr: at com.sun.jdo.spi.persistence.support.sqlstore.
impl.PersistenceManagerFactoryImpl.getPersistenceManager(PersistenceManagerFacto
ryImpl.java:660)
WARNING: CORE3283: stderr: at device.StorageDeviceBean_826330090_ConcreteIm
pl.jdoGetPersistenceManager(StorageDeviceBean_826330090_ConcreteImpl.java:539)
WARNING: CORE3283: stderr: at device.StorageDeviceBean_826330090_ConcreteIm
pl.ejbCreate(StorageDeviceBean_826330090_ConcreteImpl.java:255)
WARNING: CORE3283: stderr: at device.StorageDeviceBean_826330090_ConcreteIm
pl_RemoteHomeImpl.create(StorageDeviceBean_826330090_ConcreteImpl_RemoteHomeImpl
.java:27)
WARNING: CORE3283: stderr: ... 14 more
INFO: CORE5022: All ejb(s) of [StorageDeviceApp] were unloaded successfully!
WARNING: CORE3229: Quality of service (QOS) is disabled in the HTTP service. Un
able to turn on QOS features.
INFO: CORE3276: Installing a new configuration
INFO: CORE3280: A new configuration was successfully installed
INFO: WEB4004: Closing web application environment for virtual server [server1]Most probably you have an error in resources setup. Please check the <resources> section of the instance server.xml
or via the admin ui.
Regards,
Marina -
EJB Deployment Problem for Stateless Session with Multiple ejbCreate
In weblogic server if I use multiple ejbCreate with different parameters it is found
to raise error with error message :
<Error deploying application cart:
Unable to deploy EJB: cart.jar from cart.jar:
In EJB CartBean, the stateless session bean class must define a single ejbCreate
method that takes no parameters.
at weblogic.ejb20.compliance.EJBComplianceChecker.check(EJBComplianceChecker.java:256)
at weblogic.ejb20.compliance.EJBComplianceChecker.checkDeploymentInfo(EJBComplianceChecker.java:220)
at weblogic.ejb20.ejbc.EJBCompiler.complianceCheckJar(EJBCompiler.java:453)
at weblogic.ejb20.ejbc.EJBCompiler.checkCompliance(EJBCompiler.java:410)
at weblogic.ejb20.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:203)
at weblogic.ejb20.deployer.Deployer.runEJBC(Deployer.java:296)
at weblogic.ejb20.deployer.Deployer.compileEJB(Deployer.java:676)
at weblogic.ejb20.deployer.Deployer.deploy(Deployer.java:843)
at weblogic.j2ee.EJBComponent.deploy(EJBComponent.java:30)
at weblogic.j2ee.Application.addComponent(Application.java:160)
at weblogic.j2ee.J2EEService.addDeployment(J2EEService.java:117)
at ......
Code example...
public void ejbCreate() throws CreateException {}
public void ejbCreate(String person) throws CreateException {
// code here
public void ejbCreate(String person, String id) throws CreateException {
// code here
the code above is found ok in J2ee Ref. Implementation and able to deploy. Why this
is not deployable in Weblogic(tried in 6.1).is it a required condition for stateless
session bean
to have only single ejbcreate with no parameters ?
Can somebody explain? and is there a way out to overcome this constraint if so in
weblogic
with regards
Ganeshan KalembethStateless session beans may define only a single create() method with no
suffix
and no arguments.
Michael Jouravlev wrote:
"Ganeshan Kalembeth" <[email protected]> wrote in message
news:3ce28a88$[email protected]..
In weblogic server if I use multiple ejbCreate with different parametersit is found
to raise error with error message :
<Error deploying application cart:
Unable to deploy EJB: cart.jar from cart.jar:
In EJB CartBean, the stateless session bean class must define a singleejbCreate
method that takes no parameters.
atweblogic.ejb20.compliance.EJBComplianceChecker.check(EJBComplianceChecker.ja
va:256)
atweblogic.ejb20.compliance.EJBComplianceChecker.checkDeploymentInfo(EJBCompli
anceChecker.java:220)
atweblogic.ejb20.ejbc.EJBCompiler.complianceCheckJar(EJBCompiler.java:453)
at weblogic.ejb20.ejbc.EJBCompiler.checkCompliance(EJBCompiler.java:410)
at weblogic.ejb20.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:203)
at weblogic.ejb20.deployer.Deployer.runEJBC(Deployer.java:296)
at weblogic.ejb20.deployer.Deployer.compileEJB(Deployer.java:676)
at weblogic.ejb20.deployer.Deployer.deploy(Deployer.java:843)
at weblogic.j2ee.EJBComponent.deploy(EJBComponent.java:30)
at weblogic.j2ee.Application.addComponent(Application.java:160)
at weblogic.j2ee.J2EEService.addDeployment(J2EEService.java:117)
at ......
Code example...
public void ejbCreate() throws CreateException {}
public void ejbCreate(String person) throws CreateException {
// code here
public void ejbCreate(String person, String id) throws CreateException {
// code here
the code above is found ok in J2ee Ref. Implementation and able to deploy.Why this
is not deployable in Weblogic(tried in 6.1).is it a required condition forstateless
session bean
to have only single ejbcreate with no parameters ?
Can somebody explain? and is there a way out to overcome this constraintif so in
weblogic
with regards
Ganeshan KalembethRTFM EJB 2.0 Spec, chapter 7.8 -
Hi all,
I am currently trying to get Petstore 1.3.1 going on WLS 7.0.0.1 an got
into quite som trouble (btw, does anyone have expereince with this
cofiguration?). After successful deployment in /application I tried the
"populate database" link on ~/petstore/index.jsp and got:
java.sql.SQLException: The transaction is no longer active (status = Committed). No further JDBC access is allowed within this transaction.
at weblogic.jdbc.jts.Connection.checkIfRolledBack(Connection.java:541)
at weblogic.jdbc.jts.ResultSet.close(ResultSet.java:293)
at weblogic.jdbc.rmi.internal.ResultSetImpl.close(ResultSetImpl.java:144)
at weblogic.jdbc.rmi.SerialResultSet.close(SerialResultSet.java:96)
at weblogic.jdbc.rmi.SerialResultSet.close(SerialResultSet.java:87)
at weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.releaseResultSet(RDBMSPersistenceManager.java:1797)
at weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.releaseResources(RDBMSPersistenceManager.java:1679)
at weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.execGenKeyNamedSequenceTableUpdateAndQuery(RDBMSPersistenceManager.java:1489)
at weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.getNextGenKeyNamedSequenceTable(RDBMSPersistenceManager.java:1307)
at com.sun.j2ee.blueprints.address.ejb.AddressEJB_fvu9sn__WebLogic_CMP_RDBMS.ejbCreate(AddressEJB_fvu9sn__WebLogic_CMP_RDBMS.java:1723)
at java.lang.reflect.Method.invoke(Native Method)
at weblogic.ejb20.manager.DBManager.create(DBManager.java:737)
at weblogic.ejb20.manager.DBManager.localCreate(DBManager.java:716)
at weblogic.ejb20.internal.EntityEJBLocalHome.create(EntityEJBLocalHome.java:182)
at com.sun.j2ee.blueprints.address.ejb.AddressEJB_fvu9sn_LocalHomeImpl.create(AddressEJB_fvu9sn_LocalHomeImpl.java:155)
at com.sun.j2ee.blueprints.petstore.tools.populate.AddressPopulator.createAddress(AddressPopulator.java:94) at com.sun.j2ee.blueprints.petstore.tools.populate.AddressPopulator.access$7(AddressPopulator.java)
at com.sun.j2ee.blueprints.petstore.tools.populate.AddressPopulator$1.create(AddressPopulator.java:73)
at com.sun.j2ee.blueprints.petstore.tools.populate.XMLDBHandler.endElement(XMLDBHandler.java:145)
at org.xml.sax.helpers.XMLFilterImpl.endElement(XMLFilterImpl.java:595)
at com.sun.j2ee.blueprints.petstore.tools.populate.XMLDBHandler.endElement(XMLDBHandler.java:158)
at weblogic.apache.xerces.parsers.SAXParser.endElement(SAXParser.java:1411)
at weblogic.apache.xerces.validators.common.XMLValidator.callEndElement(XMLValidator.java:1613)
at weblogic.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(XMLDocumentScanner.java:1219)
at weblogic.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.java:396)
at weblogic.apache.xerces.framework.XMLParser.parse(XMLParser.java:1119)
at weblogic.xml.jaxp.WebLogicXMLReader.parse(WebLogicXMLReader.java:135)
at weblogic.xml.jaxp.RegistryXMLReader.parse(RegistryXMLReader.java:133)
at org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:371)
at org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:371)
at org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:371)
at org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:371)
at org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:371)
at org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:371)
at org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:371)
at org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:371)
at org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:371)
at org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:371)
at org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:371)
at org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:371)
at org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:371)
at com.sun.j2ee.blueprints.petstore.tools.populate.PopulateServlet.populate(PopulateServlet.java:162)
at com.sun.j2ee.blueprints.petstore.tools.populate.PopulateServlet.doPost(PopulateServlet.java:118)
at com.sun.j2ee.blueprints.petstore.tools.populate.PopulateServlet.doGet(PopulateServlet.java:106)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:945)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:332)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:20)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
at com.sun.j2ee.blueprints.signon.web.SignOnFilter.doFilter(SignOnFilter.java:151)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
at com.sun.j2ee.blueprints.encodingfilter.web.EncodingFilter.doFilter(EncodingFilter.java:77)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:5366)
at weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManager.java:721)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3043)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2468)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:152)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:133)
and similar traces for ContactInfo, CreditCard, Account, Profile, ...
I nevertheless get to the main screen of the Petstore as if everything
worked well. In fact, it seems like the DB got populated somewhat
correctly; only tbe named sequence tables are unchanged (btw: are the
named sequences expected to be auto-created with
create-default-dbms-tables enabled ?). The strange thing is that every
correct row (in my case having the even IDs) is followd by an all (except the
odd numbered ID field) "NULL" row. This does not happen in all
...EJBTABLEs --- Address and ContactInfo for example are affected, but Profile
is not.
It seems as if ordering a rattlesnake would work well, even though more
of the same type of Execptions appear in the jdbc log. I suspect that the
trouble will start when the 10 cached ID are exhausted.
Any ideas?
KaiI just tried the Petstore 1.3 example provided with WLS 7.0.0.1 and found
petty much the same exception after enabling the jdbc log:
java.sql.SQLException: The transaction is no longer active (status = Committed). No further JDBC access is allowed within this transaction.
at weblogic.jdbc.jts.Connection.checkIfRolledBack(Connection.java:541)
at weblogic.jdbc.jts.ResultSet.close(ResultSet.java:293)
at weblogic.jdbc.rmi.internal.ResultSetImpl.close(ResultSetImpl.java:144)
at weblogic.jdbc.rmi.SerialResultSet.close(SerialResultSet.java:96)
at weblogic.jdbc.rmi.SerialResultSet.close(SerialResultSet.java:87)
at weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.releaseResultSet(RDBMSPersistenceManager.java:1797)
at weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.releaseResources(RDBMSPersistenceManager.java:1679)
at weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.execGenKeyNamedSequenceTableUpdateAndQuery(RDBMSPersistenceManager.java:1489)
at weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.getNextGenKeyNamedSequenceTable(RDBMSPersistenceManager.java:1307)
at com.sun.j2ee.blueprints.po.address.ejb.AddressEJB_fvu9sn__WebLogic_CMP_RDBMS.ejbCreate(AddressEJB_fvu9sn__WebLogic_CMP_RDBMS.java:1755)
at java.lang.reflect.Method.invoke(Native Method)
at weblogic.ejb20.manager.DBManager.create(DBManager.java:737)
at weblogic.ejb20.manager.DBManager.localCreate(DBManager.java:716)
at weblogic.ejb20.internal.EntityEJBLocalHome.create(EntityEJBLocalHome.java:182)
at com.sun.j2ee.blueprints.po.address.ejb.AddressEJB_fvu9sn_LocalHomeImpl.create(AddressEJB_fvu9sn_LocalHomeImpl.java:86)
at com.sun.j2ee.blueprints.po.purchaseorder.ejb.PurchaseOrderHelper.persistPoCMRInfo(PurchaseOrderHelper.java:116)
at com.sun.j2ee.blueprints.po.purchaseorder.ejb.PurchaseOrderHelper.persistPO(PurchaseOrderHelper.java:164) at com.sun.j2ee.blueprints.opc.ejb.MsgBean.doWork(MsgBean.java:103)
at com.sun.j2ee.blueprints.opc.ejb.MsgBean.onMessage(MsgBean.java:72)
at weblogic.ejb20.internal.MDListener.execute(MDListener.java:348)
at weblogic.ejb20.internal.MDListener.transactionalOnMessage(MDListener.java:282)
at weblogic.ejb20.internal.MDListener.onMessage(MDListener.java:263)
at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:2309)
at weblogic.jms.client.JMSSession.execute(JMSSession.java:2232)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:152)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:133)
Is there a problem with my general setup maybe, or is this exception to
be ignored?
Kai -
Problem calling a method in a servlet witch returns remote ejb
Hi, I have a problem combining servlets ands ejbs, I expose my problem :
What I have :
1 . I have a User table into a SGBD with two attributes login and pass.
2 . I have a UserBean linked to User table with a remote interface
3 . I have a stateless UserSessionBean with a remote interface
4 . I have a UserServlet linked to a jsp page which allows me to add users
5 . I use Jboss
What is working ?
1 - I have a method newUser implemented in my UserSessionBean :
public class UserSessionBean implements SessionBean {
private SessionContext sessionContext;
private UserRemoteHome userRemoteHome;
public void ejbCreate() throws CreateException {
// Initialize UserRemoteHome
// Method to add a new user
public UserRemote newUser(String login, String password) {
UserRemote newUser = null;
try {
newUser = userRemoteHome.create(login, password);
} catch (RemoteException ex) {
System.err.println("Error: " + ex);
} catch (CreateException ex) {
System.err.println("Error: " + ex);
return newUser;
}2 - When I test this method with a simple client it works perfectly :
public class TestEJB {
public static void main(String[] args) {
Context initialCtx;
try {
// Create JNDI context
// Context initialization
// Narrow UserSessionHome
// Create UserSession
UserSession session = sessionHome.create();
// Test create
UserRemote newUser = session.newUser("pierre", "hemici");
if (newUser != null) {
System.out.println(newUser.printMe());
} catch (Exception e) {
System.err.println("Error: " + e);
e.printStackTrace();
Result : I got the newUser printed on STDOUT and I check in the User table (in the SGBD) if the new user has been created.
What I want ?
I want to call the newUser method from the UserServlet and use the RemoteUser returned by the method.
What I do ?
The jsp :
1 - I have a jsp page where a get information about the new user to create
2 - I put the login parameter and the password parameter into the request
3 - I call the UserServlet when the button "add" is pressed on the jsp page.
The Servlet :
1 - I have a method doInsert which call the newUser method :
public class UserServlet extends HttpServlet {
private static final String CONTENT_TYPE = "text/html";
// EJB Context
InitialContext ejbCtx;
// Session bean
UserSession userSession;
public void init() throws ServletException {
try {
// Open JNDI context (the same as TestClient context)
// Get UserSession Home
// Create UserSession
userSession = userSessionHome.create();
} catch (NamingException ex) {
System.out.println("Error: " + ex);
} catch (RemoteException ex) {
System.out.println("Error: " + ex);
} catch (CreateException ex) {
System.out.println("Error: " + ex);
protected void service(HttpServletRequest req, HttpServletResponse resp) throws
ServletException, IOException {
* Does insertion of the new user in the database.
public void doInsert(HttpServletRequest req, HttpServletResponse resp) throws
ServletException, IOException {
try {
// Get parameters to create the newUser
String login = req.getParameter("login");
String password = req.getParameter("password");
// Create the newUser
System.out.println("Calling newUser before");
UserRemote user = userSession.newUser(login, password);
System.out.println("Calling newUser after");
} catch (Exception e) {
// Clean up resources
public void destroy() {
Result :
When I run my jsp page and click on the "add" button, I got the message "Calling newUser before" printed in STDOUT and the error message :
ERROR [[userservlet]] Servlet.service() for servlet userservlet threw exception
javax.servlet.ServletException: loader constraints violated when linking javax/ejb/Handle class
at noumea.user.UserServlet.service(UserServlet.java:112)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:153)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
at java.lang.Thread.run(Thread.java:534)
Constat :
I checked into my SGBD and the new user has been created.
The error appears only when the method return Remote ejbs, if I return simples objects (Strings, int..) it works.
What can I do to resolve this problem ?
Thank you."Why do you want to servlet to gain access to another EJB through the stateless session bean. Why cant the servlet call it directly ?"
Because I want to access to the informations included in the entity bean UserBean (which is remote).
You said that it is a bad design, but how can I access to my UserBean ejbs from the session bean if I don't do that ?
For example I want a List of all users to be seen in a jsp page :
1 - I call the method getUserList which returnsan ArrayList of UserRemote.
2 - I iterate over the ArrayList to get the users parameters to be seen.
As the other example (newUser), when I do
ArrayList users = (ArrayList) userSession.getUserList(); with the simple client it works, but in the servlet I got the same error.
But, if I call directly the findAll method (as you'are saying) in the servlet
ArrayList users = (ArrayList) userRemoteHome.findAll(); it works...
I think that if my servlet calls directly entity ejbs, I don't need UserSession bean anymore. Is that right ?
I precise that my design is this :
jsp -> servlet -> session bean -> entity bean -> sgbd
Is that a bad design ? Do I need the session bean anymore ?
Thank you. -
Problem while deploying a stateless Session bean
hi,
I am a beginner in J2EE. Please help..
I have encountered an error while i am deploying a session bean in IBM Webspere App Servere
the eroor is
D:\Program Files\WebSphere\AppServer\deploytool\itp>ejbdeploy.bat c:\account\dep
loy\account.jar c:\account\deploy c:\account\deploy\account-ejb.jar
Starting workbench.
Creating the project.
Validating
Generating deployment code
Refreshing: /account.jar/ejbModule.
Building: /account.jar.
Invoking RMIC.
error: Invalid class file format in C:\account\deploy\account.jar(com/fl/ac/Acco
unt.class). The major.minor version '49.0' is too recent for this tool to under
stand.
error: Class com.fl.ac.Account not found in class com.fl.ac.EJSRemoteStatelessAc
countEJB_ca490e54.
error: Invalid class file format in C:\account\deploy\account.jar(com/fl/ac/Acco
untHome.class). The major.minor version '49.0' is too recent for this tool to u
nderstand.
error: Class com.fl.ac.AccountHome not found in class com.fl.ac.EJSRemoteStatele
ssAccountEJBHome_ca490e54.
4 errors
[*Error] An unexpected exception was thrown. Halting execution.
Shutting down workbench.
Error generating RMI code: RMIC Command returns RC = 1. The problems which stopp
ed RMIC are displayed, and have also been recorded in the .log file in c:\accoun
t\deploy\account-ejb._\.metadata.
RMIC command was:
-extdirs D:\Program Files\WebSphere\AppServer\java\jre\lib\core.jar;D:\Program F
iles\WebSphere\AppServer\java\jre\lib\graphics.jar;D:\Program Files\WebSphere\Ap
pServer\java\jre\lib\security.jar;D:\Program Files\WebSphere\AppServer\java\jre\
lib\server.jar;D:\Program Files\WebSphere\AppServer\java\jre\lib\xml.jar;D:\Prog
ram Files\WebSphere\AppServer\java\jre\lib\charsets.jar;D:\Program Files\WebSphe
re\AppServer\java\jre\lib\ext;D:\Program Files\WebSphere\AppServer\java\lib;D:\P
rogram Files\WebSphere\AppServer\classes;D:\Program Files\WebSphere\AppServer\li
b;D:\Program Files\WebSphere\AppServer\lib\ext;D:\Program Files\WebSphere\AppSer
ver\web\help;D:\Program Files\WebSphere\AppServer\deploytool\itp\plugins\com.ibm
.etools.ejbdeploy\runtime;D:\Program Files\ibm\WebSphere MQ\Java\lib; -classpath
c:\account\deploy\account-ejb._\account.jar\ejbModule;C:\account\deploy\account
.jar -iiop -always -keep -d c:\account\deploy\account-ejb._\account.jar\ejbModul
e -sourcepath c:\account\deploy\account-ejb._\account.jar\ejbModule com.fl.ac.EJ
SRemoteStatelessAccountEJBHome_ca490e54 com.fl.ac.EJSRemoteStatelessAccountEJB_c
a490e54
BEAN SOURCE CODE IS
------------------Remote Interface -------------------------------
package com.fl.ac;
import java.rmi.*;
import javax.ejb.*;
public interface Account extends EJBObject {
public double withdraw(double balance,double amount) throws RemoteException;
public double deposite(double balance,double amount) throws RemoteException;
------------------------ Home Interface -----------------------------------
package com.fl.ac;
import java.rmi.*;
import javax.ejb.*;
public interface AccountHome extends EJBHome {
public Account create() throws CreateException,RemoteException;
------------------------- Bean Class -----------------------------------------------
package com.fl.ac;
import java.rmi.*;
import javax.ejb.*;
public class AccountEJB implements SessionBean {
public void setSessionContext(SessionContext ctx) { }
public void unsetSessionContext() { }
public void ejbCreate() { }
public void ejbActivate() { }
public void ejbPassivate() { }
public void ejbRemove() { }
public double withdraw(double balance,double amount){
return (balance - amount);
public double deposite(double balance,double amount){
return (balance+amount);
------------------------------ ejb-jar.xml --------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
<ejb-jar id="ejb-jar_ID">
<display-name>Account EJB</display-name>
<enterprise-beans>
<session>
<ejb-name>AccountEJB</ejb-name>
<home>com.fl.ac.AccountHome</home>
<remote>com.fl.ac.Account</remote>
<ejb-class>com.fl.ac.AccountEJB</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
</session>
</enterprise-beans>
</ejb-jar>
PLZ HELP ME......
francisHi Gauarv,
Did you not see my reply in the following post?
Re: 502 service temporarily unavailable
If I'm not mistaken, this is exactly the same question as you asked
there.
By the way, is there some reason you are still using OC4J version
1.0.2.2? Is there something stopping you from upgrading to the later
versions (9.0.2 and 9.0.3)?
Good Luck,
Avi. -
I want to deploy a CMP Entity Bean in weblogic6.1SP2,but I meet an error,what should I do to solve the problem?
the error code:
<2003-4-7 ~{OBNg~}02~{J1~}27~{7V~}24~{Ck~}> <Error> <J2EE> <Error deploying application SVC:
Unable to deploy EJB: CMPSvc from SVC.jar:
The Container-Managed Persistence Entity EJB failed while creating its SQL Type
Map. The error was:
Io ~{Rl3#~}: Connection reset by peer: socket write error
and my original code:
SVC.java(remote interface)
package CMPEntityBean;
import javax.ejb.*;
import java.rmi.RemoteException;
public interface SVC extends EJBObject
public java.lang.String getSvcID() throws RemoteException;
public java.lang.String getSvcName() throws RemoteException;
public void setSvcID(java.lang.String svcID) throws RemoteException;
public void setSvcName(java.lang.String svcName) throws RemoteException;
SVCHome.java (home interface file)
package CMPEntityBean;
import javax.ejb.*;
import java.rmi.RemoteException;
import java.util.Collection;
public interface SVCHome extends EJBHome
public SVC create(java.lang.String svcID,java.lang.String svcName) throws CreateException,RemoteException;
public SVC findByPrimaryKey(CMPEntityBean.SVCPK key) throws FinderException,RemoteException;
public Collection findBySvcName(java.lang.String svcName) throws FinderException,RemoteException;
SVCBean.java (Enterprise Bean file)
package CMPEntityBean;
import javax.ejb.*;
public abstract class SVCBean implements EntityBean
protected EntityContext ctx;
public abstract java.lang.String getSvcID();
public abstract java.lang.String getSvcName();
public abstract void setSvcID(java.lang.String svcID);
public abstract void setSvcName(java.lang.String svcName);
public void ejbActivate(){}
public void ejbRemove(){}
public void ejbPassivate(){}
public void ejbLoad(){}
public void ejbStore(){}
public void setEntityContext(EntityContext ctx)
this.ctx = ctx;
public void unsetEntityContext()
this.ctx = null;
public void ejbPostCreate(String svcID,String svcName){}
public SVCPK ejbCreate(String svcID,String svcName)
setSvcID(svcID);
setSvcName(svcName);
return new SVCPK(svcID);
ejb-jar.xml
<?xml version="1.0"?>
<!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN' 'http://java.sun.com/dtd/ejb-jar_2_0.dtd'>
<ejb-jar>
<enterprise-beans>
<entity>
<ejb-name>CMPSvc</ejb-name>
<home>CMPEntityBean.SVCHome</home>
<remote>CMPEntityBean.SVC</remote>
<ejb-class>CMPEntityBean.SVCBean</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>CMPEntityBean.SVCPK</prim-key-class>
<reentrant>False</reentrant>
<cmp-version>2.x</cmp-version>
<abstract-schema-name>SVCBean</abstract-schema-name>
<cmp-field>
<field-name>svcID</field-name>
</cmp-field>
<cmp-field>
<field-name>svcName</field-name>
</cmp-field>
<!--prim-key-class>svcID</prim-key-class-->
<query>
<query-method>
<method-name>findBySvcName</method-name>
<method-params>
<method-param>java.lang.String</method-param>
</method-params>
</query-method>
<!--result-type-mapping>Local</result-type-mapping-->
<ejb-ql>
SELECT OBJECT(a) FROM SVCBean a WHERE svcName = ?1
</ejb-ql>
</query>
</entity>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>CMPSvc</ejb-name>
<method-intf>Remote</method-intf>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>
weblogic-ejb-jar.xml
<?xml version="1.0"?>
<!DOCTYPE weblogic-ejb-jar PUBLIC "-//BEA Systems, Inc.//DTD WebLogic 6.0.0 EJB//EN" "http://www.bea.com/servers/wls600/dtd/weblogic-ejb-jar.dtd" >
<weblogic-ejb-jar>
<weblogic-enterprise-bean>
<ejb-name>CMPSvc</ejb-name>
<entity-descriptor>
<entity-cache>
<max-beans-in-cache>1000</max-beans-in-cache>
</entity-cache>
<persistence>
<persistence-type>
<type-identifier>WebLogic_CMP_RDBMS</type-identifier>
<type-version>6.0</type-version>
<type-storage>META-INF/weblogic-cmp-rdbms-jar.xml</type-storage>
</persistence-type>
<persistence-use>
<type-identifier>WebLogic_CMP_RDBMS</type-identifier>
<type-version>6.0</type-version>
</persistence-use>
</persistence>
</entity-descriptor>
<jndi-name>cmpsvc</jndi-name>
</weblogic-enterprise-bean>
</weblogic-ejb-jar>
weblogic-cmp-rdbms-jar.xml
<!DOCTYPE weblogic-rdbms-jar PUBLIC '-//BEA Systems, Inc.//DTD WebLogic 6.0.0 EJB RDBMS Persistence//EN' 'http://www.bea.com/servers/wls600/dtd/weblogic-rdbms-persistence.dtd'>
<weblogic-rdbms-jar>
<weblogic-rdbms-bean>
<ejb-name>CMPSvc</ejb-name>
<data-source-name>ucisOra</data-source-name>
<table-name>TAB_SVC</table-name>
<field-map>
<cmp-field>svcName</cmp-field>
<dbms-column>svcname</dbms-column>
</field-map>
<field-map>
<cmp-field>svcID</cmp-field>
<dbms-column>svcid</dbms-column>
</field-map>
</weblogic-rdbms-bean>
</weblogic-rdbms-jar>
thanks a lot!Try this
SELECT OBJECT(a) FROM SVCBean a WHERE a.svcName = ?1 -
Problem in Java Application Server 7 2004 Q2 + MS SQL 2000 + MS JDBC Driver
I have two applications runing on window 2000 server + Sun Java System Applilcation Server and connect to SQL Server 2000 + window 2000 server.
The JDBC driver is Microsoft JDBC type 4.
Both of them are with Local, Remote Ejb and session beans.
All of the ejbs have a unique jndi name. Each app has its only ejbs.
The problem I am facing is that If I deploy one of them, only one, every thing is fine.
However, If I deploy both of them , only one of them works.
I started the app server serval times. However, every time I got a different fail app.
For example, I got the following error message:
[24/Jan/2005:15:38:41] SEVERE ( 2440): Validation error in class gwumc.edu.ejb.smhs.visitingstudent.StudentBean129315485_JDOState: com.sun.jdo.api.persistence.model.util.ModelValidationException: Warning: Cannot find the table Student for the class gwumc.edu.ejb.smhs.visitingstudent.StudentBean129315485_JDOState.
Verify that the schema file exists and that its contents are correct.
[24/Jan/2005:15:38:42] INFO ( 2440): Bean Student method ejbFindActiveByPassword: problems running JDOQL query with params [21]
com.sun.jdo.api.persistence.support.JDOFatalInternalException: Failed to load the configuration for class gwumc.edu.ejb.smhs.visitingstudent.StudentBean129315485_JDOState.
NestedException: com.sun.jdo.api.persistence.support.JDOUserException: The mapping for class gwumc.edu.ejb.smhs.visitingstudent.StudentBean129315485_JDOState is invalid. Compile the class in the IDE, correct any errors, and verify that all required files are packaged for execution.
at com.sun.jdo.spi.persistence.support.sqlstore.SQLStoreManager.getPersistenceConfig(SQLStoreManager.java:145)
at com.sun.jdo.spi.persistence.support.sqlstore.impl.PersistenceManagerImpl.loadPersistenceConfig(PersistenceManagerImpl.java:2085)
at com.sun.jdo.spi.persistence.support.sqlstore.impl.PersistenceManagerImpl.getRetrieveDesc(PersistenceManagerImpl.java:1009)
at com.sun.jdo.spi.persistence.support.sqlstore.query.jqlc.CodeGeneration.createRetrieveDesc(CodeGeneration.java:707)
at com.sun.jdo.spi.persistence.support.sqlstore.query.jqlc.CodeGeneration.checkRetrieveDesc(CodeGeneration.java:4665)
at com.sun.jdo.spi.persistence.support.sqlstore.query.jqlc.CodeGeneration.prepareRetrieveDescs(CodeGeneration.java:4360)
at com.sun.jdo.spi.persistence.support.sqlstore.query.jqlc.CodeGeneration.query(CodeGeneration.java:850)
at com.sun.jdo.spi.persistence.support.sqlstore.query.jqlc.JQLC.codeGen(JQLC.java:332)
at com.sun.jdo.spi.persistence.support.sqlstore.query.QueryImpl.doExecute(QueryImpl.java:626)
at com.sun.jdo.spi.persistence.support.sqlstore.query.QueryImpl.executeWithArray(QueryImpl.java:552)
at gwumc.edu.ejb.smhs.visitingstudent.StudentBean129315485_ConcreteImpl.ejbFindActiveByPassword(StudentBean129315485_ConcreteImpl.java:3491)
at gwumc.edu.ejb.smhs.visitingstudent.StudentBean129315485_ConcreteImpl_LocalHomeImpl.findActiveByPassword(StudentBean129315485_ConcreteImpl_LocalHomeImpl.java:137)
at gwumc.edu.ejb.smhs.visitingstudent.StudentDeanSessionBean.ejbCreate(StudentDeanSessionBean.java:24)
at gwumc.edu.ejb.smhs.visitingstudent.StudentDeanSessionBean_LocalHomeImpl.create(StudentDeanSessionBean_LocalHomeImpl.java:27)
at gwumc.edu.smhs.servlet.VisitingStudentDeanModel.<init>(VisitingStudentDeanModel.java:18)
at gwumc.edu.smhs.servlet.VisitingStudentDean.doPost(VisitingStudentDean.java:27)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.StandardWrapperValve.invokeServletService(StandardWrapperValve.java:720)
at org.apache.catalina.core.StandardWrapperValve.access$000(StandardWrapperValve.java:118)
at org.apache.catalina.core.StandardWrapperValve$1.run(StandardWrapperValve.java:278)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:274)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:212)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:203)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
at com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.java:158)
at com.iplanet.ias.we
[24/Jan/2005:15:38:42] INFO ( 2440): b.WebContainer.service(WebContainer.java:850)
NestedStackTrace:
com.sun.jdo.api.persistence.support.JDOUserException: The mapping for class gwumc.edu.ejb.smhs.visitingstudent.StudentBean129315485_JDOState is invalid. Compile the class in the IDE, correct any errors, and verify that all required files are packaged for execution.
at com.sun.jdo.spi.persistence.support.sqlstore.SQLStoreManager.getPersistenceConfig(SQLStoreManager.java:128)
at com.sun.jdo.spi.persistence.support.sqlstore.impl.PersistenceManagerImpl.loadPersistenceConfig(PersistenceManagerImpl.java:2085)
at com.sun.jdo.spi.persistence.support.sqlstore.impl.PersistenceManagerImpl.getRetrieveDesc(PersistenceManagerImpl.java:1009)
at com.sun.jdo.spi.persistence.support.sqlstore.query.jqlc.CodeGeneration.createRetrieveDesc(CodeGeneration.java:707)
at com.sun.jdo.spi.persistence.support.sqlstore.query.jqlc.CodeGeneration.checkRetrieveDesc(CodeGeneration.java:4665)
at com.sun.jdo.spi.persistence.support.sqlstore.query.jqlc.CodeGeneration.prepareRetrieveDescs(CodeGeneration.java:4360)
at com.sun.jdo.spi.persistence.support.sqlstore.query.jqlc.CodeGeneration.query(CodeGeneration.java:850)
at com.sun.jdo.spi.persistence.support.sqlstore.query.jqlc.JQLC.codeGen(JQLC.java:332)
at com.sun.jdo.spi.persistence.support.sqlstore.query.QueryImpl.doExecute(QueryImpl.java:626)
at com.sun.jdo.spi.persistence.support.sqlstore.query.QueryImpl.executeWithArray(QueryImpl.java:552)
at gwumc.edu.ejb.smhs.visitingstudent.StudentBean129315485_ConcreteImpl.ejbFindActiveByPassword(StudentBean129315485_ConcreteImpl.java:3491)
at gwumc.edu.ejb.smhs.visitingstudent.StudentBean129315485_ConcreteImpl_LocalHomeImpl.findActiveByPassword(StudentBean129315485_ConcreteImpl_LocalHomeImpl.java:137)
at gwumc.edu.ejb.smhs.visitingstudent.StudentDeanSessionBean.ejbCreate(StudentDeanSessionBean.java:24)
at gwumc.edu.ejb.smhs.visitingstudent.StudentDeanSessionBean_LocalHomeImpl.create(StudentDeanSessionBean_LocalHomeImpl.java:27)
at gwumc.edu.smhs.servlet.VisitingStudentDeanModel.<init>(VisitingStudentDeanModel.java:18)
at gwumc.edu.smhs.servlet.VisitingStudentDean.doPost(VisitingStudentDean.java:27)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.StandardWrapperValve.invokeServletService(StandardWrapperValve.java:720)
at org.apache.catalina.core.StandardWrapperValve.access$000(StandardWrapperValve.java:118)
at org.apache.catalina.core.StandardWrapperValve$1.run(StandardWrapperValve.java:278)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:274)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:212)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:203)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
at com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.java:158)
at com.iplanet.ias.web.WebContainer.service(WebContainer.java:850)
[24/Jan/2005:15:38:42] SEVERE ( 2440): StandardWrapperValve[visitingstudentdean]: Servlet.service() for servlet visitingstudentdean threw exception
javax.servlet.ServletException: nested exception is: com.sun.jdo.api.persistence.support.JDOFatalInternalException: Failed to load the configuration for class gwumc.edu.ejb.smhs.visitingstudent.StudentBean129315485_JDOState.
NestedException: com.sun.jdo.api.persistence.support.JDOUserException: The mapping for class gwumc.edu.ejb.smhs.visitingstudent.StudentBean129315485_JDOState is invalid. Compile the class in the IDE, correct any errors, and verify that all required files are packaged for execution.
at gwumc.edu.smhs.servlet.VisitingStudentDean.doPost(VisitingStudentDean.java:41)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.StandardWrapperValve.invokeServletService(StandardWrapperValve.java:720)
at org.apache.catalina.core.StandardWrapperValve.access$000(StandardWrapperValve.java:118)
at org.apache.catalina.core.StandardWrapperValve$1.run(StandardWrapperValve.java:278)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:274)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:212)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:203)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
at com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.java:158)
at com.iplanet.ias.web.WebContainer.service(WebContainer.java:850)
Any suggestion is great.
Thanks,Hi again, Thanks for the reply!,
I understand the part that you mentionned about specifying the database name. That is not what is causing me a problem : I was reffering to an instance. A new feature of MS SQL server 2000 -> you can have multiple SQL server instances, which means that each will have its own set of databases. Kinda like having multiple virtual servers but on the same machine. With ODBC, you can connect to the DEFAULT instance by just specifying the server name only. When you try to connect to a non default instance in ODBC you must specify it like this : '\\server_name\instance_name.'. I have found no way to do this with the type 4 MS driver (writting it like this : '//server/instance' or any other way was unsuccessful). Does anyone know how to do this or if it can be done with the MS driver???
THX, Bye
Andre Carrier -
MessageDriven Bean problem.Working but the queues r not getting cleared
I have written a simple message driven bean.It just sends a message to an another queue myadapterqueue
on getting a message .
It is working. But the problem is if I restart my application server then it again reads the messages which had been sent to it earlier.Also the queue size is
not getting to 0 bytes after it has consumed messages.
My application server is JBOSS2.4.3
I think I have to specify some attributes in the
descriptor files.But how??????????????
Here is my code
import java.util.*;
import javax.ejb.*;
import javax.jms.*;
import javax.naming.*;
public class MyMessageBean implements javax.ejb.MessageDrivenBean,javax.jms.MessageListener
private QueueConnection connect=null;
private QueueSession session=null;
private QueueSender sender =null;
private Queue sendQueue=null;
private MessageDrivenContext ctx = null;
public void setMessageDrivenContext(MessageDrivenContext mdc){
System.out.println ("In setMessageDrivenContext--------------");
this.ctx=mdc;
public void ejbCreate(){
try{
System.out.println ("Message bean Created--------------");
InitialContext jndi=new InitialContext();
QueueConnectionFactory queueFactory=(QueueConnectionFactory) jndi.lookup("ConnectionFactory");
connect=queueFactory.createQueueConnection();
session=connect.createQueueSession (true,Session.AUTO_ACKNOWLEDGE);
System.out.println ("After session creation--------------");
sendQueue=(Queue)jndi.lookup("queue/myadapterqueue");
System.out.println("************ queue/myadapterqueue");
sender=session.createSender (sendQueue);
System.out.println ("Before Connection start--------------");
connect.start();
}catch(javax.jms.JMSException jmse){
System.out.println ("In ejbcreate exception-------------------");
throw new javax.ejb.EJBException();
}catch(javax.naming.NamingException jne){
System.out.println ("In ejbcreate exception-------------------");
throw new javax.ejb.EJBException();
public void ejbRemove(){
try{
System.out.println("ejbRemove done");
connect.close ();
this.ctx=null;
}catch (javax.jms.JMSException jmse){
System.out.println ("In ejbremove exception-------------------");
System.out.println("ejbRemove excetion");
throw new javax.ejb.EJBException();
public void onMessage(Message msg){
try{
this.sender.send (msg);
this.session.commit();
System.out.println(" Message");
}catch(javax.jms.JMSException jmse ){
jmse.printStackTrace();
here are my descriptors
ejb-jar.xml
<?xml version="1.0"?>
<!DOCTYPE ejb-jar>
<ejb-jar>
<enterprise-beans>
<message-driven>
<ejb-name>MyMessageBean</ejb-name>
<ejb-class>MyMessageBean</ejb-class>
<transaction-type>Container</transaction-type>
<message-driven-destination>
<destination-type>javax.jms.Queue</destination-type>
</message-driven-destination>
</message-driven>
</enterprise-beans>
</ejb-jar>
and the correspong xml file for the application server here is jboss.xml
?xml version="1.0" encoding="UTF-8"?>
<jboss>
<enterprise-beans>
<message-driven>
<ejb-name>MyMessageBean</ejb-name>
<configuration-name>Standard Message Driven Bean</configuration-name>
<destination-jndi-name>queue/MyMessageBeanQ</destination-jndi-name>
</message-driven>
</enterprise-beans>
</jboss>it is unclear whether you are commiting on the first queue or second one.
but it appears like you have created a transactional problem across the two queues. although you commit on the first queue, this commit is not extended to the second queue.
things will be fine unless you get an exception of shutdown.
if you shut your message provider down first then you cannot send the message to the second queue. (assuming that queue 2 is also on the same server)
if you shut your MB app server down then you may be in the middle of accepting a onMessage callback from the first queue.
do you have another MB that registers this one as a listener, or are you infact sending a message back onto the same queue...
public void onMessage(Message msg){
try{
this.sender.send (msg);
//your server may shutdown here and leave messages on the first queue. and send extra messages on the second.
this.session.commit();
System.out.println(" Message");
} catch(javax.jms.JMSException jmse ){
jmse.printStackTrace();
} -
Reg Weblogic Server Startup Problem
Hi
I have configured the weblogic Application Server using Oracle SOA11g
When i started the weblogic server, i am getting below exception.
Exception [TOPLINK-4002] (Oracle TopLink - 11g Release 1(11.1.1.5.0) (Build 110305)): oracle.toplink.exceptions.DatabaseException
Internal Exception: java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist
Error Code: 942
Call: SELECT DRIVER_NAME, MIME_TYPES, PROTOCOLS, CARRIERS, SENDER_ADDRESSES, COS
T, DELIVERY_TYPES, SPEED, STATUS_TYPES, CHECKSUM, SUPPORTS_CANCEL, ENCODINGS, SU
PPORTS_REPLACE, SUPPORTS_TRACKING, SUPPORTS_STATUS_POLLING, DEFAULT_SENDER, CAPA
BILITY, LOCK_VERSION FROM DRIVER_INFO
Query: ReadAllQuery(oracle.sdpinternal.messaging.config.DriverInfo)>
Pls find below log from AdminServer.log and domain_name.log
MDS-01370: MetadataStore configuration for metadata-store-usage "soa-infra-store" is invalid.
ORA-06550: line 1, column 12:
PLS-00201: identifier 'MDS_INTERNAL_SHREDDED.GETREPOSITORYVERSION' must be declared
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
I have tried several solutions for above problem:
Sol1:
I have checked my datasource.
The database details and URL are correct and i am able to test the connection and the DB is up and running.
Sol2:
I dropped RCU and created again but it didnt resolve the issue.
Sol3:
I have renamed the folders tmp, cache and data folders to in the below location
C:\Oracle\Middleware\user_projects\domains\SOA_domain\servers\AdminServer
After starting the weblogic server,these folders are created again but problem is not solved.
Sol4:
Logged intoto Weblogic console->services->Data Source->Click on SOADataSource->Go to Transaction tab->verify 'XA Transaction Timeout:' is set to 0
Sol5:
The schemas details in RCU and during the SOA configuration, there is a screen called "Configure JDBC Component Schema".
The schema details are same in both cases
Sol6: Dropped Database, RCU and SOA and installed again.
But the problem is not solved.
Now i am getting below exception also:
Caused by: javax.ejb.CreateException: SDP-25700: An unexpected exception was cau
ght.
Cause: weblogic.common.resourcepool.ResourceDeadException: 0:weblogic.common.Res
ourceException: Could not create pool connection. The DBMS driver exception was:
IO Error: The Network Adapter could not establish the connection
Action: Check the stack trace for more details.
at oracle.sdpinternal.messaging.storage.MessagingStoreBean.ejbCreate(Mes
sagingStoreBean.java:174)
at oracle.sdpinternal.messaging.storage.MessagingStore_urkbp2_Impl.ejbCr
eate(Unknown Source)
... 56 more
; nested exception is: com.oracle.pitchfork.interfaces.LifecycleCallbackExceptio
n: Failure to invoke public void oracle.sdpinternal.messaging.storage.MessagingS
tore_urkbp2_Impl.ejbCreate() throws javax.ejb.CreateException,javax.ejb.EJBExcep
tion on bean class class oracle.sdpinternal.messaging.storage.MessagingStore_urk
bp2_Impl with args: []>
I have tried deleting tmp folder and renaming tmp, data and cache folders in C:\Oracle\Middleware\user_projects\domains\BPM_Sample_domain\servers\AdminServer location.
But the problem still perists.
Please help me in resolving the issue.
Regards
SwathiHi Swati,
When you see this error
Cause: weblogic.common.resourcepool.ResourceDeadException: 0:weblogic.common.Res
ourceException: Could not create pool connection. The DBMS driver exception was:
IO Error: The Network Adapter could not establish the connection
Action: Check the stack trace for more details.
That means Datasource Connection Pool is failing to create a pool either due to DB is down or no connection made by Pool resource.
Try to tune the Datasource with following parameter will help you.
1. Eanble Test connection on reseve
2. Connection creation retry frequency second set as 10 these two parameter make reconnect back to you DB and Pool start executing correctly.
After enable still have problem please provide complete stack.
Regards,
Kal -
How to code the ejbCreate() method without initailizing primary key?
Hi all,
I've just started learning about EJBs, and now am at the stage of learning how to create, deploy and test a CMP Entity Bean.
Ran into a problem which I'm hoping someone can help out with.
I'm using SQL Server 2000 as my backend database, and have created a simple table called TEST with 2 fields, id and name. id is set as the primary key, and as an identity conlumn. What this means is that when we do inserts, we don't need to specify a value for the id column. SQL Servers automatically generates that value.
Here's my ejbCreate method in my bean class:
public Integer ejbCreate(String name) throws CreateException {
this.setName(name);
}When I tried to run the create method from a web client, I got this error:
javax.ejb.CreateException: [EJB:010148]In EJB 'SampleEJB', the primary key field 'id' was not set during ejbCreate. All primary key fields must be initialized during ejbCreate. at weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:186) at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:284) at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:244) at everbright.ejb.SampleEJB_uzc4wg_HomeImpl_813_WLStub.create(Unknown Source) at jsp_servlet.__index._jspService(__index.java:152) at weblogic.servlet.jsp.JspBase.service(JspBase.java:33) at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:996) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:419) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:315) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6452) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118) at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3661) at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2630) at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
So it seems like I can't leave the id field uninitialized in the ejbCreate method. However I don't know what to initialize it with either, because in order to know what value I need to initialize it to, I'll need to run a db query to retrieve the next primary key value for the id field. This doesn't sound very efficient to me.
I tried to initailize it to null, but that gave me a NullPointerException.
Why do we need to initialize the primary key field in ejbCreate? Should the container do the insert and then get it from the table accordingly?
Is there any other way I can get this set-up working?
Thanks!Hi Fusion777,
Ya, I've been searching around forums for an answer also. Apparently this is indeed a problem that has no general solution. It depends on 2 factors:
1) Whether or not the database supports autogenerate key (which most does) and how (Oracle does it by sequences while SQL Server by identities)
2) Whether or not the application server supports 1).
In my case, I'm using SQL Server and Weblogic Server 8.1 and most fortunately, Weblogic does support identities and sequences. Just define the <auto-key-generation> stanza in your weblogic-cmp-rdbms-jar.xml deployment descriptor, as follows:
<automatic-key-generation>
<generator-type>ORACLE</generator-type>
<generator-name>test_sequence</generator-name>
<key-cache-size>10</key-cache-size>
</automatic-key-generation>
<automatic-key-generation>
<generator-type>SQL-SERVER</generator-type>
</automatic-key-generation>
<automatic-key-generation>
<generator-type>NAMED_SEQUENCE_TABLE</generator-type>
<generator-name>MY_SEQUENCE_TABLE_NAME</generator-name>
<key-cache-size>100</key-cache-size>
</automatic-key-generation>I've tried that and it works :-)
I gather from your reply that those who are using JBoss are equally fortunate :-)
So I thought I'll share this in case some other poor fellow is facing the same problem as we are. At least worse come to worse, he'll have the option of switching to either JBoss or Weblogic and know that it works in both :-)
Some other users seem to be against the idea of using auto-generated keys for precisely the reason that it is not a standard across database and application servers. See this thread:
http://forum.java.sun.com/thread.jspa?forumID=13&threadID=329896
I've in fact stopped working on EJB 2.0 and am exploring something called Hibernate, which seems to have a more generic way of dealing with the auto-generated key issue. In fact, I've heard news that EJB 3.0, which is the upcoming standard for EJB, will be heavily inspired by Hibernate as far as CMP Entity Beans are concerned.
You can check out Hibernate at http://www.hibernate.org. -
Problem deploying message driven bean using Log4j
Hello all.
Using JDeveloper 11.1.1.0.2, I'm having a problem with a message driven bean I've created and associated with a JMS queue.
I've created an EJB Module project in my application (in which some other projects exist), and created the bean. A simple test of the bean, sending a message through the jms queue and printing it on system.out in the mdb onMessage() worked just fine.
However, when I add apache commons logging to my mdb, things start to go wrong. Running the project on the integrated weblogic 10.3 server just fails during deployment, due to a NoClassDefFoundError on org/apache/log4j/Logger.
In project properties -> libraries and classpath, I've added a log4j library (Log4j-1.2.14.jar) next to Commons Logging 1.0.4 but it doesn't seem to matter anything.
The code of my message bean:
@MessageDriven(mappedName = "weblogic.wsee.DefaultQueue")
public class MyMessageBean implements MessageListener {
// logger
private static Log sLog = LogFactory.getLog(MyMessageBean.class);
public void ejbCreate() {
public void ejbRemove() {
public void onMessage(Message message) {
MapMessage mapmsg = null;
try {
if (message instanceof MapMessage) {
mapmsg = (MapMessage)message;
boolean msgRedelivered = mapmsg.getJMSRedelivered();
String msgId = mapmsg.getJMSMessageID();
if (!msgRedelivered) {
sLog.debug("****** Successfully received message " + msgId);
} else {
sLog.debug("****** Successfully received redelivered message " + msgId);
// Haal de inhoud op:
int testInt = mapmsg.getInt("TestInt");
sLog.debug("TestInt:" + testInt);
} else {
sLog.debug("Message of wrong type: " +
message.getClass().getName());
} catch (Exception e) {
sLog.error("Fout in verwerken",e);
}Does anybody have any clue as to what I might be doing wrong or missing out here?
The complete stacktrace:
5-aug-2009 12:54:44 oracle.adf.share.config.ADFConfigFactory cleanUpApplicationState
INFO: Cleaning up application state
java.lang.ExceptionInInitializerError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at weblogic.ejb.container.dd.xml.EjbAnnotationProcessor.processWLSAnnotations(EjbAnnotationProcessor.java:1705)
at weblogic.ejb.container.dd.xml.EjbDescriptorReaderImpl.processWLSAnnotations(EjbDescriptorReaderImpl.java:346)
at weblogic.ejb.container.dd.xml.EjbDescriptorReaderImpl.createReadOnlyDescriptorFromJarFile(EjbDescriptorReaderImpl.java:192)
at weblogic.ejb.spi.EjbDescriptorFactory.createReadOnlyDescriptorFromJarFile(EjbDescriptorFactory.java:93)
at weblogic.ejb.container.deployer.EJBModule.loadEJBDescriptor(EJBModule.java:1198)
at weblogic.ejb.container.deployer.EJBModule.prepare(EJBModule.java:380)
at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:93)
at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:387)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:58)
at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:42)
at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:615)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:191)
at weblogic.application.internal.EarDeployment.prepare(EarDeployment.java:16)
at weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:155)
at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:60)
at weblogic.deploy.internal.targetserver.operations.ActivateOperation.createAndPrepareContainer(ActivateOperation.java:197)
at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doPrepare(ActivateOperation.java:89)
at weblogic.deploy.internal.targetserver.operations.AbstractOperation.prepare(AbstractOperation.java:217)
at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentPrepare(DeploymentManager.java:723)
at weblogic.deploy.internal.targetserver.DeploymentManager.prepareDeploymentList(DeploymentManager.java:1190)
at weblogic.deploy.internal.targetserver.DeploymentManager.handlePrepare(DeploymentManager.java:248)
at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.prepare(DeploymentServiceDispatcher.java:159)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doPrepareCallback(DeploymentReceiverCallbackDeliverer.java:157)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$000(DeploymentReceiverCallbackDeliverer.java:12)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$1.run(DeploymentReceiverCallbackDeliverer.java:45)
at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:516)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
Caused by: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: No suitable Log constructor [Ljava.lang.Class;@51b296 for org.apache.commons.logging.impl.Log4JLogger (Caused by java.lang.NoClassDefFoundError: org/apache/log4j/Logger) (Caused by org.apache.commons.logging.LogConfigurationException: No suitable Log constructor [Ljava.lang.Class;@51b296 for org.apache.commons.logging.impl.Log4JLogger (Caused by java.lang.NoClassDefFoundError: org/apache/log4j/Logger))
at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:543)
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:235)
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:209)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:351)
at nl.justid.dolores.mdb.MyMessageBean.<clinit>(MyMessageBean.java:19)
... 32 more
Caused by: org.apache.commons.logging.LogConfigurationException: No suitable Log constructor [Ljava.lang.Class;@51b296 for org.apache.commons.logging.impl.Log4JLogger (Caused by java.lang.NoClassDefFoundError: org/apache/log4j/Logger)
at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:413)
at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:529)
... 36 more
Caused by: java.lang.NoClassDefFoundError: org/apache/log4j/Logger
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
at java.lang.Class.getConstructor0(Class.java:2699)
at java.lang.Class.getConstructor(Class.java:1657)
at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:410)
... 37 more
Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Logger
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
... 42 more
<5-aug-2009 12:54:44 uur CEST> <Error> <Deployer> <BEA-149265> <Failure occurred in the execution of deployment request with ID '1249469684085' for task '14'. Error is: 'weblogic.application.ModuleException: Exception preparing module: EJBModule(Dolores-MessageBeans-ejb)
[EJB:011023]An error occurred while reading the deployment descriptor. The error was:
null.'
weblogic.application.ModuleException: Exception preparing module: EJBModule(Dolores-MessageBeans-ejb)
[EJB:011023]An error occurred while reading the deployment descriptor. The error was:
null.
at weblogic.ejb.container.deployer.EJBModule.prepare(EJBModule.java:452)
at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:93)
at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:387)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:58)
Truncated. see log file for complete stacktrace
java.lang.ClassNotFoundException: org.apache.log4j.Logger
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
Truncated. see log file for complete stacktrace
>
5-aug-2009 12:54:44 oracle.adf.share.config.ADFConfigFactory cleanUpApplicationState
INFO: Cleaning up application state
<5-aug-2009 12:54:44 uur CEST> <Warning> <Deployer> <BEA-149004> <Failures were detected while initiating deploy task for application 'Dolores'.>
<5-aug-2009 12:54:44 uur CEST> <Warning> <Deployer> <BEA-149078> <Stack trace for message 149004
weblogic.application.ModuleException: Exception preparing module: EJBModule(Dolores-MessageBeans-ejb)
[EJB:011023]An error occurred while reading the deployment descriptor. The error was:
null.
at weblogic.ejb.container.deployer.EJBModule.prepare(EJBModule.java:452)
at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:93)
at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:387)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:58)
Truncated. see log file for complete stacktrace
java.lang.ClassNotFoundException: org.apache.log4j.Logger
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
Truncated. see log file for complete stacktrace
>
[Deployer:149034]An exception occurred for task [Deployer:149026]deploy application Dolores on DefaultServer.: Exception preparing module: EJBModule(Dolores-MessageBeans-ejb)
[EJB:011023]An error occurred while reading the deployment descriptor. The error was:
null..
weblogic.application.ModuleException: Exception preparing module: EJBModule(Dolores-MessageBeans-ejb)
[EJB:011023]An error occurred while reading the deployment descriptor. The error was:
null.
#### Deployment incomplete. #### Aug 5, 2009 12:54:44 PM
oracle.jdeveloper.deploy.DeployException
at oracle.jdevimpl.deploy.common.Jsr88RemoteDeployer.doDeploymentAction(Jsr88RemoteDeployer.java:247)
at oracle.jdevimpl.deploy.common.Jsr88RemoteDeployer.deployImpl(Jsr88RemoteDeployer.java:157)
at oracle.jdeveloper.deploy.common.AbstractDeployer.deploy(AbstractDeployer.java:94)
at oracle.jdevimpl.deploy.fwk.WrappedDeployer.deployImpl(WrappedDeployer.java:39)
at oracle.jdeveloper.deploy.common.AbstractDeployer.deploy(AbstractDeployer.java:94)
at oracle.jdeveloper.deploy.common.BatchDeployer.deployImpl(BatchDeployer.java:82)
at oracle.jdeveloper.deploy.common.AbstractDeployer.deploy(AbstractDeployer.java:94)
at oracle.jdevimpl.deploy.fwk.WrappedDeployer.deployImpl(WrappedDeployer.java:39)
at oracle.jdeveloper.deploy.common.AbstractDeployer.deploy(AbstractDeployer.java:94)
at oracle.jdevimpl.deploy.fwk.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:436)
at oracle.jdeveloper.deploy.DeploymentManager.deploy(DeploymentManager.java:209)
at oracle.jdevimpl.runner.adrs.AdrsStarter$5$1.run(AdrsStarter.java:1365)
Caused by: oracle.jdeveloper.deploy.DeployException
at oracle.jdevimpl.deploy.common.Jsr88DeploymentHelper.deployApplication(Jsr88DeploymentHelper.java:413)
at oracle.jdevimpl.deploy.common.Jsr88RemoteDeployer.doDeploymentAction(Jsr88RemoteDeployer.java:238)
... 11 more
Caused by: oracle.jdeveloper.deploy.DeployException: Deployment Failed
at oracle.jdevimpl.deploy.common.Jsr88DeploymentHelper.deployApplication(Jsr88DeploymentHelper.java:395)
... 12 more
#### Cannot run application Dolores due to error deploying to DefaultServer.
[Application Dolores stopped and undeployed from Server Instance DefaultServer]Thanks in advance!
Greetings,
Eelse
Edited by: Eelse on Aug 5, 2009 1:57 PM
Edited by: Eelse on Aug 5, 2009 5:39 PMCreating a new deployment profile (EAR) and including the original deployment (JAR) and the needed libraries (in a lib-directory) solved the problem.
-
Message Driven Bean Reference Problem
Hi,
I have problems a MDB referencing other beans, I am getting Class Cast
exception whenever my MDB tries to use narrow operation after the lookup
is done.
The Code is as follows:
public void ejbCreate () throws CreateException {
log("ejbCreate called");
try {
InitialContext ctx = new InitialContext();
Object ref = ctx.lookup("java:comp/env/ejb/LoggerCache");
log("Lookup of Cache done");
LoggerCacheHome loggerCacheHome = (LoggerCacheHome)
PortableRemoteObject.narrow(ref, LoggerCacheHome.class);
} catch(Exception ex) {
ex.printStackTrace();
The lookup is successful but when I try to use the narrow..... I get the
following exception stackk Trace.
Any help will be appreciated.
TIA,
Vikas
Stack Trace
java.lang.ClassCastException
at
weblogic.iiop.PortableRemoteObjectDelegateImpl.narrow(PortableRemoteO
bjectDelegateImpl.java:90)
at
javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:137)
at
examples.ejb20.message.MessageTraderBean.ejbCreate(MessageTraderBean.
java:90)
at java.lang.reflect.Method.invoke(Native Method)
at
weblogic.ejb20.internal.MessageDrivenEJBHome.createBean(MessageDriven
EJBHome.java:290)
at
weblogic.ejb20.pool.MessageDrivenPool.createBean(MessageDrivenPool.ja
va:98)
at weblogic.ejb20.pool.Pool.createInitialBeans(Pool.java:100)
at weblogic.ejb20.pool.Pool.<init>(Pool.java:74)
at weblogic.ejb20.pool.EntityPool.<init>(EntityPool.java:34)
at
weblogic.ejb20.pool.MessageDrivenPool.<init>(MessageDrivenPool.java:4
3)
at
weblogic.ejb20.deployer.MessageDrivenBeanInfoImpl.getPool(MessageDriv
enBeanInfoImpl.java:336)
at
weblogic.ejb20.deployer.MessageDrivenBeanInfoImpl.deploy(MessageDrive
nBeanInfoImpl.java:403)
at
weblogic.ejb20.deployer.Deployer.deployDescriptor(Deployer.java:1105)
at weblogic.ejb20.deployer.Deployer.deploy(Deployer.java:908)
at weblogic.j2ee.EJBComponent.deploy(EJBComponent.java:31)
at weblogic.j2ee.Application.deploy(Application.java:167)
at
weblogic.j2ee.J2EEService.deployApplication(J2EEService.java:173)
at
weblogic.management.mbeans.custom.Application.setLocalDeployed(Applic
ation.java:217)
at
weblogic.management.mbeans.custom.Application.setDeployed(Application
.java:187)
at java.lang.reflect.Method.invoke(Native Method)
at
weblogic.management.internal.DynamicMBeanImpl.invokeSetter(DynamicMBe
anImpl.java:1136)
at
weblogic.management.internal.DynamicMBeanImpl.setAttribute(DynamicMBe
anImpl.java:773)
at
weblogic.management.internal.DynamicMBeanImpl.setAttribute(DynamicMBe
anImpl.java:750)
at
weblogic.management.internal.ConfigurationMBeanImpl.setAttribute(Conf
igurationMBeanImpl.java:256)
at
com.sun.management.jmx.MBeanServerImpl.setAttribute(MBeanServerImpl.j
ava:1356)
at
com.sun.management.jmx.MBeanServerImpl.setAttribute(MBeanServerImpl.j
ava:1331)
at
weblogic.management.internal.ConfigurationMBeanImpl.updateConfigMBean
s(ConfigurationMBeanImpl.java:318)
at
weblogic.management.internal.ConfigurationMBeanImpl.setAttribute(Conf
igurationMBeanImpl.java:259)
at
com.sun.management.jmx.MBeanServerImpl.setAttribute(MBeanServerImpl.j
ava:1356)
at
com.sun.management.jmx.MBeanServerImpl.setAttribute(MBeanServerImpl.j
ava:1331)
at
weblogic.management.internal.MBeanProxy.setAttribute(MBeanProxy.java:
291)
at
weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:173)
at $Proxy91.setDeployed(Unknown Source)
at
weblogic.management.mbeans.custom.ApplicationManager.autoDeploy(Appli
cationManager.java:494)
at
weblogic.management.mbeans.custom.ApplicationManager.poll(Application
Manager.java:465)
at
weblogic.management.mbeans.custom.ApplicationManager.poll(Application
Manager.java:380)
at
weblogic.management.mbeans.custom.ApplicationManager.update(Applicati
onManager.java:152)
at java.lang.reflect.Method.invoke(Native Method)
at
weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMB
eanImpl.java:562)
at
weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl
.java:548)
at
weblogic.management.internal.ConfigurationMBeanImpl.invoke(Configurat
ionMBeanImpl.java:285)
at
com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
55)
at
com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
23)
at
weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:437)
at
weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:178)
at $Proxy2.update(Unknown Source)
at
weblogic.management.console.pages._domain._upload_app._jspService(_up
load_app.java:172)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:213)
at
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
rvletContext.java:1265)
at
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
pl.java:1622)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)Print the class info for the castee and the cast-to classes. They are
incompatible, and hence the exception. It could be a bug in your code, or
it could be a classloader issue (resulting from how you
packaged/deployed/how your app works) or something like that.
Peace,
Cameron Purdy
Tangosol, Inc.
http://www.tangosol.com
+1.617.623.5782
WebLogic Consulting Available
"Vikas" <[email protected]> wrote in message
news:[email protected]...
Hi,
I have problems a MDB referencing other beans, I am getting Class Cast
exception whenever my MDB tries to use narrow operation after the lookup
is done.
The Code is as follows:
public void ejbCreate () throws CreateException {
log("ejbCreate called");
try {
InitialContext ctx = new InitialContext();
Object ref = ctx.lookup("java:comp/env/ejb/LoggerCache");
log("Lookup of Cache done");
LoggerCacheHome loggerCacheHome = (LoggerCacheHome)
PortableRemoteObject.narrow(ref, LoggerCacheHome.class);
} catch(Exception ex) {
ex.printStackTrace();
The lookup is successful but when I try to use the narrow..... I get the
following exception stackk Trace.
Any help will be appreciated.
TIA,
Vikas
Stack Trace
java.lang.ClassCastException
at
weblogic.iiop.PortableRemoteObjectDelegateImpl.narrow(PortableRemoteO
bjectDelegateImpl.java:90)
at
javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:137)
at
examples.ejb20.message.MessageTraderBean.ejbCreate(MessageTraderBean.
java:90)
at java.lang.reflect.Method.invoke(Native Method)
at
weblogic.ejb20.internal.MessageDrivenEJBHome.createBean(MessageDriven
EJBHome.java:290)
at
weblogic.ejb20.pool.MessageDrivenPool.createBean(MessageDrivenPool.ja
va:98)
at weblogic.ejb20.pool.Pool.createInitialBeans(Pool.java:100)
at weblogic.ejb20.pool.Pool.<init>(Pool.java:74)
at weblogic.ejb20.pool.EntityPool.<init>(EntityPool.java:34)
at
weblogic.ejb20.pool.MessageDrivenPool.<init>(MessageDrivenPool.java:4
3)
at
weblogic.ejb20.deployer.MessageDrivenBeanInfoImpl.getPool(MessageDriv
enBeanInfoImpl.java:336)
at
weblogic.ejb20.deployer.MessageDrivenBeanInfoImpl.deploy(MessageDrive
nBeanInfoImpl.java:403)
at
weblogic.ejb20.deployer.Deployer.deployDescriptor(Deployer.java:1105)
at weblogic.ejb20.deployer.Deployer.deploy(Deployer.java:908)
at weblogic.j2ee.EJBComponent.deploy(EJBComponent.java:31)
at weblogic.j2ee.Application.deploy(Application.java:167)
at
weblogic.j2ee.J2EEService.deployApplication(J2EEService.java:173)
at
weblogic.management.mbeans.custom.Application.setLocalDeployed(Applic
ation.java:217)
at
weblogic.management.mbeans.custom.Application.setDeployed(Application
.java:187)
at java.lang.reflect.Method.invoke(Native Method)
at
weblogic.management.internal.DynamicMBeanImpl.invokeSetter(DynamicMBe
anImpl.java:1136)
at
weblogic.management.internal.DynamicMBeanImpl.setAttribute(DynamicMBe
anImpl.java:773)
at
weblogic.management.internal.DynamicMBeanImpl.setAttribute(DynamicMBe
anImpl.java:750)
at
weblogic.management.internal.ConfigurationMBeanImpl.setAttribute(Conf
igurationMBeanImpl.java:256)
at
com.sun.management.jmx.MBeanServerImpl.setAttribute(MBeanServerImpl.j
ava:1356)
at
com.sun.management.jmx.MBeanServerImpl.setAttribute(MBeanServerImpl.j
ava:1331)
at
weblogic.management.internal.ConfigurationMBeanImpl.updateConfigMBean
s(ConfigurationMBeanImpl.java:318)
at
weblogic.management.internal.ConfigurationMBeanImpl.setAttribute(Conf
igurationMBeanImpl.java:259)
at
com.sun.management.jmx.MBeanServerImpl.setAttribute(MBeanServerImpl.j
ava:1356)
at
com.sun.management.jmx.MBeanServerImpl.setAttribute(MBeanServerImpl.j
ava:1331)
at
weblogic.management.internal.MBeanProxy.setAttribute(MBeanProxy.java:
291)
at
weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:173)
at $Proxy91.setDeployed(Unknown Source)
at
weblogic.management.mbeans.custom.ApplicationManager.autoDeploy(Appli
cationManager.java:494)
at
weblogic.management.mbeans.custom.ApplicationManager.poll(Application
Manager.java:465)
at
weblogic.management.mbeans.custom.ApplicationManager.poll(Application
Manager.java:380)
at
weblogic.management.mbeans.custom.ApplicationManager.update(Applicati
onManager.java:152)
at java.lang.reflect.Method.invoke(Native Method)
at
weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMB
eanImpl.java:562)
at
weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl
.java:548)
at
weblogic.management.internal.ConfigurationMBeanImpl.invoke(Configurat
ionMBeanImpl.java:285)
at
com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
55)
at
com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
23)
at
weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:437)
at
weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:178)
at $Proxy2.update(Unknown Source)
at
weblogic.management.console.pages._domain._upload_app._jspService(_up
load_app.java:172)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:213)
at
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
rvletContext.java:1265)
at
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
pl.java:1622)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120) -
Problem with JMS from session bean
My guess is that in your effort to work around the
clustering/ejb/jndi problems, you have a producer
sending on one topic, and a consumer listening on
another topic. You can check to see if they are the
same destination using the (uncompiled) code snippets
below at both the producer and consumer ends.
import weblogic.jms.common.DestinationImpl;
Topic topic;
DestinationImpl destination = (DestinationImpl) topic;
System.out.println("name = " + destination.getServerName() + "/" +
destination.getName());
System.out.println("back-end id = " + destination.getBackEndId());
System.out.println("destination id = " + destination.getDestinationId());
_sjz.
"Malcolm Robbins" <[email protected]> wrote in message
news:[email protected]...
>
This was also posted to the EJB newsgroup and was asked to post the secondissue
here. Please focus on the second issue, but the first providesbackground.
>
>
I have discovered two significant problems in WLS6.0 with JNDi and JMSthat do
not occur in the Sun Reference implementation (1.3 Beta).
Attached is some code you can try to see the problem.
I have developed a JmsClient that simply looks up a session bean andpasses it
a string to publish. The session bean is meant to publish to a JMS topic.
However I have discovered two problems:
1) In teh ejbCreate() method I look up the topic connection factory andtopic
in JNDI. These are referenced as "java:comp/env/jms/JmsConnectionFactory"and
"java:comp/env/jms/JmsTopic" respectively. Here's a fragment of theejb-jar
descriptor
<resource-ref>
<description>The (probably durable) Topic Connection Factory to connectto</description>
<res-ref-name>jms/JmsConnectionFactory</res-ref-name>
<res-type>javax.jms.TopicConnectionFactory</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<resource-env-ref>
<description>The Jms Source Topic to publish to</description>
<resource-env-ref-name>jms/JmsTopic</resource-env-ref-name>
<resource-env-ref-type>javax.jms.Topic</resource-env-ref-type>
</resource-env-ref>
As you can see they are resource references and resoruce environmentreferences
respectively. The weblogic-ejb-jar maps these to the real JNDI names"TopicConnectionFactory"
amd "SchemaTopic" respectively as shown below by the fragment:
<weblogic-ejb-jar>
...etc...
<reference-descriptor>
<resource-description>
<res-ref-name>jms/JmsConnectionFactory</res-ref-name>
<jndi-name>TopicConnectionFactory</jndi-name>
</resource-description>
<resource-env-description>
<res-env-ref-name>jms/JmsTopic</res-env-ref-name>
<jndi-name>SchemaTopic</jndi-name>
</resource-env-description>
</reference-descriptor>
Now here's the first problem. When this is deployed the resourceenvironment
"logical" name (JNDI linkref) for the topic is not defined. The code willhappily
find the connection factory (presuming you've set these administeredobjects at
the console).
2) The second problem now arises. In the code I have ahcked it so thatwhen
the JNDI lookup fails it tries looking up the real topic in JNDI(SchemaTopic)
directly.
This works and teh bean now appears to work, albeit with a directlyhardcoded
JNDI reference in it. However, if you hook up a standard JMS consumer tothat
topic it will not consuem the message that is published!!! While thestats clock
up at the console the message appears to go into a black hole. I canprovdie
a stadnard consumer if you need one.
I have the code working fine as-is in teh Sun Reference implementation soI presume
these are bugs with WL6.0.
Can anyone advise workarounds and/or fix the problem?
Maybe you are looking for
-
Hi, I´m having a problem with material stock. I get two different values on MB5B and MBEWH table for the same material, plant and date. Material: TP05891070 Company code: 531 Plant: 7101 Selection Date: 01.01.2008 to 31.01.2008 On MB5B, I get: Stock/
-
Dynamic action on text box change does not working
i have a page with following components. a report that has and edit link. a text box to catch the primary key from report link when it is clicked a number of elements (text boxes, check boxes and LOVs) which are used as data entry form. Now my design
-
EPrint problem with CP1525nw - connection error
I just installed a CP1525nw in our home network. It's wired, and we can print and access the printer's web page from every computer - no problems with local printing. However, I'm not able to successfully complete the ePrint setup. When printing the
-
How to derive a variable value from another variable of a different IO?
Hi Gurus, I am aware that using BEx variables and Customer Exit you are able to derive a variable value from another variable of the same infoobject (for example, Fiscal Year/Period (0FISCPER) and Calendar Day (0CALDAY)). However, is is possible, usi
-
Trouble getting on itunes store
Everytime I get on the itunes store I get this message: Itunes could not connect to the itunes store. The network connection was refused. Make sure your network settings are correct and your network connection is active, then try again.