我正在使用Jboss-6.1.0。我正在尝试创建一个EJB来打印Hello world。我有三个classess。 1。
package remoteif;
import java.rmi.*;
import javax.ejb.*;
public interface HelloWorld extends EJBObject{
public String sayHello() throws RemoteException;
}
2
package homeif;
import remoteif.HelloWorld;
import javax.ejb.CreateException;
import javax.ejb.EJBHome;
import java.rmi.RemoteException;
public interface HelloWorldHome extends EJBHome {
public HelloWorld create() throws
CreateException, RemoteException;
}
和 3。 package beanimpl;
import remoteif.HelloWorld;
import javax.ejb.*;
import java.rmi.RemoteException;
public class HelloWorldBean implements SessionBean {
// Methods of Remote interface
public String sayHello() {
return "Hello, world !";
}
// Methods of Home interface
public void ejbCreate() {}
protected SessionContext ctx;
public void setSessionContext(SessionContext ctx) {
this.ctx = ctx;
}
@Override
public void ejbRemove() throws EJBException, RemoteException {
//To change body of implemented methods use File | Settings | File Templates.
}
@Override
public void ejbActivate() throws EJBException, RemoteException {
//To change body of implemented methods use File | Settings | File Templates.
}
@Override
public void ejbPassivate() throws EJBException, RemoteException {
//To change body of implemented methods use File | Settings | File Templates.
}
}
我在META-INF目录中使用两个xml文件ejb-jat.xml& jonas-ejb-jar.xml。我已创建此应用程序的jar文件(包括类文件和xml文件)和包含此jar文件和application.xml文件的ear文件。我已将其复制到JBOSS服务器中。但是当我启动服务器时,我收到以下错误。
ERROR [AbstractKernelController] Error installing to Real: name=vfs:///data/EJB/jboss-6.1.0.Final/server/wsdl/deploy/EjbSample.ear state=PreReal mode=Manual requiredState=Real: org.jboss.deployers.spi.DeploymentException: Error during deploy: vfs:///data/EJB/jboss-6.1.0.Final/server/wsdl/deploy/EjbSample.ear/ejbDemo.jar/ at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49) [:2.2.2.GA] at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:185) [:2.2.2.GA] at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1832) [:2.2.2.GA] at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1550) [:2.2.2.GA] at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1603) [:2.2.2.GA] at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1491) [:2.2.2.GA] at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:379) [jboss-dependency.jar:2.2.0.SP2] at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2044) [jboss-dependency.jar:2.2.0.SP2] at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1083) [jboss-dependency.jar:2.2.0.SP2] at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1322) [jboss-dependency.jar:2.2.0.SP2] at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1246) [jboss-dependency.jar:2.2.0.SP2] at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1139) [jboss-dependency.jar:2.2.0.SP2] at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:939) [jboss-dependency.jar:2.2.0.SP2] at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:654) [jboss-dependency.jar:2.2.0.SP2] at org.jboss.deployers.plugins.deployers.DeployersImpl.change(DeployersImpl.java:1983) [:2.2.2.GA] at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:1076) [:2.2.2.GA] at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:679) [:2.2.2.GA] at org.jboss.system.server.profileservice.deployers.MainDeployerPlugin.process(MainDeployerPlugin.java:106) [:6.1.0.Final] at org.jboss.profileservice.dependency.ProfileControllerContext$DelegateDeployer.process(ProfileControllerContext.java:143) [:0.2.2] at org.jboss.profileservice.dependency.ProfileDeployAction.deploy(ProfileDeployAction.java:151) [:0.2.2] at org.jboss.profileservice.dependency.ProfileDeployAction.installActionInternal(ProfileDeployAction.java:94) [:0.2.2] at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54) [jboss-kernel.jar:2.2.0.SP2] at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42) [jboss-kernel.jar:2.2.0.SP2] at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62) [jboss-dependency.jar:2.2.0.SP2] at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71) [jboss-dependency.jar:2.2.0.SP2] at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51) [jboss-dependency.jar:2.2.0.SP2] at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:379) [jboss-dependency.jar:2.2.0.SP2] at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2044) [jboss-dependency.jar:2.2.0.SP2] at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1083) [jboss-dependency.jar:2.2.0.SP2] at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1322) [jboss-dependency.jar:2.2.0.SP2] at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1246) [jboss-dependency.jar:2.2.0.SP2] at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1139) [jboss-dependency.jar:2.2.0.SP2] at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:939) [jboss-dependency.jar:2.2.0.SP2] at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:654) [jboss-dependency.jar:2.2.0.SP2] at org.jboss.profileservice.dependency.ProfileActivationWrapper$BasicProfileActivation.start(ProfileActivationWrapper.java:190) [:0.2.2] at org.jboss.profileservice.dependency.ProfileActivationWrapper.start(ProfileActivationWrapper.java:87) [:0.2.2] at org.jboss.profileservice.dependency.ProfileActivationService.activateProfile(ProfileActivationService.java:215) [:0.2.2] at org.jboss.profileservice.dependency.ProfileActivationService.activate(ProfileActivationService.java:159) [:0.2.2] at org.jboss.profileservice.bootstrap.AbstractProfileServiceBootstrap.activate(AbstractProfileServiceBootstrap.java:112) [:0.2.2] at org.jboss.profileservice.resolver.BasicResolverFactory$ProfileResolverFacade.deploy(BasicResolverFactory.java:87) [:0.2.2] at org.jboss.profileservice.bootstrap.AbstractProfileServiceBootstrap.start(AbstractProfileServiceBootstrap.java:91) [:0.2.2] at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:132) [:6.1.0.Final] at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:56) [:6.1.0.Final] at org.jboss.bootstrap.impl.base.server.AbstractServer.startBootstraps(AbstractServer.java:827) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-6] at org.jboss.bootstrap.impl.base.server.AbstractServer$StartServerTask.run(AbstractServer.java:417) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-6] at java.lang.Thread.run(Thread.java:662) [:1.6.0_45] Caused by: java.lang.RuntimeException: Failed to load component class: HelloWorldBean from loader: BaseClassLoader@192c07a{vfs:///data/EJB/jboss-6.1.0.Final/server/wsdl/deploy/EjbSample.ear} at org.jboss.webservices.integration.deployers.WSEJBAdapterDeployer$WebServiceDeclarationAdapter.getComponentClass(WSEJBAdapterDeployer.java:232) [:6.1.0.Final] at org.jboss.webservices.integration.deployers.WSEJBAdapterDeployer$WebServiceDeclarationAdapter.getAnnotation(WSEJBAdapterDeployer.java:214) [:6.1.0.Final] at org.jboss.webservices.integration.util.ASHelper.isWebServiceBean(ASHelper.java:239) [:6.1.0.Final] at org.jboss.webservices.integration.util.ASHelper.getJaxwsEjbs(ASHelper.java:222) [:6.1.0.Final] at org.jboss.webservices.integration.deployers.WSTypeDeployer.isJaxwsEjbDeployment(WSTypeDeployer.java:140) [:6.1.0.Final] at org.jboss.webservices.integration.deployers.WSTypeDeployer.internalDeploy(WSTypeDeployer.java:73) [:6.1.0.Final] at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:55) [:2.2.2.GA] at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:179) [:2.2.2.GA] ... 44 more 08:47:08,518 INFO [HornetQServerImpl] trying to deploy queue jms.queue.DLQ 08:47:08,667 INFO [HornetQServerImpl] trying to deploy queue jms.queue.ExpiryQueue 08:47:08,696 INFO [service] Removing bootstrap log handlers 08:47:08,791 ERROR [ProfileServiceBootstrap] Failed to load profile:: org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS): DEPLOYMENTS IN ERROR: Deployment "vfs:///data/EJB/jboss-6.1.0.Final/server/wsdl/deploy/EjbSample.ear" is in error due to the following reason(s): java.lang.RuntimeException: Failed to load component class: HelloWorldBean from loader: BaseClassLoader@192c07a{vfs:///data/EJB/jboss-6.1.0.Final/server/wsdl/deploy/EjbSample.ear} at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:1228) [:2.2.2.GA] at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:905) [:2.2.2.GA] at org.jboss.system.server.profileservice.deployers.MainDeployerPlugin.checkComplete(MainDeployerPlugin.java:87) [:6.1.0.Final] at org.jboss.profileservice.deployment.ProfileDeployerPluginRegistry.checkAllComplete(ProfileDeployerPluginRegistry.java:107) [:0.2.2] at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:135) [:6.1.0.Final] at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:56) [:6.1.0.Final] at org.jboss.bootstrap.impl.base.server.AbstractServer.startBootstraps(AbstractServer.java:827) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-6] at org.jboss.bootstrap.impl.base.server.AbstractServer$StartServerTask.run(AbstractServer.java:417) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-6] at java.lang.Thread.run(Thread.java:662) [:1.6.0_45]
我该怎么做才能清除此错误?