You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by pbuchheit <pb...@tura.com> on 2009/08/10 19:57:07 UTC

NameAlreadyBoundException When Running From JUnit

We have an existing application deployed to a JBoss server. I'm trying to use
Openejb 3.1.1 to do unit testing on a stateless session bean that contains
our services. I added code to my unit test to initialize the context as
shown in the examples, but whenever I try to run the JUnit test I get the
following console output:

Apache OpenEJB 3.1.1    build: 20090530-06:18
http://openejb.apache.org/
INFO - openejb.home = my eclipse workspace path/myApp
INFO - openejb.base = my eclipse workspace path/myApp
INFO - Configuring Service(id=Default Security Service,
type=SecurityService, provider-id=Default Security Service)
INFO - Configuring Service(id=Default Transaction Manager,
type=TransactionManager, provider-id=Default Transaction Manager)
INFO - Found ClientModule in classpath:
/usr/local/dst/jboss/4.2.2.GA/server/lib/jboss-remoting.jar
INFO - Found ClientModule in classpath:
/usr/local/dst/jboss/4.2.2.GA/server/lib/jboss-cache-jdk50.jar
INFO - Found ClientModule in classpath:
/usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbossesb.sar/lib/milyn-smooks-ejc-1.2.1.jar
INFO - Found ClientModule in classpath:
/home/pbuchheit/workspace.galileo/insight-lib/jbossesb-rosetta.jar
INFO - Found ClientModule in classpath:
/usr/local/dst/jboss/4.2.2.GA/server/lib/javassist.jar
INFO - Found ClientModule in classpath:
/usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbossesb.sar/lib/jbossesb-config-model-1.0.1.jar
INFO - Found ClientModule in classpath:
/usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbrules.esb/core-3.2.3.v_686_R32x.jar
INFO - Found ClientModule in classpath:
/usr/local/dst/jboss/4.2.2.GA/server/lib/jtds-1.2.jar
INFO - Found ClientModule in classpath:
/usr/local/dst/jboss/4.2.2.GA/server/lib/bsh.jar
INFO - Found ClientModule in classpath:
/usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/soap.esb/jaxb-xjc-2.1.4.jar
INFO - Found ClientModule in classpath:
/usr/local/dst/jboss/4.2.2.GA/server/esb/lib/h2-1.0.68.jar
INFO - Found ClientModule in classpath:
/usr/local/etc/openejb-3.1.1/lib/xml-resolver-1.2.jar
INFO - Found ClientModule in classpath:
/usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbossesb.sar/lib/mvel-1.3.3-java1.5.jar
INFO - Found ClientModule in classpath:
/usr/local/dst/jboss/4.2.2.GA/lib/endorsed/serializer.jar
INFO - Found ClientModule in classpath:
/usr/local/dst/jboss/4.2.2.GA/server/dev/deploy/jboss-bean.deployer/jboss-microcontainer.jar
INFO - Found ClientModule in classpath:
/usr/local/dst/jboss/4.2.2.GA/server/lib/jgroups.jar
INFO - Found ClientModule in classpath:
/usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbossesb.sar/lib/jbossesb-rosetta.jar
INFO - Found ClientModule in classpath:
/usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbossesb.sar/lib/freemarker-2.3.11.jar
INFO - Found ClientModule in classpath:
/usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbossesb.sar/lib/mvel2-2.0.12.jar
INFO - Found ClientModule in classpath:
/usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbossesb.sar/lib/jbossesb-config-model-1.1.0.jar
INFO - Found ClientModule in classpath:
/usr/local/dst/jboss/4.2.2.GA/lib/endorsed/xalan.jar
INFO - Found ClientModule in classpath:
/usr/local/dst/jboss/4.2.2.GA/server/lib/jboss-serialization.jar
INFO - Found ClientModule in classpath:
/usr/local/dst/jboss/4.2.2.GA/server/lib/iText-2.1.6.jar
INFO - Found ClientModule in classpath:
/usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbrules.esb/jxl-2.4.2.jar
INFO - Beginning load:
/usr/local/dst/jboss/4.2.2.GA/server/lib/jboss-remoting.jar
INFO - Beginning load:
/usr/local/dst/jboss/4.2.2.GA/server/lib/jboss-cache-jdk50.jar
INFO - Beginning load:
/usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbossesb.sar/lib/milyn-smooks-ejc-1.2.1.jar
INFO - Beginning load:
/home/pbuchheit/workspace.galileo/insight-lib/jbossesb-rosetta.jar
INFO - Beginning load:
/usr/local/dst/jboss/4.2.2.GA/server/lib/javassist.jar
INFO - Beginning load:
/usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbossesb.sar/lib/jbossesb-config-model-1.0.1.jar
INFO - Beginning load:
/usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbrules.esb/core-3.2.3.v_686_R32x.jar
INFO - Beginning load: /usr/local/dst/jboss/4.2.2.GA/server/lib/jtds-1.2.jar
INFO - Beginning load: /usr/local/dst/jboss/4.2.2.GA/server/lib/bsh.jar
INFO - Beginning load:
/usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/soap.esb/jaxb-xjc-2.1.4.jar
INFO - Beginning load:
/usr/local/dst/jboss/4.2.2.GA/server/esb/lib/h2-1.0.68.jar
INFO - Beginning load: /usr/local/etc/openejb-3.1.1/lib/xml-resolver-1.2.jar
INFO - Beginning load:
/usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbossesb.sar/lib/mvel-1.3.3-java1.5.jar
INFO - Beginning load:
/usr/local/dst/jboss/4.2.2.GA/lib/endorsed/serializer.jar
INFO - Beginning load:
/usr/local/dst/jboss/4.2.2.GA/server/dev/deploy/jboss-bean.deployer/jboss-microcontainer.jar
INFO - Beginning load: /usr/local/dst/jboss/4.2.2.GA/server/lib/jgroups.jar
INFO - Beginning load:
/usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbossesb.sar/lib/jbossesb-rosetta.jar
INFO - Beginning load:
/usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbossesb.sar/lib/freemarker-2.3.11.jar
INFO - Beginning load:
/usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbossesb.sar/lib/mvel2-2.0.12.jar
INFO - Beginning load:
/usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbossesb.sar/lib/jbossesb-config-model-1.1.0.jar
INFO - Beginning load: /usr/local/dst/jboss/4.2.2.GA/lib/endorsed/xalan.jar
INFO - Beginning load:
/usr/local/dst/jboss/4.2.2.GA/server/lib/jboss-serialization.jar
INFO - Beginning load:
/usr/local/dst/jboss/4.2.2.GA/server/lib/iText-2.1.6.jar
INFO - Beginning load:
/usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbrules.esb/jxl-2.4.2.jar
INFO - Configuring enterprise application: classpath.ear
WARN - No application-client.xml found assuming annotations present:
classpath.ear, module: jboss-remoting.jar
WARN - No application-client.xml found assuming annotations present:
classpath.ear, module: jboss-cache-jdk50.jar
WARN - No application-client.xml found assuming annotations present:
classpath.ear, module: milyn-smooks-ejc-1.2.1.jar
WARN - No application-client.xml found assuming annotations present:
classpath.ear, module: jbossesb-rosetta.jar
WARN - No application-client.xml found assuming annotations present:
classpath.ear, module: javassist.jar
WARN - No application-client.xml found assuming annotations present:
classpath.ear, module: jbossesb-config-model-1.0.1.jar
WARN - No application-client.xml found assuming annotations present:
classpath.ear, module: core-3.2.3.v_686_R32x.jar
WARN - No application-client.xml found assuming annotations present:
classpath.ear, module: jtds-1.2.jar
WARN - No application-client.xml found assuming annotations present:
classpath.ear, module: bsh.jar
WARN - No application-client.xml found assuming annotations present:
classpath.ear, module: jaxb-xjc-2.1.4.jar
WARN - No application-client.xml found assuming annotations present:
classpath.ear, module: h2-1.0.68.jar
WARN - No application-client.xml found assuming annotations present:
classpath.ear, module: xml-resolver-1.2.jar
WARN - No application-client.xml found assuming annotations present:
classpath.ear, module: mvel-1.3.3-java1.5.jar
WARN - No application-client.xml found assuming annotations present:
classpath.ear, module: serializer.jar
WARN - No application-client.xml found assuming annotations present:
classpath.ear, module: jboss-microcontainer.jar
WARN - No application-client.xml found assuming annotations present:
classpath.ear, module: jgroups.jar
WARN - No application-client.xml found assuming annotations present:
classpath.ear, module: jbossesb-rosetta.jar
WARN - No application-client.xml found assuming annotations present:
classpath.ear, module: freemarker-2.3.11.jar
WARN - No application-client.xml found assuming annotations present:
classpath.ear, module: mvel2-2.0.12.jar
WARN - No application-client.xml found assuming annotations present:
classpath.ear, module: jbossesb-config-model-1.1.0.jar
WARN - No application-client.xml found assuming annotations present:
classpath.ear, module: xalan.jar
WARN - No application-client.xml found assuming annotations present:
classpath.ear, module: jboss-serialization.jar
WARN - No application-client.xml found assuming annotations present:
classpath.ear, module: iText-2.1.6.jar
WARN - No application-client.xml found assuming annotations present:
classpath.ear, module: jxl-2.4.2.jar
INFO - Enterprise application "classpath.ear" loaded.
INFO - Assembling app: classpath.ear
INFO - Undeploying app: classpath.ear
ERROR - Application could not be deployed:  classpath.ear
org.apache.openejb.OpenEJBException: Creating application failed:
classpath.ear: null
	at
