Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/304.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java ejb归档jar中循环依赖的无状态bean未部署在JBoss 5.1.0上_Java_Jakarta Ee_Jboss7.x_Jboss5.x - Fatal编程技术网

Java ejb归档jar中循环依赖的无状态bean未部署在JBoss 5.1.0上

Java ejb归档jar中循环依赖的无状态bean未部署在JBoss 5.1.0上,java,jakarta-ee,jboss7.x,jboss5.x,Java,Jakarta Ee,Jboss7.x,Jboss5.x,我创建了一个EJB项目,其中包含以下java文件。 它没有部署在JBoss 5.1.0上,并抛出了部署错误,该错误附加在下面的java代码之后。但JBoss上部署的jar与7.1相同。 为什么jar没有部署在JBoss5.1上 请注意,bean实现BeanA具有-a BeanB的本地接口,BeanB的bean实现具有-a BeanA的本地接口,因此这是一个循环 BeanALocalInterface.java package com.xyz; import javax.ejb.Local

我创建了一个EJB项目,其中包含以下java文件。 它没有部署在JBoss 5.1.0上,并抛出了部署错误,该错误附加在下面的java代码之后。但JBoss上部署的jar与7.1相同。 为什么jar没有部署在JBoss5.1上

请注意,bean实现BeanA具有-a BeanB的本地接口,BeanB的bean实现具有-a BeanA的本地接口,因此这是一个循环

BeanALocalInterface.java

package com.xyz;    
import javax.ejb.Local;    
    @Local    
public interface BeanALocalInterface {
    public void executeLocal();
}
package com.xyz;
import javax.ejb.EJB;
import javax.ejb.Stateless;
@Stateless
public class BeanA implements  BeanALocalInterface {
    @EJB    private BeanBLocalInterface beanBLocalInterface;
    public BeanA() {}
    public void executeLocal() {System.out.println("executing in  BeanA"); beanBLocalInterface.executeLocal();}
    public void executeRemote() {System.out.println("executing in  BeanA"); }
}
package com.xyz;
import javax.ejb.Local;
@Local
public interface BeanBLocalInterface {
    public void executeLocal();
}
package com.xyz;
import javax.ejb.EJB;
import javax.ejb.Stateless;
@Stateless
public class BeanB  implements BeanBLocalInterface  {
    @EJB private BeanALocalInterface localInterface;
    public BeanB() {  }
    public void executeLocal() { localInterface.executeLocal(); }
    public void executeRemote() { System.out.println("executing in  BeanB");}
}
BeanA.java

package com.xyz;    
import javax.ejb.Local;    
    @Local    
public interface BeanALocalInterface {
    public void executeLocal();
}
package com.xyz;
import javax.ejb.EJB;
import javax.ejb.Stateless;
@Stateless
public class BeanA implements  BeanALocalInterface {
    @EJB    private BeanBLocalInterface beanBLocalInterface;
    public BeanA() {}
    public void executeLocal() {System.out.println("executing in  BeanA"); beanBLocalInterface.executeLocal();}
    public void executeRemote() {System.out.println("executing in  BeanA"); }
}
package com.xyz;
import javax.ejb.Local;
@Local
public interface BeanBLocalInterface {
    public void executeLocal();
}
package com.xyz;
import javax.ejb.EJB;
import javax.ejb.Stateless;
@Stateless
public class BeanB  implements BeanBLocalInterface  {
    @EJB private BeanALocalInterface localInterface;
    public BeanB() {  }
    public void executeLocal() { localInterface.executeLocal(); }
    public void executeRemote() { System.out.println("executing in  BeanB");}
}
BeanLocalInterface.java

package com.xyz;    
import javax.ejb.Local;    
    @Local    
public interface BeanALocalInterface {
    public void executeLocal();
}
package com.xyz;
import javax.ejb.EJB;
import javax.ejb.Stateless;
@Stateless
public class BeanA implements  BeanALocalInterface {
    @EJB    private BeanBLocalInterface beanBLocalInterface;
    public BeanA() {}
    public void executeLocal() {System.out.println("executing in  BeanA"); beanBLocalInterface.executeLocal();}
    public void executeRemote() {System.out.println("executing in  BeanA"); }
}
package com.xyz;
import javax.ejb.Local;
@Local
public interface BeanBLocalInterface {
    public void executeLocal();
}
package com.xyz;
import javax.ejb.EJB;
import javax.ejb.Stateless;
@Stateless
public class BeanB  implements BeanBLocalInterface  {
    @EJB private BeanALocalInterface localInterface;
    public BeanB() {  }
    public void executeLocal() { localInterface.executeLocal(); }
    public void executeRemote() { System.out.println("executing in  BeanB");}
}
BeanB.java

