2013-02-13 68 views
0

我试图从OAS 10.1.2启动JMS应用程序到BeaWebLogic 11g ,但是在定位JMS JNDI时存在一个问题。 当我开始这个异常被抛出服务器:在JDeveloper中使用JMS的JNDI 11g

 weblogic.application.ModuleException: Could not setup environment 
     at weblogic.servlet.internal.WebAppModule.activateContexts(WebAppModule.java:1495) 
     at weblogic.servlet.internal.WebAppModule.activate(WebAppModule.java:438) 
     at weblogic.application.internal.flow.ModuleStateDriver$2.next(ModuleStateDriver.java:375) 
     at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52) 
     at weblogic.application.internal.flow.ModuleStateDriver.activate(ModuleStateDriver.java:95) 
     Truncated. see log file for complete stacktrace 
    Caused By: javax.naming.NamingException: Cannot bind null object to jndi with name jms/TopicJNDI 
     at weblogic.jndi.internal.BasicNamingNode.bind(BasicNamingNode.java:311) 
     at weblogic.jndi.internal.WLEventContextImpl.bind(WLEventContextImpl.java:277) 
     at weblogic.deployment.EnvironmentBuilder.addConnectorRef(EnvironmentBuilder.java:277) 
     at weblogic.deployment.EnvironmentBuilder.addResourceReferences(EnvironmentBuilder.java:169) 
     at weblogic.servlet.internal.CompEnv.activate(CompEnv.java:138) 
     Truncated. see log file for complete stacktrace 

我在BWL控制台已映射的JNDI是JMS /主题。

我收到服务器上此错误启动:提前

 <An entity of type "ConnectionFactories" withname "Demo Topic Connection Factory" in JMS module "jmsModule" is not targeted. There is no sub-deployment with name "Demo Topic Connection Factory" in the configuration repository (config.xml), and so this entity will not exist anywhere in the domain.> 

感谢。

回答

-1

我的问题的答案是:here

这是我如何得到它的工作。

将以下行添加到weblogic.xml文件中。

<resource-description> 
<res-ref-name>MyDataSourceRefName<res-ref-name> 
<jndi-name>jdbc/MyDataSourceNameAsDefinedInWeblogic</jndi-name> 
</resource-description> 

然后将以下添加到您的web.xml文件

<resource-ref> 
<description>Some description</description> 
<res-ref-name>MyResourceRefName</res-ref-name> 
<res-type>javax.sql.Datasource</res-type> 
<res-auth>Container</res-auth> 
</resource-ref> 

我做了之后,一切运行良好。此外,如果您尝试将Spring配置为使用此数据源,请添加以下Bean。

<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean"> 
<property name="jndiName"> 
<value>MyDataSourceRefName</value> 
</property> 
</bean> 

然后使用您的数据源的合适。我希望这有帮助。