Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » Bug in stopping JBoss?
Bug in stopping JBoss? [message #206440] Mon, 07 January 2008 08:41 Go to next message
Eclipse UserFriend
Originally posted by: obdennis2007.hotmail.com

Hi,

The configuration for server includes a JNDI port number. I have setup two
server configs for JBoss 4 in Eclipse web server tool.

Each of these JBoss server are configured to be able to run at the same
time (i.e. all conflicting ports resolved). They both starts and run fine
in Eclipse. One server is using jndi port 1099 and the other using 11099.
When stopping the one that is 11099, Eclipse reports error:

-----
Exception in thread "main" javax.naming.CommunicationException: Could not
obtain connection to any of these urls: localhost:1099 [Root exception is
javax.naming.CommunicationException: Failed to connect to server
localhost:1099 [Root exception is
javax.naming.ServiceUnavailableException: Failed to connect to server
localhost:1099 [Root exception is java.net.ConnectException: Connection
refused: connect]]]
at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java :1416)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:5 96)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:5 89)
at javax.naming.InitialContext.lookup(Unknown Source)
at org.jboss.Shutdown.main(Shutdown.java:214)
-----

This is so when the other (normal standard config server with port 1099)
server is stopped. If that other one is running, stopping the one with
11099 port will stop the 1099 one..

This leads me think that Eclipse is not using the configured 11099 (or
any) in the server config to stop it. It will going to use 1099 (hard
coded somewhere) regardless of the setting made in the server config. I
have verified the xml file in the workspace it is set as 11099 for that
server which failed to stop from Eclipse. Can anyone confirm this?

Thanks in advance.
Re: Bug in stopping JBoss? [message #489388 is a reply to message #206440] Fri, 02 October 2009 18:45 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 2
Registered: October 2009
Junior Member
I can verify in my installation that I have the same problem. The JBoss server connectors ignore the jndi port on shutdown.

Eclipse 3.3.2
WebStandardTools 1.0.2.v200706120315
JDK 1.6.05

Other people seem to have this problem as well:
http://stackoverflow.com/questions/173487/problems-with-shut ting-down-jboss-in-eclipse-if-i-change-jndi-port

[Updated on: Fri, 02 October 2009 19:00]

Report message to a moderator

Re: Bug in stopping JBoss? [message #489439 is a reply to message #489388] Sat, 03 October 2009 01:47 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 2
Registered: October 2009
Junior Member
Here is a detailed fix for this problem:
The Eclipse WTP server connector won't shut down JBoss when the jndi port is remapped.

This is because the default server connector profiles don't use their own alias for the jndiPort. This problem is also discussed at stackoverflow.com:
http://stackoverflow.com/questions/173487/problems-with-shut ting-down-jboss-in-eclipse-if-i-change-jndi-port

The solution comes from the .serverdef files in eclipse:
<eclipse> \plugins\org.eclipse.jst.server.generic.jboss_1.5.105.v20070 9061325\servers\jboss*.serverdef

They declare an xml property for the jndi port:

<property id="jndiPort"
label="%jndiPort"
type="string"
context="server"
default="1099" />

This simply needs to be used where the serverdef has the STOP command coded:

So this:
<stop>
<mainClass>org.jboss.Shutdown</mainClass>
<workingDirectory>${serverRootDirectory}/bin</workingDirectory >
<programArguments>-S</programArguments>
<vmParameters></vmParameters>
<classpathReference>jboss</classpathReference>
</stop>

becomes this:

<stop>
<mainClass>org.jboss.Shutdown</mainClass>
<workingDirectory>${serverRootDirectory}/bin</workingDirectory >
<programArguments>-s jnp://${serverAddress}:${jndiPort}</programArguments>
<vmParameters></vmParameters>
<classpathReference>jboss</classpathReference>
</stop>

The philosophy for this can be verified by comparison to the definition for the jndi connection:

<jndiConnection>
<providerUrl>jnp://${serverAddress}:${jndiPort}</providerUrl>
<initialContextFactory>org.jnp.interfaces.NamingContextFactory </initialContextFactory>
<jndiProperty>
<name></name>
<value></value>
</jndiProperty>
</jndiConnection>

Credit for the inspiration for this general case fix goes to: Moisa Laurentiu Florin. It was their contribution that got me to look for a way of substituting in the ${jndiPort} instead of a hard coded value.
Re: Bug in stopping JBoss? [message #509199 is a reply to message #206440] Thu, 21 January 2010 16:29 Go to previous messageGo to next message
Wolfgang Knauf is currently offline Wolfgang KnaufFriend
Messages: 63
Registered: July 2009
Member
Hi,

just for the records: I created a modified JBoss plugin and added this "stop" parameters: http://www.cs.hs-rm.de/~knauf/public/

Best regards

Wolfgang
Re: Bug in stopping JBoss? [message #539546 is a reply to message #489439] Fri, 11 June 2010 08:52 Go to previous message
Wolfgang Knauf is currently offline Wolfgang KnaufFriend
Messages: 63
Registered: July 2009
Member
Hi,

this was changed in JBoss 6.0.0M3.

The stop command is now:
"- s service:jmx:rmi:///jndi/rmi://localhost:1090/jmxrmi"

Not that the port also changed: it is no longer the JNDI port at 1099, but
RMI/JMX port 1090. So, you will need another config parameter in the server
definition.
More details: https://community.jboss.org/thread/152911 (more links in this
forum thread)

I don't know whether the "JNDI port" parameter is required at all for JBoss
6.0.0M3 servers.

My eclipse plugin at http://www.cs.hs-rm.de/~knauf/public/ contains a server
definition for 6.0.0M3 which contains this change.

Wolfgang
Previous Topic:Tomcat in Eclipse, Error 500 ClassNotFound for servlet
Next Topic:web-fragment.xml causes nested jar on deployment
Goto Forum:
  


Current Time: Fri Apr 26 23:06:44 GMT 2024

Powered by FUDForum. Page generated in 0.03475 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top