package com.xyz;    
import javax.ejb.Local;    
    @Local    
public interface BeanALocalInterface {
    public void executeLocal();
}
package com.xyz;
import javax.ejb.EJB;
import javax.ejb.Stateless;
@Stateless
public class BeanA implements  BeanALocalInterface {
    @EJB    private BeanBLocalInterface beanBLocalInterface;
    public BeanA() {}
    public void executeLocal() {System.out.println("executing in  BeanA"); beanBLocalInterface.executeLocal();}
    public void executeRemote() {System.out.println("executing in  BeanA"); }
}
package com.xyz;
import javax.ejb.Local;
@Local
public interface BeanBLocalInterface {
    public void executeLocal();
}
package com.xyz;
import javax.ejb.EJB;
import javax.ejb.Stateless;
@Stateless
public class BeanB  implements BeanBLocalInterface  {
    @EJB private BeanALocalInterface localInterface;
    public BeanB() {  }
    public void executeLocal() { localInterface.executeLocal(); }
    public void executeRemote() { System.out.println("executing in  BeanB");}
}
在JBOSS 5.1.0中部署CyclicalBeans.jar时的错误日志

11:59:31,557 INFO  [JBossASKernel] Created KernelDeployment for: CyclicalBeans.jar
11:59:31,557 INFO  [JBossASKernel] installing bean: jboss.j2ee:jar=CyclicalBeans.jar,name=BeanA,service=EJB3
11:59:31,557 INFO  [JBossASKernel]   with dependencies:
11:59:31,557 INFO  [JBossASKernel]   and demands:
11:59:31,573 INFO  [JBossASKernel]      jndi:BeanB/local-com.xyz.BeanBLocalInterface
11:59:31,573 INFO  [JBossASKernel]      jboss.ejb:service=EJBTimerService
11:59:31,573 INFO  [JBossASKernel]   and supplies:
11:59:31,573 INFO  [JBossASKernel]      jndi:BeanA/local-com.xyz.BeanALocalInterface
11:59:31,588 INFO  [JBossASKernel]      jndi:BeanA/local
11:59:31,588 INFO  [JBossASKernel]      Class:com.xyz.BeanARemoteInterface
11:59:31,588 INFO  [JBossASKernel]      jndi:BeanA/remote-com.xyz.BeanARemoteInterface
11:59:31,588 INFO  [JBossASKernel]      Class:com.xyz.BeanALocalInterface
11:59:31,604 INFO  [JBossASKernel]      jndi:BeanA/remote
11:59:31,604 INFO  [JBossASKernel] Added bean(jboss.j2ee:jar=CyclicalBeans.jar,name=BeanA,service=EJB3) to KernelDeployment of: CyclicalBeans.jar
11:59:31,604 INFO  [JBossASKernel] installing bean: jboss.j2ee:jar=CyclicalBeans.jar,name=BeanB,service=EJB3
11:59:31,619 INFO  [JBossASKernel]   with dependencies:
11:59:31,619 INFO  [JBossASKernel]   and demands:
11:59:31,619 INFO  [JBossASKernel]      jboss.ejb:service=EJBTimerService
11:59:31,635 INFO  [JBossASKernel]      jndi:BeanA/local-com.xyz.BeanALocalInterface
11:59:31,635 INFO  [JBossASKernel]   and supplies:
11:59:31,635 INFO  [JBossASKernel]      Class:com.xyz.BeanBLocalInterface
11:59:31,635 INFO  [JBossASKernel]      jndi:BeanB/local-com.xyz.BeanBLocalInterface
11:59:31,651 INFO  [JBossASKernel]      jndi:BeanB/local
11:59:31,651 INFO  [JBossASKernel]      jndi:BeanB/remote
11:59:31,666 INFO  [JBossASKernel] Added bean(jboss.j2ee:jar=CyclicalBeans.jar,name=BeanB,service=EJB3) to KernelDeployment of: CyclicalBeans.jar
11:59:31,666 INFO  [EJB3EndpointDeployer] Deploy AbstractBeanMetaData@68f7b23c{name=jboss.j2ee:jar=CyclicalBeans.jar,name=BeanA,service=EJB3_endpoint bean=org.jboss.ejb3.endpoint.deployers.impl.EndpointImpl properties=[container] constructor=null autowireCandidate=true}
11:59:31,666 INFO  [EJB3EndpointDeployer] Deploy AbstractBeanMetaData@3b870737{name=jboss.j2ee:jar=CyclicalBeans.jar,name=BeanB,service=EJB3_endpoint bean=org.jboss.ejb3.endpoint.deployers.impl.EndpointImpl properties=[container] constructor=null autowireCandidate=true}
11:59:31,744 WARN  [HDScanner] Failed to process changes
org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):

