• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Paul Clapham
  • Devaka Cooray
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Liutauras Vilda
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Piet Souris
Bartenders:
  • salvin francis
  • Carey Brown
  • Frits Walraven

EJB to EDB Mapping problems

 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,
I encountered two problems while trying to use EJB to EDB Mapping, my wsad is 5.1 and the EJB is CMP type.
1. WSAD import all tables to ejb project even I only select one table.
2. After finish import, there is no error on rebuilding the project and generate deployment code. But there is an jndi not found exception thrown when I start the websphere test server, prompting jndiName="jdbc/Default" is not found, this name is for "defaultCMPConnectionFactory" which locate in "ibm-ejb-jar-bnd.xmi". However, there is no exception thrown if I use the same jndi name in another ejb project that contain sessionbean. Could anybody tell me how to fix this problem? Below is the error message:
[4/11/04 10:54:13:828 PDT] 3f17c56d EJBContainerI I WSVR0037I: Starting EJB jar: webspEntityBeanProject.jar
[4/11/04 10:54:14:281 PDT] 3f17c56d Helpers W NMSV0605W: A Reference object looked up from the context "java:" with the name "comp/PM/WebSphereCMPConnectionFactory" was sent to the JNDI Naming Manager and an exception resulted. Reference data follows:
Reference Factory Class Name: com.ibm.ws.naming.util.IndirectJndiLookupObjectFactory
Reference Factory Class Location URLs: <null>
Reference Class Name: java.lang.Object
Type: JndiLookupInfo
Content: JndiLookupInfo: jndiName="jdbc/Default"; providerURL=""; initialContextFactory=""
Exception data follows:
javax.naming.NameNotFoundException: Context: localhost/nodes/localhost/servers/server1, name: jdbc/Default: First component in name Default not found. Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL mg.org/CosNaming/NamingContext/NotFound:1.0
at com.ibm.ws.naming.ipcos.WsnOptimizedNamingImpl.do_resolve_complete_info(WsnOptimizedNamingImpl.java:968)
at com.ibm.ws.naming.cosbase.WsnOptimizedNamingImplBase.resolve_complete_info(WsnOptimizedNamingImplBase.java:1398)
at com.ibm.WsnOptimizedNaming._NamingContextStub.resolve_complete_info(Unknown Source)
at com.ibm.ws.naming.jndicos.CNContextImpl.cosResolve(CNContextImpl.java:3491)
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1519)
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1480)
at com.ibm.ws.naming.jndicos.CNContextImpl.lookupExt(CNContextImpl.java:1187)
at com.ibm.ws.naming.util.IndirectJndiLookupObjectFactory$1.run(IndirectJndiLookupObjectFactory.java:372)
at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:111)
at com.ibm.ws.naming.util.IndirectJndiLookupObjectFactory.getObjectInstanceExt(IndirectJndiLookupObjectFactory.java:221)
at com.ibm.ws.naming.util.Helpers.processSerializedObjectForLookupExt(Helpers.java:868)
at com.ibm.ws.naming.urlbase.UrlContextHelper.processBoundObjectForLookup(UrlContextHelper.java:152)
at com.ibm.ws.naming.java.javaURLContextRoot.processBoundObjectForLookup(javaURLContextRoot.java:397)
at com.ibm.ws.naming.urlbase.UrlContextImpl.lookup(UrlContextImpl.java:1278)
at com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:194)
at com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:135)
at javax.naming.InitialContext.lookup(InitialContext.java:360)
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(DeployedApplicationImpl.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.start(ApplicationMgrImpl.java:249)
at com.ibm.ws.runtime.component.ContainerImpl.startComponents(ContainerImpl.java:536)
at com.ibm.ws.runtime.component.ContainerImpl.start(ContainerImpl.java:413)
at com.ibm.ws.runtime.component.ApplicationServerImpl.start(ApplicationServerImpl.java:125)
at com.ibm.ws.runtime.component.ContainerImpl.startComponents(ContainerImpl.java:536)
at com.ibm.ws.runtime.component.ContainerImpl.start(ContainerImpl.java:413)
at com.ibm.ws.runtime.component.ServerImpl.start(ServerImpl.java:183)
at com.ibm.ws.runtime.WsServer.start(WsServer.java:128)
at com.ibm.ws.runtime.WsServer.main(WsServer.java:225)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:41)
at java.lang.reflect.Method.invoke(Method.java:386)
at com.ibm.ws.bootstrap.WSLauncher.main(WSLauncher.java:94)
at com.ibm.etools.websphere.tools.runner.api.ServerRunnerV5$1.run(ServerRunnerV5.java:97)

Thank you,
Raymond
 
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, did you create a Datasource named "jdbc/Default" in your test server?
Kyle
 
Raymond Ou
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Kyle,
I do not create the "jdbc/Default" datasource on test server since it is a CMP jdbc. Moreover, I have the same jndi name in another EJB project which contain a seesionbean with CMP type, and this EJB project works fine.
Thanks!
Raymond
 
Kyle Brown
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You still have to create a datasoure for your CMP's to work from. That's the reason you're getting this error if you've not created one. If your other project is running in a different server (which is possible) then that's the cause of your error -- create a datasource of the right name in the server you are using for this project, and then make sure it's marked as being used for CMP persistence.
This is all covered in my book, by the way.
Kyle
 
Raymond Ou
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, Kyle!

After create a datasource jdbc/Default on server, it works. But still can't figure out why the sessionbean can work without this datasource, on the other hand enterprisebean needs it. Anyway, thanks a lot!

Best regards,
Raymond
 
What are you doing? You are supposed to be reading this tiny ad!
Two software engineers solve most of the world's problems in one K&R sized book
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic