Eclipse中CMP的部署发布问题

06-04-27 xuechen0721
我创建了一个简单的CMP,是基于数据库中的一个表的。

创建过程和部署过程都很正常,但我在向应用服务器(WebSphere)发布时却出现以下报错:

[06-4-27 11:59:52:531 CST] 3e725b31 Helpers W NMSV0605W: 使用名称“comp/PM/WebSphereCMPConnectionFactory”从上下文“java:”中查找的引用对象发送到 JNDI 命名管理器并且导致异常。引用数据如下:

引用工厂类名:com.ibm.ws.naming.util.IndirectJndiLookupObjectFactory

引用工厂类位置 URL:<null>

Reference Class Name: java.lang.Object

Type: JndiLookupInfo

Content: JndiLookupInfo: jndiName="jdbc/Default"; providerURL=""; initialContextFactory=""

异常数据如下:

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:omg.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:1399)

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:398)

at com.ibm.ws.naming.urlbase.UrlContextImpl.lookup(UrlContextImpl.java:1278)

at com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:196)

at com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:137)

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:505)

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

at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:354)

at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:578)

at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:299)

at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:256)

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:128)

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:105)

at com.ibm.etools.websphere.tools.runner.api.ServerRunnerV5$1.run(ServerRunnerV5.java:97)

从报错信息中看出好像是CMP的连接初始化工厂配置有问题。由于我刚上手使用Eclipse + WebSphere(以前使用的是Jbuilder + Weblogic),但我有一个疑问:

在部署成功后发布时怎么会出现初始化工厂的问题呢?我还没有调用这个CMP啊?只是发布到WebSphere而已(相当于发布到Weblogic应用服务器),为什么会初始化环境工厂呢?以我的经验只有在发布成功后,客户端调用CMP时才会涉及到这个问题吧!

我实在弄不明白。难道这两个应用服务期在这一点上有区别?

另外,如果发布时进行初始化环境工厂,那我创建的SessionBean为什么就没有这个问题,部署发布都很正常,不知道为什么?

还请banq和各位高手指点小弟啊!问题困扰我很久了

xuechen0721
2006-04-27 16:32
还有就是报错信息中提到的:jndiName="jdbc/Default"; providerURL=""; initialContextFactory=""

URL和initialContextFactory我也不知道在哪里设置?(如果WebSphere在发布时就要进行初始化上下文工厂的话)

banq
2006-04-27 17:43
google搜索一下websphere的JNDI配置参数。

猜你喜欢