<ejb-jar>
<enterprise-beans>
<session>
<ejb-name>TimerBean</ejb-name>
<remote>ejb.generated.TimerBeanRemote</remote>
<local>ejb.generated.TimerBeanLocal</local>
<home>ejb.generated.TimerBeanHomeRemote</home>
<local-home>ejb.generated.TimerBeanHomeLocal</local-home>
<ejb-class>ejb.TimerBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<resource-ref>
<res-ref-name>tm/TimerController</res-ref-name>
<res-type>commonj.timers.TimerManager</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Unshareable</res-sharing-scope>
</resource-ref>
</session>
</enterprise-beans>
</ejb-jar>
<weblogic-ejb-jar>
<weblogic-enterprise-bean>
<ejb-name>TimerBean</ejb-name>
<local-jndi-name>TimerBeanLocal</local-jndi-name>
<jndi-name>ejb/TimerBeanRemote</jndi-name>
<dispatch-policy>ejb-workmanagement</dispatch-policy>
<reference-descriptor>
<resource-description>
<res-ref-name>tm/TimerController</res-ref-name>
<jndi-name>TimerController</jndi-name>
<res-type>commonj.timers.TimerManager</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Unshareable</res-sharing-scope>
</resource-description>
</reference-descriptor>
</weblogic-ejb-jar>
// xdocklet generated.
public abstract class TimerBean implements SessionBean {
public void ejbCreate() {
Context context = new InitialContext();
TimerManager mgr = (TimerManager) context.lookup("java:comp/env/tm/TimerController");
// ...
}
}
我已尝试查找“java:comp/env/tm/timercontroller”
,“java:/comp/env/tm/timercontroller”
,“tm/timercontroller”
...似乎没有任何工作,我总是以一个NameNotFoundException结束,总是来自整个字符串,除了java:
部分,作为剩余的名称(即它根本找不到任何东西)。
编辑我的TimerController资源似乎也不在WebLogic的jndi树页中。
edit2在使用context.list(“java:comp/env”)
列出java:comp/env
上下文中的对象之后,似乎确实忽略了资源-引用。我会进一步调查。
下面是完整的堆栈跟踪:
javax.naming.NameNotFoundException: While trying to look up comp/env/tm/TimerController in /app/ejb/my-app-ejb-1.0.0-SNAPSHOT.jar#TimerBean.; remaining name 'comp/env/tm/TimerController'
at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(BasicNamingNode.java:1139)
at weblogic.jndi.internal.ApplicationNamingNode.lookup(ApplicationNamingNode.java:144)
at weblogic.jndi.internal.WLEventContextImpl.lookup(WLEventContextImpl.java:254)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:380)
at weblogic.jndi.factories.java.ReadOnlyContextWrapper.lookup(ReadOnlyContextWrapper.java:45)
at weblogic.jndi.internal.AbstractURLContext.lookup(AbstractURLContext.java:130)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at ejb.TimerBean.ejbCreate(TimerBean.java:55)
at ejb.TimerBean_sxsqua_Impl.ejbCreate(TimerBean_sxsqua_Impl.java:162)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at weblogic.ejb.container.pool.StatelessSessionPool.createBean(StatelessSessionPool.java:205)
at weblogic.ejb.container.pool.Pool.createInitialBeans(Pool.java:300)
at weblogic.ejb.container.manager.StatelessManager.initializePool(StatelessManager.java:444)
at weblogic.ejb.container.deployer.EJBDeployer.initializePools(EJBDeployer.java:1546)
at weblogic.ejb.container.deployer.EJBDeployer.start(EJBDeployer.java:1377)
at weblogic.ejb.container.deployer.EJBModule.start(EJBModule.java:589)
at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:117)
at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)
at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:27)
at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:635)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:212)
at weblogic.application.internal.EarDeployment.activate(EarDeployment.java:16)
at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:162)
at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:79)
at weblogic.deploy.internal.targetserver.operations.AbstractOperation.activate(AbstractOperation.java:569)
at weblogic.deploy.internal.targetserver.operations.ActivateOperation.activateDeployment(ActivateOperation.java:140)
at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doCommit(ActivateOperation.java:106)
at weblogic.deploy.internal.targetserver.operations.StartOperation.doCommit(StartOperation.java:143)
at weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:323)
at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentCommit(DeploymentManager.java:820)
at weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:1227)
at weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:436)
at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java:163)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCallbackDeliverer.java:181)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$100(DeploymentReceiverCallbackDeliverer.java:12)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$2.run(DeploymentReceiverCallbackDeliverer.java:67)
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)
终于解决了!!!!
结果发现问题出在xdoclet生成中。我丢失了@ejb.resource-ref标记!现在一切正常。我甚至不再需要ejb-jar.xml和weblogic-ejb-jar.xml了。
下面是完整的工作bean:
/**
* @ejb.bean
* name="TimerBean"
* jndi, home, remote config
* @ejb.resource-ref
* res-ref-name="TimerController"
* res-type="commonj.timers.TimerManager"
* res-auth="Container"
* res-sharing-scope="Shareable"
*/
public abstract class TimerBean implements SessionBean {
public void ejbCreate() {
Context context = new InitialContext();
TimerManager mgr = (TimerManager) context.lookup("java:comp/env/TimerController");
// ...
}
}
在weblogic上部署webapp时,我遇到了以下错误: 有人能告诉我调试这个的方法吗。
我尝试将消息放入WebLogic server的JMS队列中。我的应用程序正在Wildfly 8 AS中运行。我已经编写了JNDI查找的代码,然后将消息放入JMS队列。我使用下面的代码来初始化InitialContext: 我为添加WebLogic jar添加了以下Maven依赖项 但是,maven 依赖关系并未得到解决。我是否需要添加任何 maven 存储库? 如果还需要什么,有人能指导我吗?
我得到一个javax。命名。NameNotFoundException:在尝试查找EJB3无状态会话bean时。 我有一个weblogic域,它包括两个服务器Server_1和server_2。我已经将一个EAR文件部署到server_2其中包含一个EJB3部署。它里面有以下内容 EJB3模块jar文件包括以下内容 在服务器1上,我部署了EJB3客户机Jar,其中包含我的远程接口。在这个服务器上,
我有一个可运行的jar文件,无法访问位于默认src目录之外的资源。根据我的理解,这两门课的区别是什么。getResource()和ClassLoader。getResource(),我应该能够访问root/res/img/img1。png(请参阅下面的文件夹设置),方法是使用以下getResourceFile函数: 文件夹设置: 当我尝试执行jar可执行文件本身时,问题就出现了。然而,奇怪的是,我
我的EJB3类和远程接口如下: 远程接口: 无状态ejb: 项目在weblogic中成功部署为jar文件。我开发了一个独立的客户端来调用ejb。但这失败了。请帮忙。我已经包含了所有连接到jndi和远程业务接口的weblogic服务器库以进行编译。 客户端代码: 但是我得到这个例外: javax.name.CommunicationException [Root exception is java.
我试图在weblogic Server12.1.3中运行Spring Boot应用程序,但遇到以下错误 BlockQuoteWebLogic.Application.ModuleException:java.lang.NoSuchMethoderRorr:org.springframework.core.Annotation.AnnotationawareOrderComparator.sort(