如何将多个SessionBean发布为WebService

04-10-19 freesjz
我在EJBModel中定义了两个Stateless SessionBean,然后新建一个WebService Configurion, 在EJB_Based Services的properties中选中两个SessionBean,编译工程,发布***.eargrp,报如下错误:

F:\JBuilder9\jdk1.4\bin\javaw -classpath F:\bea\weblogic700\server\lib\weblogic.jar;F:\bea\weblogic700\server\lib\webservices.jar;F:\bea\weblogic700\server\lib\weblogic_sp.jar; weblogic.Deployer -user system -adminurl http://dataserver:7001 -password 12345678 -deploy -name SBDBService -upload -source H:/JB_Works/SBDBService/SBDBService.ear -targets myserver

Operation started, waiting for notifications...

.

#TaskID Action Status Target Type Application Source

7 Activate Failed myserver Server SBDBService F:\bea\user_projects\mydomain\myserver\upload\SBDBService\SBDBService.ear

Exception:weblogic.management.ApplicationException: Prepare failed. Task Id = 7

Module: DBEJBModel.jar2 Error: Exception preparing module: EJBModule(DBEJBModel.jar2,status=NEW)

Unable to deploy EJB: Bean2 from DBEJBModel.jar:

The EJB container failed while creating the java:/comp/env namespace for this EJB deployment. The error was:

javax.naming.NameAlreadyBoundException: UserTransaction is already bound; remaining name 'app/ejb/DBEJBModel/jar#Bean2/comp'

at weblogic.jndi.internal.BasicNamingNode.bindHere(Ljava.lang.String;Ljava.lang.Object;Ljava.util.Hashtable;)V(BasicNamingNode.java:326)

at weblogic.jndi.internal.BasicNamingNode.bind(Ljava.lang.String;Ljava.lang.Object;Ljava.util.Hashtable;)V(BasicNamingNode.java:283)

at weblogic.jndi.internal.BasicNamingNode.bind(Ljava.lang.String;Ljava.lang.Object;Ljava.util.Hashtable;)V(BasicNamingNode.java:290)

at weblogic.jndi.internal.WLEventContextImpl.bind(Ljava.lang.String;Ljava.lang.Object;)V(WLEventContextImpl.java:279)

at weblogic.ejb20.deployer.EnvironmentBuilder.addUserTransaction()V(EnvironmentBuilder.java:685)

at weblogic.ejb20.deployer.EJBDeployer.setupEnvironmentContext(Ljavax.naming.Context;Lweblogic.ejb20.interfaces.BeanInfo;Ljava.lang.String;Ljava.lang.String;)Ljavax.naming.Context;(EJBDeployer.java:384)

at weblogic.ejb20.deployer.EJBDeployer.setupEnvironmentFor(Lweblogic.ejb20.interfaces.BeanInfo;Lweblogic.ejb20.interfaces.DeploymentInfo;Lweblogic.ejb20.internal.ComponentMBean;Ljava.lang.String;Lweblogic.management.configuration.EJBComponentMBean;Ljavax.naming.Context;)Ljavax.naming.Context;(EJBDeployer.java:1186)

at weblogic.ejb20.deployer.EJBDeployer.setupBeanInfo(Ljava.lang.String;Lweblogic.management.configuration.EJBComponentMBean;Lweblogic.management.descriptors.toplevel.EJBDescriptorMBean;Ljava.lang.ClassLoader;Ljavax.naming.Context;)V(EJBDeployer.java:1007)

at weblogic.ejb20.deployer.EJBDeployer.prepare(Lweblogic.utils.jars.VirtualJarFile;Ljava.lang.ClassLoader;Lweblogic.management.descriptors.toplevel.EJBDescriptorMBean;Ljavax.naming.Context;Ljava.util.Map;)V(EJBDeployer.java:1276)

at weblogic.ejb20.deployer.EJBModule.prepare(Ljava.lang.ClassLoader;)V(EJBModule.java:235)

at weblogic.j2ee.J2EEApplicationContainer.prepareModule(Lweblogic.utils.classloaders.GenericClassLoader;Lweblogic.j2ee.J2EEApplicationContainer$Component;[Ljava.lang.String;)V(J2EEApplicationContainer.java:1742)

at weblogic.j2ee.J2EEApplicationContainer.prepare([Lweblogic.j2ee.J2EEApplicationContainer$Component;[Ljava.lang.String;Ljava.lang.String;Lweblogic.utils.classloaders.GenericClassLoader;Ljava.lang.String;)V(J2EEApplicationContainer.java:745)

at weblogic.j2ee.J2EEApplicationContainer.prepare(Ljava.lang.String;[Lweblogic.management.configuration.ComponentMBean;[Ljava.lang.String;)V(J2EEApplicationContainer.java:601)

at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(Lweblogic.management.deploy.OamVersion;Lweblogic.management.runtime.DeploymentTaskRuntimeMBean;Z)V(SlaveDeployer.java:1116)

at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(Ljava.util.ArrayList;Z)V(SlaveDeployer.java:784)

at weblogic.drs.internal.SlaveCallbackHandler$1.execute(Lweblogic.kernel.ExecuteThread;)V(SlaveCallbackHandler.java:24)

at weblogic.kernel.ExecuteThread.execute(Lweblogic.kernel.ExecuteRequest;)V(ExecuteThread.java:251)

at weblogic.kernel.ExecuteThread.run()V(ExecuteThread.java:219)

at java.lang.Thread.startThreadFromVM(Ljava.lang.Thread;)V(Unknown Source)

我的操作有问题吗,还是有什么要注意的

猜你喜欢