org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:658)
	at
org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:442)
	at
org.apache.openejb.assembler.classic.Assembler.buildContainerSystem(Assembler.java:360)
	at org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:272)
	at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:137)
	at org.apache.openejb.OpenEJB.init(OpenEJB.java:286)
	at org.apache.openejb.OpenEJB.init(OpenEJB.java:265)
	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 org.apache.openejb.loader.OpenEJBInstance.init(OpenEJBInstance.java:36)
	at
org.apache.openejb.client.LocalInitialContextFactory.init(LocalInitialContextFactory.java:71)
	at
org.apache.openejb.client.LocalInitialContextFactory.init(LocalInitialContextFactory.java:53)
	at
org.apache.openejb.client.LocalInitialContextFactory.getInitialContext(LocalInitialContextFactory.java:42)
	at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
	at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
	at javax.naming.InitialContext.init(InitialContext.java:223)
	at javax.naming.InitialContext.<init>(InitialContext.java:197)
	at
com.tura.insight.adhoc.service.ColorBreakQueryExecuteTest.init(ColorBreakQueryExecuteTest.java:58)
	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
org.junit.internal.runners.MethodRoadie.runBefores(MethodRoadie.java:122)
	at
org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:86)
	at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77)
	at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42)
	at
org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88)
	at
org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51)
	at
org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44)
	at
org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27)
	at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)
	at
org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)
	at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46)
	at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
	at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
	at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
	at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: javax.naming.NameAlreadyBoundException
	at org.apache.openejb.core.ivm.naming.NameNode.bind(NameNode.java:96)
	at org.apache.openejb.core.ivm.naming.NameNode.bind(NameNode.java:90)
	at org.apache.openejb.core.ivm.naming.NameNode.bind(NameNode.java:90)
	at org.apache.openejb.core.ivm.naming.NameNode.bind(NameNode.java:105)
	at org.apache.openejb.core.ivm.naming.NameNode.bind(NameNode.java:111)
	at org.apache.openejb.core.ivm.naming.NameNode.bind(NameNode.java:90)
	at org.apache.openejb.core.ivm.naming.NameNode.bind(NameNode.java:105)
	at org.apache.openejb.core.ivm.naming.NameNode.bind(NameNode.java:105)
	at org.apache.openejb.core.ivm.naming.NameNode.bind(NameNode.java:90)
	at org.apache.openejb.core.ivm.naming.NameNode.bind(NameNode.java:105)
	at org.apache.openejb.core.ivm.naming.IvmContext.bind(IvmContext.java:300)
	at
org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:611)
	... 39 more


I've tried everything I can think of to get around this problem but nothing
works. If anyone knows what could be causing this please let me know.
-- 
View this message in context: http://www.nabble.com/NameAlreadyBoundException-When-Running-From-JUnit-tp24904402p24904402.html
Sent from the OpenEJB User mailing list archive at Nabble.com.


Re: NameAlreadyBoundException When Running From JUnit

Posted by Jean-Louis MONTEIRO <je...@atosorigin.com>.
Hi,

Great!

It seems to me from the stack trace OpenEJB fails will processing security
annotations in your bean.

I don't see why it needs to get Remote information from ejb-jar.xml instead
of Message Driven information.
Will try to have a look tomorrow.

Jean-Louis



pbuchheit wrote:
> 
> Ok, I did some digging around and it looks like this issue was being
> caused by the way my user libraries were set up in eclipse. Two different
> libraries were including one of the jboss jars, but one was pointing to
> the copy in the directories of my local Jboss server and the other one
> included a copy in my workspace. Long story short, changing both libraries
> to use the same location of that jar fixed the original issue but now I
> have another problem.
> 
>  When I run my unit test the deployment fails with a Fatal error saying
> that a MessageDriven bean can't be converted to a Remote Bean. We do
> indexing and lookups using Hibenate so the ejb.xml file for the app has a
> block that looks like this: 
> 
> <enterprise-beans>
> 
> 		<message-driven>
> 			<ejb-name>HibernateSearchIndexingMDB</ejb-name>
> 			<ejb-class>
> com.tura.common.service.search.HibernateSearchIndexingMDB</ejb-class>
> 			<activation-config>
> 					<activation-config-property>
> 				
> <activation-config-property-name>destination</activation-config-property-name>
> 				
> <activation-config-property-value>queue/myAppName.ear/hibernateSearchIndexingQueue</activation-config-property-value>
> 				</activation-config-property>
> 			</activation-config>
> 			
> 		</message-driven>
> 	</enterprise-beans>
> 
> and the stack trace looks like:
> 
> DEBUG - Using default 'openejb.nobanner=true'
> Apache OpenEJB 3.1.1    build: 20090530-06:18
> http://openejb.apache.org/
> INFO - openejb.home = myWorkspace/myApp
> INFO - openejb.base =  myWorkspace/myApp
> DEBUG - Using default
> 'openejb.assembler=org.apache.openejb.assembler.classic.Assembler'
> DEBUG - Using default 'openejb.jndiname.failoncollision=true'
> DEBUG - Using default
> 'openejb.configurator=org.apache.openejb.config.ConfigurationFactory'
> DEBUG - Using default 'openejb.validation.skip=false'
> DEBUG - Using default 'openejb.deploymentId.format={ejbName}'
> DEBUG - Using default 'openejb.debuggable-vm-hackery=false'
> DEBUG - Using default 'openejb.webservices.enabled=true'
> DEBUG - Using default 'openejb.vendor.config=geronimo, glassfish, jboss,
> weblogic'  Possible values are: geronimo, glassfish, jboss, weblogic
> DEBUG - Using default
> 'openejb.provider.default=org.apache.openejb.embedded'
> INFO - Configuring Service(id=Default Security Service,
> type=SecurityService, provider-id=Default Security Service)
> INFO - Configuring Service(id=Default Transaction Manager,
> type=TransactionManager, provider-id=Default Transaction Manager)
> DEBUG - Using default 'openejb.tempclassloader.skip=none'  Possible values
> are: none, annotations, enums
> DEBUG - Using default 'openejb.tempclassloader.skip=none'  Possible values
> are: none, annotations, enums
> INFO - Configuring enterprise application: myWorkspace/myApp/dst/myApp.jar
> ERROR - FATAL ERROR: Unknown error in Assembler.  Please send the
> following stack trace and this message to user@openejb.org :
>  java.lang.ClassCastException: org.apache.openejb.jee.MessageDrivenBean
> cannot be cast to org.apache.openejb.jee.RemoteBean
> 	at
> org.apache.openejb.config.AnnotationDeployer$ProcessAnnotatedBeans.processSecurityAnnotations(AnnotationDeployer.java:1682)
> 	at
> org.apache.openejb.config.AnnotationDeployer$ProcessAnnotatedBeans.deploy(AnnotationDeployer.java:997)
> 	at
> org.apache.openejb.config.AnnotationDeployer$ProcessAnnotatedBeans.deploy(AnnotationDeployer.java:616)
> 	at
> org.apache.openejb.config.AnnotationDeployer.deploy(AnnotationDeployer.java:186)
> 	at
> org.apache.openejb.config.ConfigurationFactory$Chain.deploy(ConfigurationFactory.java:247)
> 	at
> org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:601)
> 	at
> org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:488)
> 	at
> org.apache.openejb.config.ConfigurationFactory.getOpenEjbConfiguration(ConfigurationFactory.java:356)
> 	at
> org.apache.openejb.assembler.classic.Assembler.getOpenEjbConfiguration(Assembler.java:292)
> 	at
> org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:271)
> 	at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:137)
> 	at org.apache.openejb.OpenEJB.init(OpenEJB.java:286)
> 	at org.apache.openejb.OpenEJB.init(OpenEJB.java:265)
> 	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
> org.apache.openejb.loader.OpenEJBInstance.init(OpenEJBInstance.java:36)
> 	at
> org.apache.openejb.client.LocalInitialContextFactory.init(LocalInitialContextFactory.java:71)
> 	at
> org.apache.openejb.client.LocalInitialContextFactory.init(LocalInitialContextFactory.java:53)
> 	at
> org.apache.openejb.client.LocalInitialContextFactory.getInitialContext(LocalInitialContextFactory.java:42)
> 	at
> javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
> 	at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
> 	at javax.naming.InitialContext.init(InitialContext.java:223)
> 	at javax.naming.InitialContext.<init>(InitialContext.java:197)
> 	at
> com.tura.insight.adhoc.service.ColorBreakQueryExecuteTest.init(ColorBreakQueryExecuteTest.java:70)
> 	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
> org.junit.internal.runners.MethodRoadie.runBefores(MethodRoadie.java:122)
> 	at
> org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:86)
> 	at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77)
> 	at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42)
> 	at
> org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88)
> 	at
> org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51)
> 	at
> org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44)
> 	at
> org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27)
> 	at
> org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)
> 	at
> org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)
> 	at
> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46)
> 	at
> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> 	at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
> 	at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
> 	at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
> 	at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
> 
> I'm assuming that the problem is somehow related to that, but I'm not
> really sure. Has anyone ever run into this error before? 
> 
> 
> 
> Jean-Louis MONTEIRO wrote:
>> 
>> Hello,
>> 
>> You have lots of jars in your classpath so it's difficult to know which
>> one is causing this issue.
>> Do you need all JBoss AS internal jars?
>> Can you please increase log level to debug in OpenEJB and attach again
>> the result?
>> 
>> Jean-Louis
>> 
>> 
>> pbuchheit wrote:
>>> 
>>> We have an existing application deployed to a JBoss server. I'm trying
>>> to use Openejb 3.1.1 to do unit testing on a stateless session bean that
>>> contains our services. I added code to my unit test to initialize the
>>> context as shown in the examples, but whenever I try to run the JUnit
>>> test I get the following console output: 
>>> 
>>> <see updated log output in reply>
>>> 
>>> I've tried everything I can think of to get around this problem but
>>> nothing works. If anyone knows what could be causing this please let me
>>> know.
>>> 
>> 
>> 
> 
> 




