如何将EJB应用程序部署到Glassfish服务器

时间:2012-12-17 17:52:26

标签: java jsp glassfish ejb

当我运行JSP文件时,我收到此错误:

SEVERE: Exception while loading the app
java.lang.RuntimeException: EJB Container initialization error
    at org.glassfish.ejb.startup.EjbApplication.loadContainers(EjbApplication.java:219)
    at org.glassfish.ejb.startup.EjbDeployer.load(EjbDeployer.java:197)
    at org.glassfish.ejb.startup.EjbDeployer.load(EjbDeployer.java:63)
    at org.glassfish.internal.data.ModuleInfo.load(ModuleInfo.java:175)
    at org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:216)
    at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:338)
    at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:183)
    at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:272)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:310)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:320)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1176)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$900(CommandRunnerImpl.java:83)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1235)
    at org.glassfish.deployment.autodeploy.AutoOperation.run(AutoOperation.java:141)
    at org.glassfish.deployment.autodeploy.AutoDeployer.deploy(AutoDeployer.java:573)
    at org.glassfish.deployment.autodeploy.AutoDeployer.deployAll(AutoDeployer.java:459)
    at org.glassfish.deployment.autodeploy.AutoDeployer.run(AutoDeployer.java:391)
    at org.glassfish.deployment.autodeploy.AutoDeployer.run(AutoDeployer.java:376)
    at org.glassfish.deployment.autodeploy.AutoDeployService$1.run(AutoDeployService.java:195)
    at java.util.TimerThread.mainLoop(Timer.java:512)
    at java.util.TimerThread.run(Timer.java:462)
Caused by: java.lang.RuntimeException: Error while binding JNDI name ejbExample.stateful.Account#ejbExample.stateful.Account for EJB : AccountBean
    at com.sun.ejb.containers.BaseContainer.initializeHome(BaseContainer.java:1530)
    at com.sun.ejb.containers.StatefulSessionContainer.initializeHome(StatefulSessionContainer.java:214)
    at com.sun.ejb.containers.ContainerFactoryImpl.createContainer(ContainerFactoryImpl.java:161)
    at org.glassfish.ejb.startup.EjbApplication.loadContainers(EjbApplication.java:207)
    ... 20 more
Caused by: javax.naming.NameAlreadyBoundException: Use rebind to override
    at com.sun.enterprise.naming.impl.TransientContext.doBindOrRebind(TransientContext.java:275)
    at com.sun.enterprise.naming.impl.TransientContext.bind(TransientContext.java:214)
    at com.sun.enterprise.naming.impl.SerialContextProviderImpl.bind(SerialContextProviderImpl.java:79)
    at com.sun.enterprise.naming.impl.LocalSerialContextProviderImpl.bind(LocalSerialContextProviderImpl.java:81)
    at com.sun.enterprise.naming.impl.SerialContext.bind(SerialContext.java:586)
    at com.sun.enterprise.naming.impl.SerialContext.bind(SerialContext.java:602)
    at javax.naming.InitialContext.bind(InitialContext.java:404)
    at com.sun.enterprise.naming.impl.GlassfishNamingManagerImpl.publishObject(GlassfishNamingManagerImpl.java:206)
    at com.sun.enterprise.naming.impl.GlassfishNamingManagerImpl.publishObject(GlassfishNamingManagerImpl.java:187)
    at com.sun.ejb.containers.BaseContainer$JndiInfo.publish(BaseContainer.java:5533)
    at com.sun.ejb.containers.BaseContainer.initializeHome(BaseContainer.java:1515)
    ... 23 more

WARNING: [AutoDeploy] Autodeploy failed : C:\glassfishv3\glassfish\domains\domain1\autodeploy\StatefullSessionBeanExample.jar.

这是如何引起的?如何解决?

1 个答案:

答案 0 :(得分:0)

尝试取消部署项目(清理和构建)并重新部署。