WebSphere Application Server - Unable to start application with CMP EJB

This is Interesting: Free IT Magazines  
Home > Archive > WebSphere Application Server > May 2004 > Unable to start application with CMP EJB





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Unable to start application with CMP EJB
msmolyak

2004-04-30, 11:34 am

I have an EAR file which contains several EJBs, one of then CMP Entity bean, other are session beans. It was developed outside of IBM development tools and contains no IBM-specific descriptors. I am trying to deploy the EAR file to WS 5.1 using the Admin
Console. I specify all the required parameters including JNDI names, data source names, EJB and resource references. The application installs correctly. When I try to start the application I get the following error.

[4/30/04 10:19:42:904 EDT] 7e2fefe4 EJSContainer E CNTR0035E: EJB container caught java.lang.ClassCastException: com.ibm.ws.rsadapter.jdbc.WSJdbcDataSource
at com.ibm.rmi.javax.rmi.PortableRemoteObject.getObjectImpl(PortableRemoteObject.java:626)
at com.ibm.rmi.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:371)
at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:156)
at com.ibm.ws.ejbpersistence.beanextensions.ConcreteBeanClassExtensionImpl.lookup(Unknown Source)
at com.ibm.ws.ejbpersistence.beanextensions.ConcreteBeanClassExtensionImpl.getConnectionFactory(Unknown Source)
at com.ibm.ws.ejbpersistence.beanextensions.PMModuleCookieImpl.beanInstall(Unknown Source)
at com.ibm.ws.ejbpersistence.beanextensions.PersistenceManagerImpl.beanInstall(Unknown Source)
at com.ibm.ejs.container.EJSContainer.loadBeanMetaData(EJSContainer.java:1367)
at com.ibm.ejs.container.EJSContainer.getHomeWrapperCommon(EJSContainer.java:1012)
at com.ibm.ejs.container.EJSContainer.getHomeInstance(EJSContainer.java:934)
at com.ibm.ejs.container.EJSContainer.startBean(EJSContainer.java:913)
at com.ibm.ws.runtime.component.EJBContainerImpl.startBean(EJBContainerImpl.java:1301)
at com.ibm.ws.runtime.component.EJBContainerImpl.install(EJBContainerImpl.java:1034)
at com.ibm.ws.runtime.component.EJBContainerImpl.start(EJBContainerImpl.java:1508)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:418)
at com.ibm.ws.runtime.component.DeployedApplicationImpl. fireDeployedObjectStart(DeployedApplicat
ionImpl.java:787)
at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:354)
at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:575)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:271)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:488)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java(Compiled Code))
at java.lang.reflect.Method.invoke(Method.java(Compiled Code))
at com.tivoli.jmx.modelmbean.MMBInvoker.invoke(MMBInvoker.java:46)
at com.tivoli.jmx.modelmbean.MMBInvoker.invokeOperation(MMBInvoker.java:115)
at com.tivoli.jmx.modelmbean.DynamicModelMBeanSupport.invoke(DynamicModelMBeanSupport.java:409)
at javax.management.modelmbean.RequiredModelMBean.invoke(RequiredModelMBean.java:323)
at com.tivoli.jmx.GenericMBeanSupport.invoke(GenericMBeanSupport.java:178)
at com.tivoli.jmx.MBeanAccess.invoke(MBeanAccess.java:113)
at com.tivoli.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:290)
at com.ibm.ws.management.AdminServiceImpl.invoke(AdminServiceImpl.java:659)
at com.ibm.ws.console.core.mbean.MBeanHelper.invoke(MBeanHelper.java:141)
at com.ibm.ws.console.appdeployment.ApplicationDeploymentCollectionAction. perform(ApplicationDeploymentCollectionA
ction.java:315)
at org.apache.struts.action.ActionServlet.processActionPerform(ActionServlet.java:1791)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1586)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:510)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher. handleWebAppDispatch(WebAppRequestDispat
cher.java:974)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:555)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:200)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:119)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:276)
at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
at com.ibm.ws.webcontainer.cache.invocation.CacheableInvocationContext.invoke(CacheableInvocationContext.java:114)
at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:186)
at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)
at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:618)
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:443)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:593)

Any help resolving this deployment issue is appreciated.

Michael Smolyak
Yang Lei

2004-05-03, 12:34 pm

Hello,

Check if you mark the datasource that you config for the EJB CMP as "for
container managed persistence"

Yang.


"msmolyak" <msmolyak@datasourceinc.com> wrote in message
news:1412088561.1083337485079.JavaMail.wasadmin@swg3ws006...
> I have an EAR file which contains several EJBs, one of then CMP Entity

bean, other are session beans. It was developed outside of IBM development
tools and contains no IBM-specific descriptors. I am trying to deploy the
EAR file to WS 5.1 using the Admin Console. I specify all the required
parameters including JNDI names, data source names, EJB and resource
references. The application installs correctly. When I try to start the
application I get the following error.
>
> [4/30/04 10:19:42:904 EDT] 7e2fefe4 EJSContainer E CNTR0035E: EJB

container caught java.lang.ClassCastException:
com.ibm.ws.rsadapter.jdbc.WSJdbcDataSource
> at

com.ibm.rmi.javax.rmi.PortableRemoteObject.getObjectImpl(PortableRemoteObjec
t.java:626)
> at

com.ibm.rmi.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:
371)
> at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:156)
> at

com.ibm.ws.ejbpersistence.beanextensions.ConcreteBeanClassExtensionImpl.look
up(Unknown Source)
> at

com.ibm.ws.ejbpersistence.beanextensions.ConcreteBeanClassExtensionImpl.getC
onnectionFactory(Unknown Source)
> at

com.ibm.ws.ejbpersistence.beanextensions.PMModuleCookieImpl.beanInstall(Unkn
own Source)
> at

com.ibm.ws.ejbpersistence.beanextensions.PersistenceManagerImpl.beanInstall(
Unknown Source)
> at

com.ibm.ejs.container.EJSContainer.loadBeanMetaData(EJSContainer.java:1367)
> at

com.ibm.ejs.container.EJSContainer.getHomeWrapperCommon(EJSContainer.java:10
12)
> at

com.ibm.ejs.container.EJSContainer.getHomeInstance(EJSContainer.java:934)
> at com.ibm.ejs.container.EJSContainer.startBean(EJSContainer.java:913)
> at

com.ibm.ws.runtime.component.EJBContainerImpl.startBean(EJBContainerImpl.jav
a:1301)
> at

com.ibm.ws.runtime.component.EJBContainerImpl.install(EJBContainerImpl.java:
1034)
> at

com.ibm.ws.runtime.component.EJBContainerImpl.start(EJBContainerImpl.java:15
08)
> at

com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.jav
a:418)
> at

com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart
(DeployedApplicationImpl.java:787)
> at

com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.jav
a:354)
> at

com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicati
onImpl.java:575)
> at

com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(Application
MgrImpl.java:271)
> at

com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(Application
MgrImpl.java:488)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at

sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79
)
> at

sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
..java(Compiled Code))
> at java.lang.reflect.Method.invoke(Method.java(Compiled Code))
> at com.tivoli.jmx.modelmbean.MMBInvoker.invoke(MMBInvoker.java:46)
> at

com.tivoli.jmx.modelmbean.MMBInvoker.invokeOperation(MMBInvoker.java:115)
> at

com.tivoli.jmx.modelmbean.DynamicModelMBeanSupport.invoke(DynamicModelMBeanS
upport.java:409)
> at

javax.management.modelmbean.RequiredModelMBean.invoke(RequiredModelMBean.jav
a:323)
> at com.tivoli.jmx.GenericMBeanSupport.invoke(GenericMBeanSupport.java:178)
> at com.tivoli.jmx.MBeanAccess.invoke(MBeanAccess.java:113)
> at com.tivoli.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:290)
> at