-- 
View this message in context: http://www.nabble.com/NameAlreadyBoundException-When-Running-From-JUnit-tp24904402p24943439.html
Sent from the OpenEJB User mailing list archive at Nabble.com.


Re: NameAlreadyBoundException When Running From JUnit

Posted by pbuchheit <pb...@tura.com>.
Ok, I did some digging around and it looks like this issue was being caused
by the way my user libraries were set up in eclipse. Two different libraries
were including one of the jboss jars, but one was pointing to the copy in
the directories of my local Jboss server and the other one included a copy
in my workspace. Long story short, changing both libraries to use the same
location of that jar fixed the original issue but now I have another
problem.

 When I run my unit test the deployment fails with a Fatal error saying that
a MessageDriven bean can't be converted to a Remote Bean. We do indexing and
lookups using Hibenate so the ejb.xml file for the app has a block that
looks like this: 

<enterprise-beans>

		<message-driven>
			<ejb-name>HibernateSearchIndexingMDB</ejb-name>
			<ejb-class>
com.tura.common.service.search.HibernateSearchIndexingMDB</ejb-class>
			<activation-config>
					<activation-config-property>
				
<activation-config-property-name>destination</activation-config-property-name>
				
<activation-config-property-value>queue/myAppName.ear/hibernateSearchIndexingQueue</activation-config-property-value>
				</activation-config-property>
			</activation-config>
			
		</message-driven>
	</enterprise-beans>

and the stack trace looks like:

DEBUG - Using default 'openejb.nobanner=true'
Apache OpenEJB 3.1.1    build: 20090530-06:18
http://openejb.apache.org/
INFO - openejb.home = myWorkspace/myApp
INFO - openejb.base =  myWorkspace/myApp
DEBUG - Using default
'openejb.assembler=org.apache.openejb.assembler.classic.Assembler'
DEBUG - Using default 'openejb.jndiname.failoncollision=true'
DEBUG - Using default
'openejb.configurator=org.apache.openejb.config.ConfigurationFactory'
DEBUG - Using default 'openejb.validation.skip=false'
DEBUG - Using default 'openejb.deploymentId.format={ejbName}'
DEBUG - Using default 'openejb.debuggable-vm-hackery=false'
DEBUG - Using default 'openejb.webservices.enabled=true'
DEBUG - Using default 'openejb.vendor.config=geronimo, glassfish, jboss,
weblogic'  Possible values are: geronimo, glassfish, jboss, weblogic
DEBUG - Using default 'openejb.provider.default=org.apache.openejb.embedded'
INFO - Configuring Service(id=Default Security Service,
type=SecurityService, provider-id=Default Security Service)
INFO - Configuring Service(id=Default Transaction Manager,
type=TransactionManager, provider-id=Default Transaction Manager)
DEBUG - Using default 'openejb.tempclassloader.skip=none'  Possible values
are: none, annotations, enums
DEBUG - Using default 'openejb.tempclassloader.skip=none'  Possible values
are: none, annotations, enums
INFO - Configuring enterprise application: myWorkspace/myApp/dst/myApp.jar
ERROR - FATAL ERROR: Unknown error in Assembler.  Please send the following
stack trace and this message to user@openejb.org :
 java.lang.ClassCastException: org.apache.openejb.jee.MessageDrivenBean
cannot be cast to org.apache.openejb.jee.RemoteBean
	at
org.apache.openejb.config.AnnotationDeployer$ProcessAnnotatedBeans.processSecurityAnnotations(AnnotationDeployer.java:1682)
	at
org.apache.openejb.config.AnnotationDeployer$ProcessAnnotatedBeans.deploy(AnnotationDeployer.java:997)
	at
org.apache.openejb.config.AnnotationDeployer$ProcessAnnotatedBeans.deploy(AnnotationDeployer.java:616)
	at
org.apache.openejb.config.AnnotationDeployer.deploy(AnnotationDeployer.java:186)
	at
org.apache.openejb.config.ConfigurationFactory$Chain.deploy(ConfigurationFactory.java:247)
	at
org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:601)
	at
org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:488)
	at
org.apache.openejb.config.ConfigurationFactory.getOpenEjbConfiguration(ConfigurationFactory.java:356)
	at
org.apache.openejb.assembler.classic.Assembler.getOpenEjbConfiguration(Assembler.java:292)
	at org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:271)
	at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:137)
	at org.apache.openejb.OpenEJB.init(OpenEJB.java:286)
	at org.apache.openejb.OpenEJB.init(OpenEJB.java:265)
	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 org.apache.openejb.loader.OpenEJBInstance.init(OpenEJBInstance.java:36)
	at
org.apache.openejb.client.LocalInitialContextFactory.init(LocalInitialContextFactory.java:71)
	at
org.apache.openejb.client.LocalInitialContextFactory.init(LocalInitialContextFactory.java:53)
	at
org.apache.openejb.client.LocalInitialContextFactory.getInitialContext(LocalInitialContextFactory.java:42)
	at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
	at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
	at javax.naming.InitialContext.init(InitialContext.java:223)
	at javax.naming.InitialContext.<init>(InitialContext.java:197)
	at
com.tura.insight.adhoc.service.ColorBreakQueryExecuteTest.init(ColorBreakQueryExecuteTest.java:70)
	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
org.junit.internal.runners.MethodRoadie.runBefores(MethodRoadie.java:122)
	at
org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:86)
	at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77)
	at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42)
	at
org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88)
	at
org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51)
	at
org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44)
	at
org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27)
	at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)
	at
org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)
	at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46)
	at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
	at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
	at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
	at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

I'm assuming that the problem is somehow related to that, but I'm not really
sure. Has anyone ever run into this error before? 



Jean-Louis MONTEIRO wrote:
> 
> Hello,
> 
> You have lots of jars in your classpath so it's difficult to know which
> one is causing this issue.
> Do you need all JBoss AS internal jars?
> Can you please increase log level to debug in OpenEJB and attach again the
> result?
> 
> Jean-Louis
> 
> 
> pbuchheit wrote:
>> 
>> We have an existing application deployed to a JBoss server. I'm trying to
>> use Openejb 3.1.1 to do unit testing on a stateless session bean that
>> contains our services. I added code to my unit test to initialize the
>> context as shown in the examples, but whenever I try to run the JUnit
>> test I get the following console output: 
>> 
>> <see updated log output in reply>
>> 
>> I've tried everything I can think of to get around this problem but
>> nothing works. If anyone knows what could be causing this please let me
>> know.
>> 
> 
> 




-- 
View this message in context: http://www.nabble.com/NameAlreadyBoundException-When-Running-From-JUnit-tp24904402p24941285.html
Sent from the OpenEJB User mailing list archive at Nabble.com.


Re: NameAlreadyBoundException When Running From JUnit

Posted by pbuchheit <pb...@tura.com>.
Here is the log output with the level set to debugging. I'm not sure how many
of those Jars for JBoss are needed so I'm going to try excluding some of
them from the classpath. I'll post what I find out if someone hasn't already
figured out a solution by then.

Apache OpenEJB 3.1.1    build: 20090530-06:18
http://openejb.apache.org/
INFO - 
********************************************************************************
OpenEJB http://openejb.apache.org/
Startup: 8/11/09 8:46 AM
Copyright 1999-2008 (C) Apache OpenEJB Project, All Rights Reserved.
Version: 3.1.1
Build date: 20090530
Build time: 06:18
********************************************************************************


INFO - openejb.home = /home/pbuchheit/workspace.galileo/insight-adhoc
INFO - openejb.base = /home/pbuchheit/workspace.galileo/insight-adhoc
INFO - Cannot find the configuration file [conf/openejb.xml].  Will attempt
to create one for the beans deployed.
INFO - Configuring Service(id=Default Security Service,
type=SecurityService, provider-id=Default Security Service)
INFO - Configuring Service(id=Default Transaction Manager,
type=TransactionManager, provider-id=Default Transaction Manager)
INFO - Found ClientModule in classpath:
/usr/local/dst/jboss/4.2.2.GA/server/lib/jboss-remoting.jar
INFO - Found ClientModule in classpath:
/usr/local/dst/jboss/4.2.2.GA/server/lib/jboss-cache-jdk50.jar
INFO - Found ClientModule in classpath:
/usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbossesb.sar/lib/milyn-smooks-ejc-1.2.1.jar
INFO - Found ClientModule in classpath:
/home/pbuchheit/workspace.galileo/insight-lib/jbossesb-rosetta.jar
INFO - Found ClientModule in classpath:
/usr/local/dst/jboss/4.2.2.GA/server/lib/javassist.jar
INFO - Found ClientModule in classpath:
/usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbossesb.sar/lib/jbossesb-config-model-1.0.1.jar
INFO - Found ClientModule in classpath:
/usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbrules.esb/core-3.2.3.v_686_R32x.jar
INFO - Found ClientModule in classpath:
/usr/local/dst/jboss/4.2.2.GA/server/lib/jtds-1.2.jar
INFO - Found ClientModule in classpath:
/usr/local/dst/jboss/4.2.2.GA/server/lib/bsh.jar
INFO - Found ClientModule in classpath:
/usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/soap.esb/jaxb-xjc-2.1.4.jar
INFO - Found ClientModule in classpath:
/usr/local/dst/jboss/4.2.2.GA/server/esb/lib/h2-1.0.68.jar
INFO - Found ClientModule in classpath:
/usr/local/etc/openejb-3.1.1/lib/xml-resolver-1.2.jar
INFO - Found ClientModule in classpath:
/usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbossesb.sar/lib/mvel-1.3.3-java1.5.jar
INFO - Found ClientModule in classpath:
/usr/local/dst/jboss/4.2.2.GA/lib/endorsed/serializer.jar
INFO - Found ClientModule in classpath:
/usr/local/dst/jboss/4.2.2.GA/server/dev/deploy/jboss-bean.deployer/jboss-microcontainer.jar
INFO - Found ClientModule in classpath:
/usr/local/dst/jboss/4.2.2.GA/server/lib/jgroups.jar
INFO - Found ClientModule in classpath:
/usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbossesb.sar/lib/jbossesb-rosetta.jar
INFO - Found ClientModule in classpath:
/usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbossesb.sar/lib/freemarker-2.3.11.jar
INFO - Found ClientModule in classpath:
/usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbossesb.sar/lib/mvel2-2.0.12.jar
INFO - Found ClientModule in classpath:
/usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbossesb.sar/lib/jbossesb-config-model-1.1.0.jar
INFO - Found ClientModule in classpath:
/usr/local/dst/jboss/4.2.2.GA/lib/endorsed/xalan.jar
INFO - Found ClientModule in classpath:
/usr/local/dst/jboss/4.2.2.GA/server/lib/jboss-serialization.jar
INFO - Found ClientModule in classpath:
/usr/local/dst/jboss/4.2.2.GA/server/lib/iText-2.1.6.jar
INFO - Found ClientModule in classpath:
/usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbrules.esb/jxl-2.4.2.jar
INFO - Beginning load:
/usr/local/dst/jboss/4.2.2.GA/server/lib/jboss-remoting.jar
DEBUG - Destroying classLoader URLClassLoader@1825721919
DEBUG - Destroying classLoaders for application
/usr/local/dst/jboss/4.2.2.GA/server/lib/jboss-remoting.jar
DEBUG - Releasing URLs for application
/usr/local/dst/jboss/4.2.2.GA/server/lib/jboss-remoting.jar
DEBUG - Clearing Sun JarFileFactory cache for directory
/usr/local/dst/jboss/4.2.2.GA/server/lib/jboss-remoting.jar
INFO - Beginning load:
/usr/local/dst/jboss/4.2.2.GA/server/lib/jboss-cache-jdk50.jar
DEBUG - Destroying classLoader URLClassLoader@515060127
DEBUG - Destroying classLoaders for application
/usr/local/dst/jboss/4.2.2.GA/server/lib/jboss-cache-jdk50.jar
DEBUG - Releasing URLs for application
/usr/local/dst/jboss/4.2.2.GA/server/lib/jboss-cache-jdk50.jar
DEBUG - Clearing Sun JarFileFactory cache for directory
/usr/local/dst/jboss/4.2.2.GA/server/lib/jboss-cache-jdk50.jar
INFO - Beginning load:
/usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbossesb.sar/lib/milyn-smooks-ejc-1.2.1.jar
DEBUG - Destroying classLoader URLClassLoader@108973432
DEBUG - Destroying classLoaders for application
/usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbossesb.sar/lib/milyn-smooks-ejc-1.2.1.jar
DEBUG - Releasing URLs for application
/usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbossesb.sar/lib/milyn-smooks-ejc-1.2.1.jar
DEBUG - Clearing Sun JarFileFactory cache for directory
/usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbossesb.sar/lib/milyn-smooks-ejc-1.2.1.jar
INFO - Beginning load:
/home/pbuchheit/workspace.galileo/insight-lib/jbossesb-rosetta.jar
DEBUG - Destroying classLoader URLClassLoader@1860404380
DEBUG - Destroying classLoaders for application
/home/pbuchheit/workspace.galileo/insight-lib/jbossesb-rosetta.jar
DEBUG - Releasing URLs for application
/home/pbuchheit/workspace.galileo/insight-lib/jbossesb-rosetta.jar
DEBUG - Clearing Sun JarFileFactory cache for directory
/home/pbuchheit/workspace.galileo/insight-lib/jbossesb-rosetta.jar
INFO - Beginning load:
/usr/local/dst/jboss/4.2.2.GA/server/lib/javassist.jar
DEBUG - Destroying classLoader URLClassLoader@423180001
DEBUG - Destroying classLoaders for application
/usr/local/dst/jboss/4.2.2.GA/server/lib/javassist.jar
DEBUG - Releasing URLs for application
/usr/local/dst/jboss/4.2.2.GA/server/lib/javassist.jar
DEBUG - Clearing Sun JarFileFactory cache for directory
/usr/local/dst/jboss/4.2.2.GA/server/lib/javassist.jar
INFO - Beginning load:
/usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbossesb.sar/lib/jbossesb-config-model-1.0.1.jar
DEBUG - Destroying classLoader URLClassLoader@2067921590
DEBUG - Destroying classLoaders for application
/usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbossesb.sar/lib/jbossesb-config-model-1.0.1.jar
DEBUG - Releasing URLs for application
/usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbossesb.sar/lib/jbossesb-config-model-1.0.1.jar
DEBUG - Clearing Sun JarFileFactory cache for directory
/usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbossesb.sar/lib/jbossesb-config-model-1.0.1.jar
INFO - Beginning load:
/usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbrules.esb/core-3.2.3.v_686_R32x.jar
DEBUG - Destroying classLoader URLClassLoader@682820082
DEBUG - Destroying classLoaders for application
/usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbrules.esb/core-3.2.3.v_686_R32x.jar
DEBUG - Releasing URLs for application
/usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbrules.esb/core-3.2.3.v_686_R32x.jar
DEBUG - Clearing Sun JarFileFactory cache for directory
/usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbrules.esb/core-3.2.3.v_686_R32x.jar
INFO - Beginning load: /usr/local/dst/jboss/4.2.2.GA/server/lib/jtds-1.2.jar
DEBUG - Destroying classLoader URLClassLoader@4508606
DEBUG - Destroying classLoaders for application
/usr/local/dst/jboss/4.2.2.GA/server/lib/jtds-1.2.jar
DEBUG - Releasing URLs for application
/usr/local/dst/jboss/4.2.2.GA/server/lib/jtds-1.2.jar
DEBUG - Clearing Sun JarFileFactory cache for directory
/usr/local/dst/jboss/4.2.2.GA/server/lib/jtds-1.2.jar
INFO - Beginning load: /usr/local/dst/jboss/4.2.2.GA/server/lib/bsh.jar
DEBUG - Destroying classLoader URLClassLoader@614213397
DEBUG - Destroying classLoaders for application
/usr/local/dst/jboss/4.2.2.GA/server/lib/bsh.jar
DEBUG - Releasing URLs for application
/usr/local/dst/jboss/4.2.2.GA/server/lib/bsh.jar
DEBUG - Clearing Sun JarFileFactory cache for directory
/usr/local/dst/jboss/4.2.2.GA/server/lib/bsh.jar
INFO - Beginning load:
/usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/soap.esb/jaxb-xjc-2.1.4.jar
DEBUG - Destroying classLoader URLClassLoader@130672250
DEBUG - Destroying classLoaders for application
/usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/soap.esb/jaxb-xjc-2.1.4.jar
DEBUG - Releasing URLs for application
/usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/soap.esb/jaxb-xjc-2.1.4.jar
DEBUG - Clearing Sun JarFileFactory cache for directory
/usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/soap.esb/jaxb-xjc-2.1.4.jar
INFO - Beginning load:
/usr/local/dst/jboss/4.2.2.GA/server/esb/lib/h2-1.0.68.jar
DEBUG - Destroying classLoader URLClassLoader@1582031564
DEBUG - Destroying classLoaders for application
/usr/local/dst/jboss/4.2.2.GA/server/esb/lib/h2-1.0.68.jar
DEBUG - Releasing URLs for application
/usr/local/dst/jboss/4.2.2.GA/server/esb/lib/h2-1.0.68.jar
DEBUG - Clearing Sun JarFileFactory cache for directory
/usr/local/dst/jboss/4.2.2.GA/server/esb/lib/h2-1.0.68.jar
INFO - Beginning load: /usr/local/etc/openejb-3.1.1/lib/xml-resolver-1.2.jar
DEBUG - Destroying classLoader URLClassLoader@1209462641
DEBUG - Destroying classLoaders for application
/usr/local/etc/openejb-3.1.1/lib/xml-resolver-1.2.jar
DEBUG - Releasing URLs for application
/usr/local/etc/openejb-3.1.1/lib/xml-resolver-1.2.jar
DEBUG - Clearing Sun JarFileFactory cache for directory
/usr/local/etc/openejb-3.1.1/lib/xml-resolver-1.2.jar
INFO - Beginning load:
/usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbossesb.sar/lib/mvel-1.3.3-java1.5.jar
DEBUG - Destroying classLoader URLClassLoader@1505888432
DEBUG - Destroying classLoaders for application
/usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbossesb.sar/lib/mvel-1.3.3-java1.5.jar
DEBUG - Releasing URLs for application
/usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbossesb.sar/lib/mvel-1.3.3-java1.5.jar
DEBUG - Clearing Sun JarFileFactory cache for directory
/usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbossesb.sar/lib/mvel-1.3.3-java1.5.jar
INFO - Beginning load:
/usr/local/dst/jboss/4.2.2.GA/lib/endorsed/serializer.jar
DEBUG - Destroying classLoader URLClassLoader@1372096729
DEBUG - Destroying classLoaders for application
/usr/local/dst/jboss/4.2.2.GA/lib/endorsed/serializer.jar
DEBUG - Releasing URLs for application
/usr/local/dst/jboss/4.2.2.GA/lib/endorsed/serializer.jar
DEBUG - Clearing Sun JarFileFactory cache for directory
/usr/local/dst/jboss/4.2.2.GA/lib/endorsed/serializer.jar
INFO - Beginning load:
/usr/local/dst/jboss/4.2.2.GA/server/dev/deploy/jboss-bean.deployer/jboss-microcontainer.jar
DEBUG - Destroying classLoader URLClassLoader@1150322817
DEBUG - Destroying classLoaders for application
/usr/local/dst/jboss/4.2.2.GA/server/dev/deploy/jboss-bean.deployer/jboss-microcontainer.jar
DEBUG - Releasing URLs for application
/usr/local/dst/jboss/4.2.2.GA/server/dev/deploy/jboss-bean.deployer/jboss-microcontainer.jar
DEBUG - Clearing Sun JarFileFactory cache for directory
/usr/local/dst/jboss/4.2.2.GA/server/dev/deploy/jboss-bean.deployer/jboss-microcontainer.jar
INFO - Beginning load: /usr/local/dst/jboss/4.2.2.GA/server/lib/jgroups.jar
DEBUG - Destroying classLoader URLClassLoader@1827795025
DEBUG - Destroying classLoaders for application
/usr/local/dst/jboss/4.2.2.GA/server/lib/jgroups.jar
DEBUG - Releasing URLs for application
/usr/local/dst/jboss/4.2.2.GA/server/lib/jgroups.jar
DEBUG - Clearing Sun JarFileFactory cache for directory
/usr/local/dst/jboss/4.2.2.GA/server/lib/jgroups.jar
INFO - Beginning load:
/usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbossesb.sar/lib/jbossesb-rosetta.jar
DEBUG - Destroying classLoader URLClassLoader@256728009
DEBUG - Destroying classLoaders for application
/usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbossesb.sar/lib/jbossesb-rosetta.jar
DEBUG - Releasing URLs for application
/usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbossesb.sar/lib/jbossesb-rosetta.jar
DEBUG - Clearing Sun JarFileFactory cache for directory
/usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbossesb.sar/lib/jbossesb-rosetta.jar
INFO - Beginning load:
/usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbossesb.sar/lib/freemarker-2.3.11.jar
DEBUG - Destroying classLoader URLClassLoader@533000440
DEBUG - Destroying classLoaders for application
/usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbossesb.sar/lib/freemarker-2.3.11.jar
DEBUG - Releasing URLs for application
/usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbossesb.sar/lib/freemarker-2.3.11.jar
DEBUG - Clearing Sun JarFileFactory cache for directory
/usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbossesb.sar/lib/freemarker-2.3.11.jar
INFO - Beginning load:
/usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbossesb.sar/lib/mvel2-2.0.12.jar
DEBUG - Destroying classLoader URLClassLoader@984103443
DEBUG - Destroying classLoaders for application
/usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbossesb.sar/lib/mvel2-2.0.12.jar
DEBUG - Releasing URLs for application
/usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbossesb.sar/lib/mvel2-2.0.12.jar
DEBUG - Clearing Sun JarFileFactory cache for directory
/usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbossesb.sar/lib/mvel2-2.0.12.jar
INFO - Beginning load:
/usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbossesb.sar/lib/jbossesb-config-model-1.1.0.jar
DEBUG - Destroying classLoader URLClassLoader@2055000954
DEBUG - Destroying classLoaders for application
/usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbossesb.sar/lib/jbossesb-config-model-1.1.0.jar
DEBUG - Releasing URLs for application
/usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbossesb.sar/lib/jbossesb-config-model-1.1.0.jar
DEBUG - Clearing Sun JarFileFactory cache for directory
/usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbossesb.sar/lib/jbossesb-config-model-1.1.0.jar
INFO - Beginning load: /usr/local/dst/jboss/4.2.2.GA/lib/endorsed/xalan.jar
DEBUG - Destroying classLoader URLClassLoader@421539177
DEBUG - Destroying classLoaders for application
/usr/local/dst/jboss/4.2.2.GA/lib/endorsed/xalan.jar
DEBUG - Releasing URLs for application
/usr/local/dst/jboss/4.2.2.GA/lib/endorsed/xalan.jar
DEBUG - Clearing Sun JarFileFactory cache for directory
/usr/local/dst/jboss/4.2.2.GA/lib/endorsed/xalan.jar
INFO - Beginning load:
/usr/local/dst/jboss/4.2.2.GA/server/lib/jboss-serialization.jar
DEBUG - Destroying classLoader URLClassLoader@260396386
DEBUG - Destroying classLoaders for application
/usr/local/dst/jboss/4.2.2.GA/server/lib/jboss-serialization.jar
DEBUG - Releasing URLs for application
/usr/local/dst/jboss/4.2.2.GA/server/lib/jboss-serialization.jar
DEBUG - Clearing Sun JarFileFactory cache for directory
/usr/local/dst/jboss/4.2.2.GA/server/lib/jboss-serialization.jar
INFO - Beginning load:
/usr/local/dst/jboss/4.2.2.GA/server/lib/iText-2.1.6.jar
DEBUG - Destroying classLoader URLClassLoader@2057870563
DEBUG - Destroying classLoaders for application
/usr/local/dst/jboss/4.2.2.GA/server/lib/iText-2.1.6.jar
DEBUG - Releasing URLs for application
/usr/local/dst/jboss/4.2.2.GA/server/lib/iText-2.1.6.jar
DEBUG - Clearing Sun JarFileFactory cache for directory
/usr/local/dst/jboss/4.2.2.GA/server/lib/iText-2.1.6.jar
INFO - Beginning load:
/usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbrules.esb/jxl-2.4.2.jar
DEBUG - Destroying classLoader URLClassLoader@1406417406
DEBUG - Destroying classLoaders for application
/usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbrules.esb/jxl-2.4.2.jar
DEBUG - Releasing URLs for application
/usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbrules.esb/jxl-2.4.2.jar
DEBUG - Clearing Sun JarFileFactory cache for directory
/usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbrules.esb/jxl-2.4.2.jar
INFO - Configuring enterprise application: classpath.ear
WARN - No application-client.xml found assuming annotations present:
classpath.ear, module: jboss-remoting.jar
WARN - No application-client.xml found assuming annotations present:
classpath.ear, module: jboss-cache-jdk50.jar
WARN - No application-client.xml found assuming annotations present:
classpath.ear, module: milyn-smooks-ejc-1.2.1.jar
WARN - No application-client.xml found assuming annotations present:
classpath.ear, module: jbossesb-rosetta.jar
WARN - No application-client.xml found assuming annotations present:
classpath.ear, module: javassist.jar
WARN - No application-client.xml found assuming annotations present:
classpath.ear, module: jbossesb-config-model-1.0.1.jar
WARN - No application-client.xml found assuming annotations present:
classpath.ear, module: core-3.2.3.v_686_R32x.jar
WARN - No application-client.xml found assuming annotations present:
classpath.ear, module: jtds-1.2.jar
WARN - No application-client.xml found assuming annotations present:
classpath.ear, module: bsh.jar
WARN - No application-client.xml found assuming annotations present:
classpath.ear, module: jaxb-xjc-2.1.4.jar
WARN - No application-client.xml found assuming annotations present:
classpath.ear, module: h2-1.0.68.jar
WARN - No application-client.xml found assuming annotations present:
classpath.ear, module: xml-resolver-1.2.jar
WARN - No application-client.xml found assuming annotations present:
classpath.ear, module: mvel-1.3.3-java1.5.jar
WARN - No application-client.xml found assuming annotations present:
classpath.ear, module: serializer.jar
WARN - No application-client.xml found assuming annotations present:
classpath.ear, module: jboss-microcontainer.jar
WARN - No application-client.xml found assuming annotations present:
classpath.ear, module: jgroups.jar
WARN - No application-client.xml found assuming annotations present:
classpath.ear, module: jbossesb-rosetta.jar
WARN - No application-client.xml found assuming annotations present:
classpath.ear, module: freemarker-2.3.11.jar
WARN - No application-client.xml found assuming annotations present:
classpath.ear, module: mvel2-2.0.12.jar
WARN - No application-client.xml found assuming annotations present:
classpath.ear, module: jbossesb-config-model-1.1.0.jar
WARN - No application-client.xml found assuming annotations present:
classpath.ear, module: xalan.jar
WARN - No application-client.xml found assuming annotations present:
classpath.ear, module: jboss-serialization.jar
WARN - No application-client.xml found assuming annotations present:
classpath.ear, module: iText-2.1.6.jar
WARN - No application-client.xml found assuming annotations present:
classpath.ear, module: jxl-2.4.2.jar
INFO - Enterprise application "classpath.ear" loaded.
DEBUG - Users file:
jar:file:/usr/local/etc/openejb-3.1.1/lib/openejb-core-3.1.1.jar!/users.properties
DEBUG - Groups file:
jar:file:/usr/local/etc/openejb-3.1.1/lib/openejb-core-3.1.1.jar!/groups.properties
DEBUG - abort
INFO - Assembling app: classpath.ear
INFO - Undeploying app: classpath.ear
DEBUG - Destroying classLoaders for application classpath.ear
DEBUG - Destroying classLoader URLClassLoader@1454189616
DEBUG - Releasing URLs for application classpath.ear
DEBUG - Clearing Sun JarFileFactory cache for directory classpath.ear
ERROR - Application could not be deployed:  classpath.ear
org.apache.openejb.OpenEJBException: Creating application failed:
classpath.ear: null
	at