DEPLOYMENTS MISSING DEPENDENCIES:
  Deployment "jboss.j2ee:jar=CyclicalBeans.jar,name=BeanA,service=EJB3" is missing the following dependencies:
    Dependency "<UNKNOWN jboss.j2ee:jar=CyclicalBeans.jar,name=BeanA,service=EJB3>" (should be in state "Described", but is actually in state "** UNRESOLVED Demands 'jndi:BeanB/local-com.xyz.BeanBLocalInterface' **")
  Deployment "jboss.j2ee:jar=CyclicalBeans.jar,name=BeanA,service=EJB3_endpoint" is missing the following dependencies:
    Dependency "jboss.j2ee:jar=CyclicalBeans.jar,name=BeanA,service=EJB3" (should be in state "Configured", but is actually in state "PreInstall")
  Deployment "jboss.j2ee:jar=CyclicalBeans.jar,name=BeanB,service=EJB3" is missing the following dependencies:
    Dependency "<UNKNOWN jboss.j2ee:jar=CyclicalBeans.jar,name=BeanB,service=EJB3>" (should be in state "Described", but is actually in state "** UNRESOLVED Demands 'jndi:BeanA/local-com.xyz.BeanALocalInterface' **")
  Deployment "jboss.j2ee:jar=CyclicalBeans.jar,name=BeanB,service=EJB3_endpoint" is missing the following dependencies:
    Dependency "jboss.j2ee:jar=CyclicalBeans.jar,name=BeanB,service=EJB3" (should be in state "Configured", but is actually in state "PreInstall")

DEPLOYMENTS IN ERROR:
  Deployment "<UNKNOWN jboss.j2ee:jar=CyclicalBeans.jar,name=BeanA,service=EJB3>" is in error due to the following reason(s): ** UNRESOLVED Demands 'jndi:BeanB/local-com.xyz.BeanBLocalInterface' **
  Deployment "<UNKNOWN jboss.j2ee:jar=CyclicalBeans.jar,name=BeanB,service=EJB3>" is in error due to the following reason(s): ** UNRESOLVED Demands 'jndi:BeanA/local-com.xyz.BeanALocalInterface' **

        at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:993)
        at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:939)
        at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:873)
        at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.checkComplete(MainDeployerAdapter.java:128)
        at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:369)
        at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:255)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
        at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:180)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:204)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
        at java.lang.Thread.run(Thread.java:662)
