You are viewing a plain text version of this content. The canonical link for it is here.
Posted to muse-dev@ws.apache.org by Chad Sturtz <cs...@gestalt-llc.com> on 2006/06/28 15:42:33 UTC
NameAlreadyBoundException
I sent the below email last Friday. I would really appreciate even a
confirmation of the issue.
Issue summary: I'm receiving a NameAlreadyBoundException after
deploying 2 WARs, each containing at least 1 web service built using
MUSE 1.0.
Probable cause: The Axis servlet requires several items to be included
in the jndi-config.xml inside its WAR. Multiple WARs equals
NameAlreadyBoundException.
Chad Sturtz
Associate Consultant
Gestalt, LLC
csturtz@gestalt-llc.com
Office: 417.626.6521
Cell: 618.920.3437
Fax: 417.625.1810
________________________________
From: Chad Sturtz [mailto:csturtz@gestalt-llc.com]
Sent: Friday, June 23, 2006 11:59 AM
To: muse-dev@ws.apache.org
Subject: NameAlreadyBoundException when deploying two WARs developed
using muse 1.0
My goal is for the client to be able to pick and choose where a web
service is deployed. For this reason, I am creating one WAR for each
service. When I tried deploying two WARs in the same AS that each
contain one web service and were built using muse 1.0, a
NameAlreadyBoundException was thrown. See the following partial stack
trace:
Caused by: javax.naming.NameAlreadyBoundException
at org.jnp.server.NamingServer.bind(NamingServer.java:144)
at org.jnp.server.NamingServer.bind(NamingServer.java:109)
at org.jnp.server.NamingServer.bind(NamingServer.java:109)
at org.jnp.interfaces.NamingContext.bind(NamingContext.java:566)
at org.jnp.interfaces.NamingContext.bind(NamingContext.java:531)
at
org.apache.ws.util.jndi.XmlBeanNamingContext.addResource(XmlBeanNamingCo
ntext.java:216)
at
org.apache.ws.util.jndi.XmlBeanJndiUtils.addGlobalElements(XmlBeanJndiUt
ils.java:488)
at
org.apache.ws.util.jndi.XmlBeanJndiUtils.parseJNDIConfig(XmlBeanJndiUtil
s.java:236)
at
org.apache.ws.util.jndi.XmlBeanJndiUtils.initFromInputStream(XmlBeanJndi
Utils.java:175)
at
org.apache.ws.resource.webapp.WsrfServletContextListener.contextInitiali
zed(WsrfServletContextListener.java:69)
As a potential solution, I attempted to deploy one (exploded) WAR as the
un-touched webapps/muse directory and a second WAR (using muse-generated
items, but built by maven) for a web service (built with muse) but with
references to muse or axis related items removed from the
server-config.wsdd, web.xml, and jndi-config.xml files. Removing all
references to muse/axis from those files does still allow the WAR to
deploy, but the axis-servlet has know knowledge of the web service. To
try and correct this, I left the references to the axis-servlet in the
web.xml and attempted to deploy again. This time, a
NullPointerException was thrown. Please see the following partial stack
trace:
Caused by: java.lang.NullPointerException
at
org.apache.ws.util.jndi.XmlBeanJndiUtils.setDefaultParameterValues(XmlBe
anJndiUtils.java:251)
at
org.apache.ws.util.jndi.XmlBeanJndiUtils.getServiceArray(XmlBeanJndiUtil
s.java:419)
at
org.apache.ws.util.jndi.XmlBeanJndiUtils.addServiceElements(XmlBeanJndiU
tils.java:505)
at
org.apache.ws.util.jndi.XmlBeanJndiUtils.parseJNDIConfig(XmlBeanJndiUtil
s.java:244)
at
org.apache.ws.util.jndi.XmlBeanJndiUtils.initFromInputStream(XmlBeanJndi
Utils.java:175)
at
org.apache.ws.resource.webapp.WsrfServletContextListener.contextInitiali
zed(WsrfServletContextListener.java:69)
I was able to fix this issue by adding the following back into the
jndi-config.xml, which then produced the original
NameAlreadyBoundException.
<resource name="DefaultParameters"
type="org.apache.ws.util.jndi.DefaultParameters">
<resourceParams>
<parameter>
<name>factory</name>
<value>org.apache.ws.util.jndi.BeanFactory</value>
</parameter>
<parameter>
<name>resourceKeyClassName</name>
<value>org.apache.ws.resource.impl.SimpleTypeResourceKey</value>
</parameter>
</resourceParams>
</resource>
To summarize, it appears that muse is a singleton war. It requires
certain items to be listed in the jndi-config.xml file for its war, and
therefore when a second muse war is deployed, jndi problems occur.
Any relative feedback would be appreciated. Thanks!
Chad Sturtz
Associate Consultant
Gestalt, LLC
csturtz@gestalt-llc.com
Office: 417.626.6521
Cell: 618.920.3437
Fax: 417.625.1810
Chad Sturtz
Associate Consultant
Gestalt, LLC
csturtz@gestalt-llc.com
Office: 417.626.6521
Cell: 618.920.3437
Fax: 417.625.1810