org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:658)
	at
org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:442)
	at
org.apache.openejb.assembler.classic.Assembler.buildContainerSystem(Assembler.java:360)
	at org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:272)
	at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:137)
	at org.apache.openejb.OpenEJB.init(OpenEJB.java:286)
	at org.apache.openejb.OpenEJB.init(OpenEJB.java:265)
	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 org.apache.openejb.loader.OpenEJBInstance.init(OpenEJBInstance.java:36)
	at
org.apache.openejb.client.LocalInitialContextFactory.init(LocalInitialContextFactory.java:71)
	at
org.apache.openejb.client.LocalInitialContextFactory.init(LocalInitialContextFactory.java:53)
	at
org.apache.openejb.client.LocalInitialContextFactory.getInitialContext(LocalInitialContextFactory.java:42)
	at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
	at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
	at javax.naming.InitialContext.init(InitialContext.java:223)
	at javax.naming.InitialContext.<init>(InitialContext.java:197)
	at
com.tura.insight.adhoc.service.ColorBreakQueryExecuteTest.init(ColorBreakQueryExecuteTest.java:59)
	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
org.junit.internal.runners.MethodRoadie.runBefores(MethodRoadie.java:122)
	at
org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:86)
	at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77)
	at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42)
	at
org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88)
	at