11:59:31557信息[JBossASKernel]为:CyclicalBeans.jar创建了KernelDeployment
11:59:31557信息[JBossASKernel]安装bean:jboss.j2ee:jar=CyclicalBeans.jar,name=BeanA,service=EJB3
11:59:31557信息[JBossASKernel]与依赖项:
11:59:31557信息[JBossASKernel]和要求:
11:59:31573信息[JBossASKernel]jndi:BeanB/local-com.xyz.BeanBLocalInterface
11:59:31573信息[JBossASKernel]jboss.ejb:service=EJBTimerService
11:59:31573信息[JBossASKernel]和供应:
11:59:31573信息[JBossASKernel]jndi:BeanA/local-com.xyz.BeanALocalInterface
11:59:31588信息[JBossASKernel]jndi:BeanA/local
11:59:31588信息[JBossASKernel]类:com.xyz.BeanARemoteInterface
11:59:31588信息[JBossASKernel]jndi:BeanA/remote-com.xyz.BeanARemoteInterface
11:59:31588信息[JBossASKernel]类:com.xyz.BeanALocalInterface
11:59:31604信息[JBossASKernel]jndi:BeanA/remote
11:59:31604信息[JBossASKernel]将bean(jboss.j2ee:jar=CyclicalBeans.jar,name=BeanA,service=EJB3)添加到内核部署:CyclicalBeans.jar
11:59:31604信息[JBossASKernel]安装bean:jboss.j2ee:jar=CyclicalBeans.jar,name=BeanB,service=EJB3
11:59:31619信息[JBossASKernel]与依赖项:
11:59:31619信息[JBossASKernel]和要求:
11:59:31619信息[JBossASKernel]jboss.ejb:service=EJBTimerService
11:59:31635信息[JBossASKernel]jndi:BeanA/local-com.xyz.BeanALocalInterface
11:59:31635信息[JBossASKernel]和供应:
11:59:31635信息[JBossASKernel]类:com.xyz.beanLocalInterface
11:59:31635信息[JBossASKernel]jndi:BeanB/local-com.xyz.BeanBLocalInterface
11:59:31651信息[JBossASKernel]jndi:BeanB/local
11:59:31651信息[JBossASKernel]jndi:BeanB/remote
11:59:31666信息[JBossASKernel]将bean(jboss.j2ee:jar=CyclicalBeans.jar,name=BeanB,service=EJB3)添加到内核部署:CyclicalBeans.jar
11:59:31666信息[EJB3EndpointDeployer]部署AbstractBeanMetaData@68f7b23c{name=jboss.j2ee:jar=CyclicalBeans.jar,name=BeanA,service=EJB3_endpoint bean=org.jboss.EJB3.endpoint.deployers.impl.EndpointImpl properties=[container]constructor=null autowirestander=true}
11:59:31666信息[EJB3EndpointDeployer]部署AbstractBeanMetaData@3b870737{name=jboss.j2ee:jar=CyclicalBeans.jar,name=BeanB,service=EJB3_endpoint bean=org.jboss.EJB3.endpoint.deployers.impl.EndpointImpl properties=[container]constructor=null autowirestander=true}
11:59:31744警告[HDScanner]无法处理更改
org.jboss.deployers.client.spi.IncompletedDeploymentException:未完成部署的摘要(有关详细信息,请参阅以前的错误):
部署缺少依赖项:
部署“jboss.j2ee:jar=CyclicalBeans.jar,name=BeanA,service=EJB3”缺少以下依赖项:
依赖项“”(应处于“已描述”状态,但实际处于“**未解决的需求'jndi:BeanB/local com.xyz.BeanBLocalInterface'**”状态)
部署“jboss.j2ee:jar=CyclicalBeans.jar,name=BeanA,service=EJB3_endpoint”缺少以下依赖项:
依赖项“jboss.j2ee:jar=CyclicalBeans.jar,name=BeanA,service=EJB3”(应处于“已配置”状态,但实际上处于“预安装”状态)
部署“jboss.j2ee:jar=CyclicalBeans.jar,name=BeanB,service=EJB3”缺少以下依赖项:
依赖项“”(应处于“已描述”状态,但实际处于“**未解决的需求'jndi:BeanA/local com.xyz.BeanALocalInterface'**”状态)
部署“jboss.j2ee:jar=CyclicalBeans.jar,name=BeanB,service=EJB3\u endpoint”缺少以下依赖项:
依赖项“jboss.j2ee:jar=CyclicalBeans.jar,name=BeanB,service=EJB3”(应处于“已配置”状态,但实际上处于“预安装”状态)
错误的部署:
由于以下原因,部署“”出错:**未解决的需求'jndi:BeanB/local com.xyz.BeanBLocalInterface'**
由于以下原因,部署“”出错:**未解决的需求'jndi:BeanA/local com.xyz.BeanALocalInterface'**
位于org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:993)
位于org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:939)
位于org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:873)
位于org.jboss.system.server.profileservice.repository.MainDeployerAdapter.checkComplete(MainDeployerAdapter.java:128)
位于org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:369)
位于org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:255)
位于java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
位于java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
位于java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
位于java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
位于java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:180)
在java.util.concurr