com.ibm.ws.management.AdminServiceImpl.invoke(AdminServiceImpl.java:659)
> at com.ibm.ws.console.core.mbean.MBeanHelper.invoke(MBeanHelper.java:141)
> at

com.ibm.ws.console.appdeployment.ApplicationDeploymentCollectionAction.perfo
rm(ApplicationDeploymentCollectionAction
.java:315)
> at

org.apache.struts.action.ActionServlet.processActionPerform(ActionServlet.ja
va:1791)
> at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1586)
> at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:510)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> at

com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServle
tInstance.java:110)
> at

com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecy
cleServlet.java:174)
> at

com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServ
let.java:313)
> at

com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecyc
leServlet.java:116)
> at

com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java
:283)
> at

com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidSer
vletReferenceState.java:42)
> at

com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletIns
tanceReference.java:40)
> at

com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(
WebAppRequestDispatcher.java:974)
> at

com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppReques
tDispatcher.java:555)
> at

com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequest
Dispatcher.java:200)
> at

com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:119)
> at

com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker
..java:276)
> at

com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(C
achedInvocation.java:71)
> at

com.ibm.ws.webcontainer.cache.invocation.CacheableInvocationContext.invoke(C
acheableInvocationContext.java:114)
> at

com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletReq
uestProcessor.java:186)
> at

com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListene
r.java:334)
> at

com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.jav
a:56)
> at

com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:618)
> at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:443)
> at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:593)
>
> Any help resolving this deployment issue is appreciated.
>
> Michael Smolyak



donv

2004-05-14, 3:34 am

> I resolved the immediate error. It turned out that
> the data source marked for usage by the CMP bean was
> not markes as "Use this Data Source in container
> managed persistence (CMP)" in the Admin Console
> configuration screen.


Thanks a lot! We had the same problem.

> Any idea what this setting corresponds to in the
> wsadmin scripting langauge?


Did you find the answer to this question?


Uwe
msmolyak

2004-05-14, 12:46 pm

Yes, I did. I could not find anything as simple as setting a boolean flag, but I think I found the set of actions that mimic the behavior of the Console.

Below is the portion of my script for creation of data sources that deals with the connection factories. It is the connection factory that gets created when you check the CMP box in the console. The names of the factory are derived from the data source na
me using the same rule WS uses.

# Obtain Relational Resource Adapter, parent of the connection factory
adapterPath = nodePath + '/J2CResourceAdapter:WebSphere Relational Resource Adapter'
adapter = AdminConfig.getid(adapterPath)
print 'Relational Resource Adapter:' + AdminConfig.showall(adapter)

# Remove connection factory if one exists
cfName = datasourceName + '_CF'
cfPath = adapterPath + '/CMPConnectorFactory:' + cfName
cf = AdminConfig.getid(cfPath)
if (cf != ""):
print 'Removing existing connection factory' + cf
AdminConfig.remove(cf)

# Configure the connection factory attributes
nameAttr = ['name', cfName]
authMechanism = ['authMechanismPreference', 'BASIC_PASSWORD']
dsAttr = ['cmpDatasource', newds]
jndiNameAttr = ['jndiName', 'eis/' + datasourceJndiName + '_CMP']
authDataAliasAttr = ['authDataAlias', aliasName]

cfAttrs = [nameAttr, authMechanism, dsAttr, jndiNameAttr, authDataAliasAttr]

# Create the new connection factory
cf = AdminConfig.create('CMPConnectorFactory', adapter, cfAttrs)
print AdminConfig.showall(cf)

donv

2004-05-19, 5:36 am

> Yes, I did. I could not find anything as simple as
> setting a boolean flag, but I think I found the set
> of actions that mimic the behavior of the Console.
>
> Below is the portion of my script for creation of
> data sources that deals with the connection
> factories. It is the connection factory that gets
> created when you check the CMP box in the console.
> The names of the factory are derived from the data
> source name using the same rule WS uses.


Thanks a million! In addition to your code you need to set an extra attribute on the datasource:

AdminConfig.modify(newds, [["relationalResourceAdapter", adapter]])

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com