org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51)
	at
org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44)
	at
org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27)
	at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)
	at
org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)
	at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46)
	at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
	at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
	at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
	at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: javax.naming.NameAlreadyBoundException
	at org.apache.openejb.core.ivm.naming.NameNode.bind(NameNode.java:96)
	at org.apache.openejb.core.ivm.naming.NameNode.bind(NameNode.java:90)
	at org.apache.openejb.core.ivm.naming.NameNode.bind(NameNode.java:90)
	at org.apache.openejb.core.ivm.naming.NameNode.bind(NameNode.java:105)
	at org.apache.openejb.core.ivm.naming.NameNode.bind(NameNode.java:111)
	at org.apache.openejb.core.ivm.naming.NameNode.bind(NameNode.java:90)
	at org.apache.openejb.core.ivm.naming.NameNode.bind(NameNode.java:105)
	at org.apache.openejb.core.ivm.naming.NameNode.bind(NameNode.java:105)
	at org.apache.openejb.core.ivm.naming.NameNode.bind(NameNode.java:90)
	at org.apache.openejb.core.ivm.naming.NameNode.bind(NameNode.java:105)
	at org.apache.openejb.core.ivm.naming.IvmContext.bind(IvmContext.java:300)
	at
org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:611)
	... 39 more



Jean-Louis MONTEIRO wrote:
> 
> Hello,
> 
> You have lots of jars in your classpath so it's difficult to know which
> one is causing this issue.
> Do you need all JBoss AS internal jars?
> Can you please increase log level to debug in OpenEJB and attach again the
> result?
> 
> Jean-Louis
> 
> 
> pbuchheit wrote:
>> 
>> We have an existing application deployed to a JBoss server. I'm trying to
>> use Openejb 3.1.1 to do unit testing on a stateless session bean that
>> contains our services. I added code to my unit test to initialize the
>> context as shown in the examples, but whenever I try to run the JUnit
>> test I get the following console output: 
>> 
>> <see updated log output in reply>
>> 
>> I've tried everything I can think of to get around this problem but
>> nothing works. If anyone knows what could be causing this please let me
>> know.
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/NameAlreadyBoundException-When-Running-From-JUnit-tp24904402p24917079.html
Sent from the OpenEJB User mailing list archive at Nabble.com.


Re: NameAlreadyBoundException When Running From JUnit

Posted by Jean-Louis MONTEIRO <je...@atosorigin.com>.
Hello,

You have lots of jars in your classpath so it's difficult to know which one
is causing this issue.
Do you need all JBoss AS internal jars?
Can you please increase log level to debug in OpenEJB and attach again the
result?

Jean-Louis


pbuchheit wrote:
> 
> We have an existing application deployed to a JBoss server. I'm trying to
> use Openejb 3.1.1 to do unit testing on a stateless session bean that
> contains our services. I added code to my unit test to initialize the
> context as shown in the examples, but whenever I try to run the JUnit test
> I get the following console output:
> 
> Apache OpenEJB 3.1.1    build: 20090530-06:18
> http://openejb.apache.org/
> INFO - openejb.home = my eclipse workspace path/myApp
> INFO - openejb.base = my eclipse workspace path/myApp
> INFO - Configuring Service(id=Default Security Service,
> type=SecurityService, provider-id=Default Security Service)
> INFO - Configuring Service(id=Default Transaction Manager,
> type=TransactionManager, provider-id=Default Transaction Manager)
> INFO - Found ClientModule in classpath:
> /usr/local/dst/jboss/4.2.2.GA/server/lib/jboss-remoting.jar
> INFO - Found ClientModule in classpath:
> /usr/local/dst/jboss/4.2.2.GA/server/lib/jboss-cache-jdk50.jar
> INFO - Found ClientModule in classpath:
> /usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbossesb.sar/lib/milyn-smooks-ejc-1.2.1.jar
> INFO - Found ClientModule in classpath:
> /home/pbuchheit/workspace.galileo/insight-lib/jbossesb-rosetta.jar
> INFO - Found ClientModule in classpath:
> /usr/local/dst/jboss/4.2.2.GA/server/lib/javassist.jar
> INFO - Found ClientModule in classpath:
> /usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbossesb.sar/lib/jbossesb-config-model-1.0.1.jar
> INFO - Found ClientModule in classpath:
> /usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbrules.esb/core-3.2.3.v_686_R32x.jar
> INFO - Found ClientModule in classpath:
> /usr/local/dst/jboss/4.2.2.GA/server/lib/jtds-1.2.jar
> INFO - Found ClientModule in classpath:
> /usr/local/dst/jboss/4.2.2.GA/server/lib/bsh.jar
> INFO - Found ClientModule in classpath:
> /usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/soap.esb/jaxb-xjc-2.1.4.jar
> INFO - Found ClientModule in classpath:
> /usr/local/dst/jboss/4.2.2.GA/server/esb/lib/h2-1.0.68.jar
> INFO - Found ClientModule in classpath:
> /usr/local/etc/openejb-3.1.1/lib/xml-resolver-1.2.jar
> INFO - Found ClientModule in classpath:
> /usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbossesb.sar/lib/mvel-1.3.3-java1.5.jar
> INFO - Found ClientModule in classpath:
> /usr/local/dst/jboss/4.2.2.GA/lib/endorsed/serializer.jar
> INFO - Found ClientModule in classpath:
> /usr/local/dst/jboss/4.2.2.GA/server/dev/deploy/jboss-bean.deployer/jboss-microcontainer.jar
> INFO - Found ClientModule in classpath:
> /usr/local/dst/jboss/4.2.2.GA/server/lib/jgroups.jar
> INFO - Found ClientModule in classpath:
> /usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbossesb.sar/lib/jbossesb-rosetta.jar
> INFO - Found ClientModule in classpath:
> /usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbossesb.sar/lib/freemarker-2.3.11.jar
> INFO - Found ClientModule in classpath:
> /usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbossesb.sar/lib/mvel2-2.0.12.jar
> INFO - Found ClientModule in classpath:
> /usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbossesb.sar/lib/jbossesb-config-model-1.1.0.jar
> INFO - Found ClientModule in classpath:
> /usr/local/dst/jboss/4.2.2.GA/lib/endorsed/xalan.jar
> INFO - Found ClientModule in classpath:
> /usr/local/dst/jboss/4.2.2.GA/server/lib/jboss-serialization.jar
> INFO - Found ClientModule in classpath:
> /usr/local/dst/jboss/4.2.2.GA/server/lib/iText-2.1.6.jar
> INFO - Found ClientModule in classpath:
> /usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbrules.esb/jxl-2.4.2.jar
> INFO - Beginning load:
> /usr/local/dst/jboss/4.2.2.GA/server/lib/jboss-remoting.jar
> INFO - Beginning load:
> /usr/local/dst/jboss/4.2.2.GA/server/lib/jboss-cache-jdk50.jar
> INFO - Beginning load:
> /usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbossesb.sar/lib/milyn-smooks-ejc-1.2.1.jar
> INFO - Beginning load:
> /home/pbuchheit/workspace.galileo/insight-lib/jbossesb-rosetta.jar
> INFO - Beginning load:
> /usr/local/dst/jboss/4.2.2.GA/server/lib/javassist.jar
> INFO - Beginning load:
> /usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbossesb.sar/lib/jbossesb-config-model-1.0.1.jar
> INFO - Beginning load:
> /usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbrules.esb/core-3.2.3.v_686_R32x.jar
> INFO - Beginning load:
> /usr/local/dst/jboss/4.2.2.GA/server/lib/jtds-1.2.jar
> INFO - Beginning load: /usr/local/dst/jboss/4.2.2.GA/server/lib/bsh.jar
> INFO - Beginning load:
> /usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/soap.esb/jaxb-xjc-2.1.4.jar
> INFO - Beginning load:
> /usr/local/dst/jboss/4.2.2.GA/server/esb/lib/h2-1.0.68.jar
> INFO - Beginning load:
> /usr/local/etc/openejb-3.1.1/lib/xml-resolver-1.2.jar
> INFO - Beginning load:
> /usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbossesb.sar/lib/mvel-1.3.3-java1.5.jar
> INFO - Beginning load:
> /usr/local/dst/jboss/4.2.2.GA/lib/endorsed/serializer.jar
> INFO - Beginning load:
> /usr/local/dst/jboss/4.2.2.GA/server/dev/deploy/jboss-bean.deployer/jboss-microcontainer.jar
> INFO - Beginning load:
> /usr/local/dst/jboss/4.2.2.GA/server/lib/jgroups.jar
> INFO - Beginning load:
> /usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbossesb.sar/lib/jbossesb-rosetta.jar
> INFO - Beginning load:
> /usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbossesb.sar/lib/freemarker-2.3.11.jar
> INFO - Beginning load:
> /usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbossesb.sar/lib/mvel2-2.0.12.jar
> INFO - Beginning load:
> /usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbossesb.sar/lib/jbossesb-config-model-1.1.0.jar
> INFO - Beginning load:
> /usr/local/dst/jboss/4.2.2.GA/lib/endorsed/xalan.jar
> INFO - Beginning load:
> /usr/local/dst/jboss/4.2.2.GA/server/lib/jboss-serialization.jar
> INFO - Beginning load:
> /usr/local/dst/jboss/4.2.2.GA/server/lib/iText-2.1.6.jar
> INFO - Beginning load:
> /usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbrules.esb/jxl-2.4.2.jar
> INFO - Configuring enterprise application: classpath.ear
> WARN - No application-client.xml found assuming annotations present:
> classpath.ear, module: jboss-remoting.jar
> WARN - No application-client.xml found assuming annotations present:
> classpath.ear, module: jboss-cache-jdk50.jar
> WARN - No application-client.xml found assuming annotations present:
> classpath.ear, module: milyn-smooks-ejc-1.2.1.jar
> WARN - No application-client.xml found assuming annotations present:
> classpath.ear, module: jbossesb-rosetta.jar
> WARN - No application-client.xml found assuming annotations present:
> classpath.ear, module: javassist.jar
> WARN - No application-client.xml found assuming annotations present:
> classpath.ear, module: jbossesb-config-model-1.0.1.jar
> WARN - No application-client.xml found assuming annotations present:
> classpath.ear, module: core-3.2.3.v_686_R32x.jar
> WARN - No application-client.xml found assuming annotations present:
> classpath.ear, module: jtds-1.2.jar
> WARN - No application-client.xml found assuming annotations present:
> classpath.ear, module: bsh.jar
> WARN - No application-client.xml found assuming annotations present:
> classpath.ear, module: jaxb-xjc-2.1.4.jar
> WARN - No application-client.xml found assuming annotations present:
> classpath.ear, module: h2-1.0.68.jar
> WARN - No application-client.xml found assuming annotations present:
> classpath.ear, module: xml-resolver-1.2.jar
> WARN - No application-client.xml found assuming annotations present:
> classpath.ear, module: mvel-1.3.3-java1.5.jar
> WARN - No application-client.xml found assuming annotations present:
> classpath.ear, module: serializer.jar
> WARN - No application-client.xml found assuming annotations present:
> classpath.ear, module: jboss-microcontainer.jar
> WARN - No application-client.xml found assuming annotations present:
> classpath.ear, module: jgroups.jar
> WARN - No application-client.xml found assuming annotations present:
> classpath.ear, module: jbossesb-rosetta.jar
> WARN - No application-client.xml found assuming annotations present:
> classpath.ear, module: freemarker-2.3.11.jar
> WARN - No application-client.xml found assuming annotations present:
> classpath.ear, module: mvel2-2.0.12.jar
> WARN - No application-client.xml found assuming annotations present:
> classpath.ear, module: jbossesb-config-model-1.1.0.jar
> WARN - No application-client.xml found assuming annotations present:
> classpath.ear, module: xalan.jar
> WARN - No application-client.xml found assuming annotations present:
> classpath.ear, module: jboss-serialization.jar
> WARN - No application-client.xml found assuming annotations present:
> classpath.ear, module: iText-2.1.6.jar
> WARN - No application-client.xml found assuming annotations present:
> classpath.ear, module: jxl-2.4.2.jar
> INFO - Enterprise application "classpath.ear" loaded.
> INFO - Assembling app: classpath.ear
> INFO - Undeploying app: classpath.ear
> ERROR - Application could not be deployed:  classpath.ear
> org.apache.openejb.OpenEJBException: Creating application failed:
> classpath.ear: null
> 	at
> org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:658)
> 	at
> org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:442)
> 	at
> org.apache.openejb.assembler.classic.Assembler.buildContainerSystem(Assembler.java:360)
> 	at
> org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:272)
> 	at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:137)
> 	at org.apache.openejb.OpenEJB.init(OpenEJB.java:286)
> 	at org.apache.openejb.OpenEJB.init(OpenEJB.java:265)
> 	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
> org.apache.openejb.loader.OpenEJBInstance.init(OpenEJBInstance.java:36)
> 	at
> org.apache.openejb.client.LocalInitialContextFactory.init(LocalInitialContextFactory.java:71)
> 	at
> org.apache.openejb.client.LocalInitialContextFactory.init(LocalInitialContextFactory.java:53)
> 	at
> org.apache.openejb.client.LocalInitialContextFactory.getInitialContext(LocalInitialContextFactory.java:42)
> 	at
> javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
> 	at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
> 	at javax.naming.InitialContext.init(InitialContext.java:223)
> 	at javax.naming.InitialContext.<init>(InitialContext.java:197)
> 	at
> com.tura.insight.adhoc.service.ColorBreakQueryExecuteTest.init(ColorBreakQueryExecuteTest.java:58)
> 	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
> org.junit.internal.runners.MethodRoadie.runBefores(MethodRoadie.java:122)
> 	at
> org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:86)
> 	at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77)
> 	at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42)
> 	at
> org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88)
> 	at
> org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51)
> 	at
> org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44)
> 	at
> org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27)
> 	at
> org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)
> 	at
> org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)
> 	at
> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46)
> 	at
> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> 	at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
> 	at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
> 	at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
> 	at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
> Caused by: javax.naming.NameAlreadyBoundException
> 	at org.apache.openejb.core.ivm.naming.NameNode.bind(NameNode.java:96)
> 	at org.apache.openejb.core.ivm.naming.NameNode.bind(NameNode.java:90)
> 	at org.apache.openejb.core.ivm.naming.NameNode.bind(NameNode.java:90)
> 	at org.apache.openejb.core.ivm.naming.NameNode.bind(NameNode.java:105)
> 	at org.apache.openejb.core.ivm.naming.NameNode.bind(NameNode.java:111)
> 	at org.apache.openejb.core.ivm.naming.NameNode.bind(NameNode.java:90)
> 	at org.apache.openejb.core.ivm.naming.NameNode.bind(NameNode.java:105)
> 	at org.apache.openejb.core.ivm.naming.NameNode.bind(NameNode.java:105)
> 	at org.apache.openejb.core.ivm.naming.NameNode.bind(NameNode.java:90)
> 	at org.apache.openejb.core.ivm.naming.NameNode.bind(NameNode.java:105)
> 	at
> org.apache.openejb.core.ivm.naming.IvmContext.bind(IvmContext.java:300)
> 	at
> org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:611)
> 	... 39 more
> 
> 
> I've tried everything I can think of to get around this problem but
> nothing works. If anyone knows what could be causing this please let me
> know.
> 

-- 
View this message in context: http://www.nabble.com/NameAlreadyBoundException-When-Running-From-JUnit-tp24904402p24912617.html
Sent from the OpenEJB User mailing list archive at Nabble.com.


Re: NameAlreadyBoundException When Running From JUnit

Posted by David Blevins <da...@visi.com>.
On Aug 10, 2009, at 7:57 PM, pbuchheit wrote:

>
> We have an existing application deployed to a JBoss server. I'm  
> trying to use
> Openejb 3.1.1 to do unit testing on a stateless session bean that  
> contains
> our services. I added code to my unit test to initialize the context  
> as
> shown in the examples, but whenever I try to run the JUnit test I  
> get the
> following console output:
>
> Apache OpenEJB 3.1.1    build: 20090530-06:18
> http://openejb.apache.org/
> INFO - openejb.home = my eclipse workspace path/myApp
> INFO - openejb.base = my eclipse workspace path/myApp
> INFO - Configuring Service(id=Default Security Service,
> type=SecurityService, provider-id=Default Security Service)
> INFO - Configuring Service(id=Default Transaction Manager,
> type=TransactionManager, provider-id=Default Transaction Manager)
> INFO - Found ClientModule in classpath:
> /usr/local/dst/jboss/4.2.2.GA/server/lib/jboss-remoting.jar
> INFO - Found ClientModule in classpath:
> /usr/local/dst/jboss/4.2.2.GA/server/lib/jboss-cache-jdk50.jar
> INFO - Found ClientModule in classpath:
> /usr/local/dst/jboss/4.2.2.GA/server/esb/deploy/jbossesb.sar/lib/ 
> milyn-smooks-ejc-1.2.1.jar
> INFO - Found ClientModule in classpath:
> /home/pbuchheit/workspace.galileo/insight-lib/jbossesb-rosetta.jar
> INFO - Found ClientModule in classpath:
> /usr/local/dst/jboss/4.2.2.GA/server/lib/javassist.jar
> INFO - Found ClientModule in classpath:
[...]
> Caused by: javax.naming.NameAlreadyBoundException
> 	at org.apache.openejb.core.ivm.naming.NameNode.bind(NameNode.java:96)
> 	at org.apache.openejb.core.ivm.naming.NameNode.bind(NameNode.java:90)
> 	at org.apache.openejb.core.ivm.naming.NameNode.bind(NameNode.java:90)
> 	at org.apache.openejb.core.ivm.naming.NameNode.bind(NameNode.java: 
> 105)
> 	at org.apache.openejb.core.ivm.naming.NameNode.bind(NameNode.java: 
> 111)
> 	at org.apache.openejb.core.ivm.naming.NameNode.bind(NameNode.java:90)
> 	at org.apache.openejb.core.ivm.naming.NameNode.bind(NameNode.java: 
> 105)
> 	at org.apache.openejb.core.ivm.naming.NameNode.bind(NameNode.java: 
> 105)
> 	at org.apache.openejb.core.ivm.naming.NameNode.bind(NameNode.java:90)
> 	at org.apache.openejb.core.ivm.naming.NameNode.bind(NameNode.java: 
> 105)
> 	at  
> org.apache.openejb.core.ivm.naming.IvmContext.bind(IvmContext.java: 
> 300)

Follow up on some developments here.  This problem should no longer  
show up when using the default settings (no includes/excludes  
manipulation required).  If you want to give it a try, here are the  
new snapshots:

http://repository.apache.org/snapshots/

As well new zips and tars are available here:

http://repository.apache.org/snapshots/org/apache/openejb/openejb-standalone/3.1.3-SNAPSHOT/openejb-standalone-3.1.3-20100113.224305-3.tar.gz
http://repository.apache.org/snapshots/org/apache/openejb/openejb-standalone/3.1.3-SNAPSHOT/openejb-standalone-3.1.3-20100113.224305-3.zip

And the JIRA in question if you are curious:

  OPENEJB-1130: Stricter ClientModule classpath discovery prevents  
possible NameAlreadyBoundException
  [ https://issues.apache.org/jira/browse/OPENEJB-1130 ]

Would love to get some thumbs up from any willing testers.

-David