JBoss Cluster EJB Remoting - jboss

I currently have a JBoss instance running with standalone-ha.xml as the config file. JBoss 7.1.1 Final. I have deployed a basic HelloBean inside a .jar called ClusterTestEJB inside an .ear called ClusterTest.
HelloBean:
package com.sample;
import javax.ejb.Remote;
import javax.ejb.Stateless;
import org.jboss.ejb3.annotation.Clustered;
#Stateless
#Clustered
#Remote
public class HelloBean implements HelloBeanItf {
int counter = 0;
public String doSomething() {
return "HelloBean Called";
}
}
The HelloBeanItf is as follows:
package com.sample;
public interface HelloBeanItf {
public String doSomething();
}
I got the code from a tutorial I was following.
So I have everything seemingly working. I am now trying to write a java client to invoke that EJB. Here is that code:
import java.util.Properties;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import com.sample.HelloBeanItf;
public class Client {
public static void main(String[] args){
Properties p = new Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory");
p.put("jboss.naming.client.ejb.context", true);
p.put(Context.SECURITY_PRINCIPAL, "user");
p.put(Context.SECURITY_CREDENTIALS, "password");
p.put(Context.PROVIDER_URL, "remote://mynode:4447");
InitialContext ctx;
try {
ctx = new InitialContext(p);
} catch (NamingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
return;
}
HelloBeanItf ejb = null;
try {
ejb = (HelloBeanItf) ctx.lookup("java:ClusterTest/ClusterTestEJB//HelloBean!com.sample.HelloBeanItf");
} catch (NamingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
return;
}
for (int ii=0;ii<10;ii++) {
ejb.doSomething();
}
System.out.println("Terminated");
}
}
Here is client side log output:
Bad level value for property: java.util.logging.ConsoleHandler.level
Apr 03, 2014 10:49:30 PM org.jboss.logging.LoggerProviders find
DEBUG: Logging Provider: org.jboss.logging.JDKLoggerProvider
Apr 03, 2014 10:49:30 PM org.jboss.naming.remote.client.InitialContextFactory findClientProperties
DEBUG: Looking for jboss-naming-client.properties using classloader sun.misc.Launcher$AppClassLoader#6921dcac
Apr 03, 2014 10:49:30 PM org.jboss.naming.remote.client.InitialContextFactory getOptionMapFromProperties
DEBUG: jboss.naming.client.endpoint.create.options. has the following options {}
Apr 03, 2014 10:49:30 PM org.jboss.naming.remote.client.InitialContextFactory getOptionMapFromProperties
DEBUG: jboss.naming.client.remote.connectionprovider.create.options. has the following options {}
Apr 03, 2014 10:49:30 PM org.xnio.Xnio <clinit>
INFO: XNIO Version 3.0.3.GA
Apr 03, 2014 10:49:30 PM org.xnio.nio.NioXnio <clinit>
INFO: XNIO NIO Implementation Version 3.0.3.GA
Apr 03, 2014 10:49:30 PM org.jboss.remoting3.EndpointImpl <clinit>
INFO: JBoss Remoting version 3.2.3.GA
Apr 03, 2014 10:49:30 PM org.xnio.nio.WorkerThread run
DEBUG: Started channel thread 'Remoting "config-based-naming-client-endpoint" read-1', selector sun.nio.ch.WindowsSelectorImpl#3a151cc3
Apr 03, 2014 10:49:30 PM org.xnio.nio.WorkerThread run
DEBUG: Started channel thread 'Remoting "config-based-naming-client-endpoint" write-1', selector sun.nio.ch.WindowsSelectorImpl#42d2821b
Apr 03, 2014 10:49:30 PM org.jboss.naming.remote.client.InitialContextFactory getOptionMapFromProperties
DEBUG: jboss.naming.client.connect.options. has the following options {}
Apr 03, 2014 10:49:32 PM org.jboss.ejb.client.EJBClientPropertiesLoader loadEJBClientProperties
DEBUG: Looking for jboss-ejb-client.properties using classloader sun.misc.Launcher$AppClassLoader#6921dcac
Apr 03, 2014 10:49:32 PM org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector <init>
DEBUG: EJB client context org.jboss.ejb.client.EJBClientContext#51bc1897 will have no EJB receivers associated with it since there was no EJB client configuration available to create the receivers
Apr 03, 2014 10:49:32 PM org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver$1 handleDone
DEBUG: Channel Channel ID 828f699b (outbound) of Remoting connection 0d818ff0 to node1-w7.wv-lab.mentorg.com/139.181.88.6:4447 opened for context EJBReceiverContext{clientContext=org.jboss.ejb.client.EJBClientContext#7c572f78, receiver=Remoting connection EJB receiver [connection=Remoting connection <6981170d>,channel=jboss.ejb,nodename=node1]} Waiting for version handshake message from server
Apr 03, 2014 10:49:32 PM org.jboss.ejb.client.remoting.VersionReceiver handleMessage
INFO: Received server version 1 and marshalling strategies [river]
Apr 03, 2014 10:49:32 PM org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver associate
INFO: Successful version handshake completed for receiver context EJBReceiverContext{clientContext=org.jboss.ejb.client.EJBClientContext#7c572f78, receiver=Remoting connection EJB receiver [connection=Remoting connection <6981170d>,channel=jboss.ejb,nodename=node1]} on channel Channel ID 828f699b (outbound) of Remoting connection 0d818ff0 to node1-w7.wv-lab.mentorg.com/139.181.88.6:4447
Apr 03, 2014 10:49:32 PM org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver modulesAvailable
DEBUG: Received module availability report for 3 modules
Apr 03, 2014 10:49:32 PM org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver modulesAvailable
DEBUG: Registering module EJBModuleIdentifier{appName='', moduleName='ClusterWebApp', distinctName=''} availability for receiver context EJBReceiverContext{clientContext=org.jboss.ejb.client.EJBClientContext#7c572f78, receiver=Remoting connection EJB receiver [connection=Remoting connection <6981170d>,channel=jboss.ejb,nodename=node1]}
Apr 03, 2014 10:49:32 PM org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver modulesAvailable
DEBUG: Registering module EJBModuleIdentifier{appName='ClusterTest', moduleName='ClusterTest', distinctName=''} availability for receiver context EJBReceiverContext{clientContext=org.jboss.ejb.client.EJBClientContext#7c572f78, receiver=Remoting connection EJB receiver [connection=Remoting connection <6981170d>,channel=jboss.ejb,nodename=node1]}
Apr 03, 2014 10:49:32 PM org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver modulesAvailable
DEBUG: Registering module EJBModuleIdentifier{appName='ClusterTest', moduleName='ClusterTestEJB', distinctName=''} availability for receiver context EJBReceiverContext{clientContext=org.jboss.ejb.client.EJBClientContext#7c572f78, receiver=Remoting connection EJB receiver [connection=Remoting connection <6981170d>,channel=jboss.ejb,nodename=node1]}
Apr 03, 2014 10:49:32 PM org.jboss.ejb.client.remoting.ClusterNode resolveDestination
DEBUG: Checking for a match of client address /fe80:0:0:0:0:5efe:ac1e:5010%14 with client mapping ClientMapping{sourceNetworkAddress=/0:0:0:0:0:0:0:0, sourceNetworkMaskBits=0, destinationAddress='139.181.88.6', destinationPort=4447}
Apr 03, 2014 10:49:32 PM org.jboss.ejb.client.remoting.ClusterNode resolveDestination
DEBUG: Client mapping ClientMapping{sourceNetworkAddress=/0:0:0:0:0:0:0:0, sourceNetworkMaskBits=0, destinationAddress='139.181.88.6', destinationPort=4447} matches client address /fe80:0:0:0:0:5efe:ac1e:5010%14
Apr 03, 2014 10:49:32 PM org.jboss.ejb.client.remoting.ClusterTopologyMessageHandler processMessage
DEBUG: Received a cluster node(s) addition message, for cluster named ejb with 1 nodes [ClusterNode{clusterName='ejb', nodeName='node1', clientMappings=[ClientMapping{sourceNetworkAddress=/0:0:0:0:0:0:0:0, sourceNetworkMaskBits=0, destinationAddress='139.181.88.6', destinationPort=4447}], resolvedDestination=[Destination address=139.181.88.6, destination port=4447]}]
Apr 03, 2014 10:49:32 PM org.jboss.ejb.client.EJBClientContext getEJBReceiver
DEBUG: org.jboss.ejb.client.RandomDeploymentNodeSelector#5254e73f deployment node selector selected node1 node for appname=ClusterTest,modulename=ClusterTestEJB,distinctname=
Apr 03, 2014 10:49:33 PM org.jboss.ejb.client.EJBClientContext getEJBReceiver
DEBUG: org.jboss.ejb.client.RandomDeploymentNodeSelector#5254e73f deployment node selector selected node1 node for appname=ClusterTest,modulename=ClusterTestEJB,distinctname=
Apr 03, 2014 10:49:33 PM org.jboss.ejb.client.EJBClientContext getEJBReceiver
DEBUG: org.jboss.ejb.client.RandomDeploymentNodeSelector#5254e73f deployment node selector selected node1 node for appname=ClusterTest,modulename=ClusterTestEJB,distinctname=
Apr 03, 2014 10:49:33 PM org.jboss.remoting3.remote.ClientConnectionOpenListener$Authentication$1 run
DEBUG: Client authentication failed for mechanism DIGEST-MD5: javax.security.sasl.SaslException: DIGEST-MD5: Cannot perform callback to acquire realm, authentication ID or password [Caused by javax.security.auth.callback.UnsupportedCallbackException]
Apr 03, 2014 10:49:33 PM org.jboss.ejb.client.EJBClientContext getEJBReceiver
DEBUG: org.jboss.ejb.client.RandomDeploymentNodeSelector#5254e73f deployment node selector selected node1 node for appname=ClusterTest,modulename=ClusterTestEJB,distinctname=
Apr 03, 2014 10:49:33 PM org.jboss.remoting3.remote.RemoteConnection handleException
ERROR: JBREM000200: Remote connection failed: javax.security.sasl.SaslException: Authentication failed: all available authentication mechanisms failed
Apr 03, 2014 10:49:33 PM org.jboss.ejb.client.remoting.RemotingConnectionClusterNodeManager getEJBReceiver
INFO: Could not create a connection for cluster node ClusterNode{clusterName='ejb', nodeName='node1', clientMappings=[ClientMapping{sourceNetworkAddress=/0:0:0:0:0:0:0:0, sourceNetworkMaskBits=0, destinationAddress='139.181.88.6', destinationPort=4447}], resolvedDestination=[Destination address=139.181.88.6, destination port=4447]} in cluster ejb
java.lang.RuntimeException: javax.security.sasl.SaslException: Authentication failed: all available authentication mechanisms failed
at org.jboss.ejb.client.remoting.IoFutureHelper.get(IoFutureHelper.java:91)
at org.jboss.ejb.client.remoting.RemotingConnectionClusterNodeManager.getEJBReceiver(RemotingConnectionClusterNodeManager.java:117)
at org.jboss.ejb.client.ClusterContext$EJBReceiverAssociationTask.run(ClusterContext.java:333)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: javax.security.sasl.SaslException: Authentication failed: all available authentication mechanisms failed
at org.jboss.remoting3.remote.ClientConnectionOpenListener$Capabilities.handleEvent(ClientConnectionOpenListener.java:365)
at org.jboss.remoting3.remote.ClientConnectionOpenListener$Capabilities.handleEvent(ClientConnectionOpenListener.java:214)
at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:72)
at org.xnio.channels.TranslatingSuspendableChannel.handleReadable(TranslatingSuspendableChannel.java:189)
at org.xnio.channels.TranslatingSuspendableChannel$1.handleEvent(TranslatingSuspendableChannel.java:103)
at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:72)
at org.xnio.nio.NioHandle.run(NioHandle.java:90)
at org.xnio.nio.WorkerThread.run(WorkerThread.java:184)
at ...asynchronous invocation...(Unknown Source)
at org.jboss.remoting3.EndpointImpl.doConnect(EndpointImpl.java:270)
at org.jboss.remoting3.EndpointImpl.doConnect(EndpointImpl.java:251)
at org.jboss.remoting3.EndpointImpl.connect(EndpointImpl.java:349)
at org.jboss.remoting3.EndpointImpl.connect(EndpointImpl.java:333)
at org.jboss.ejb.client.remoting.RemotingConnectionClusterNodeManager.getEJBReceiver(RemotingConnectionClusterNodeManager.java:115)
... 6 more
Apr 03, 2014 10:49:33 PM org.jboss.ejb.client.EJBClientContext getEJBReceiver
DEBUG: org.jboss.ejb.client.RandomDeploymentNodeSelector#5254e73f deployment node selector selected node1 node for appname=ClusterTest,modulename=ClusterTestEJB,distinctname=
Apr 03, 2014 10:49:33 PM org.jboss.ejb.client.EJBClientContext getEJBReceiver
DEBUG: org.jboss.ejb.client.RandomDeploymentNodeSelector#5254e73f deployment node selector selected node1 node for appname=ClusterTest,modulename=ClusterTestEJB,distinctname=
Apr 03, 2014 10:49:33 PM org.jboss.ejb.client.EJBClientContext getEJBReceiver
DEBUG: org.jboss.ejb.client.RandomDeploymentNodeSelector#5254e73f deployment node selector selected node1 node for appname=ClusterTest,modulename=ClusterTestEJB,distinctname=
Apr 03, 2014 10:49:34 PM org.jboss.ejb.client.EJBClientContext getEJBReceiver
DEBUG: org.jboss.ejb.client.RandomDeploymentNodeSelector#5254e73f deployment node selector selected node1 node for appname=ClusterTest,modulename=ClusterTestEJB,distinctname=
Apr 03, 2014 10:49:34 PM org.jboss.ejb.client.EJBClientContext getEJBReceiver
DEBUG: org.jboss.ejb.client.RandomDeploymentNodeSelector#5254e73f deployment node selector selected node1 node for appname=ClusterTest,modulename=ClusterTestEJB,distinctname=
Apr 03, 2014 10:49:34 PM org.jboss.ejb.client.EJBClientContext getEJBReceiver
DEBUG: org.jboss.ejb.client.RandomDeploymentNodeSelector#5254e73f deployment node selector selected node1 node for appname=ClusterTest,modulename=ClusterTestEJB,distinctname=
Terminated
I have tried the following:
Removing the remoting security realm, removing the username and password. I am not sure what else to try at this point.
First time poster, so let me know if more details are needed or if you have questions.
Thanks for the help!

For the record, the inability to execute the EJB was fixed by upgrading from 7.1.1. to 7.1.3. After the upgrade, I was still getting the SASL exception, but the EJB was executing successfully.
The SASL exception was resolved by switching to using the ejb-client instead of the remote-naming libraries and adding clustering properties. Remote naming does not do load balancing anyway, so the switch was necessary for me.

Related

Why does Eclipse sometimes hang when my program connects to JBoss

Sometimes when I run my project, that connects to JBoss, it will hang.
For example here is the log output for when it hangs:
Dec 14, 2021 11:57:58 AM org.jboss.ejb.client.EJBClient <clinit>
INFO: JBoss EJB Client version 1.0.5.Final
Dec 14, 2021 11:57:58 AM org.xnio.Xnio <clinit>
INFO: XNIO Version 3.0.3.GA
Dec 14, 2021 11:57:58 AM org.xnio.nio.NioXnio <clinit>
INFO: XNIO NIO Implementation Version 3.0.3.GA
Dec 14, 2021 11:57:58 AM org.jboss.remoting3.EndpointImpl <clinit>
INFO: JBoss Remoting version 3.2.3.GA
Dec 14, 2021 11:57:58 AM org.jboss.ejb.client.remoting.VersionReceiver handleMessage
INFO: Received server version 2 and marshalling strategies [river]
Dec 14, 2021 11:57:58 AM org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver associate
INFO: Successful version handshake completed for receiver context EJBReceiverContext{clientContext=org.jboss.ejb.client.EJBClientContext#29f5ca0b, receiver=Remoting connection EJB receiver [connection=Remoting connection <71c88986>,channel=jboss.ejb,nodename=DevApp00:DevApp00]} on channel Channel ID ec955d48 (outbound) of Remoting connection 04a8743d to devapp00.magcore.XXXXXXXXXXXXX.com/XX.XX.XX.XXX:XXXX
Dec 14, 2021 11:57:59 AM org.jboss.ejb.client.remoting.VersionReceiver handleMessage
INFO: Received server version 2 and marshalling strategies [river]
Dec 14, 2021 11:57:59 AM org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver associate
INFO: Successful version handshake completed for receiver context EJBReceiverContext{clientContext=org.jboss.ejb.client.EJBClientContext#29f5ca0b, receiver=Remoting connection EJB receiver [connection=Remoting connection <6d5bcb39>,channel=jboss.ejb,nodename=DevApp01:DevApp01]} on channel Channel ID c9163bbe (outbound) of Remoting connection 50ba181a to devapp01.magcore.XXXXXXXXXXXXX.com/XX.XX.XX.XXX:XXXX
Dec 14, 2021 11:57:59 AM org.jboss.ejb.client.remoting.VersionReceiver handleMessage
INFO: Received server version 2 and marshalling strategies [river]
Dec 14, 2021 11:57:59 AM org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver associate
INFO: Successful version handshake completed for receiver context EJBReceiverContext{clientContext=org.jboss.ejb.client.EJBClientContext#29f5ca0b, receiver=Remoting connection EJB receiver [connection=Remoting connection <7900f3c9>,channel=jboss.ejb,nodename=DevApp01:DevApp01]} on channel Channel ID aa5e4733 (outbound) of Remoting connection 6075ef24 to /XX.XX.XX.XXX:XXXX
Here is the log output when it doesn't hang:
Dec 14, 2021 11:58:42 AM org.jboss.ejb.client.EJBClient <clinit>
INFO: JBoss EJB Client version 1.0.5.Final
Dec 14, 2021 11:58:42 AM org.xnio.Xnio <clinit>
INFO: XNIO Version 3.0.3.GA
Dec 14, 2021 11:58:42 AM org.xnio.nio.NioXnio <clinit>
INFO: XNIO NIO Implementation Version 3.0.3.GA
Dec 14, 2021 11:58:42 AM org.jboss.remoting3.EndpointImpl <clinit>
INFO: JBoss Remoting version 3.2.3.GA
Dec 14, 2021 11:58:43 AM org.jboss.ejb.client.remoting.VersionReceiver handleMessage
INFO: Received server version 2 and marshalling strategies [river]
Dec 14, 2021 11:58:43 AM org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver associate
INFO: Successful version handshake completed for receiver context EJBReceiverContext{clientContext=org.jboss.ejb.client.EJBClientContext#4ae0a5dc, receiver=Remoting connection EJB receiver [connection=Remoting connection <71ed5401>,channel=jboss.ejb,nodename=DevApp00:DevApp00]} on channel Channel ID b0b91086 (outbound) of Remoting connection 11244593 to devapp00.magcore.XXXXXXXXXXXXX.com/XX.XX.XX.XXX:XXXX
Dec 14, 2021 11:58:43 AM org.jboss.ejb.client.remoting.VersionReceiver handleMessage
INFO: Received server version 2 and marshalling strategies [river]
Dec 14, 2021 11:58:43 AM org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver associate
INFO: Successful version handshake completed for receiver context EJBReceiverContext{clientContext=org.jboss.ejb.client.EJBClientContext#4ae0a5dc, receiver=Remoting connection EJB receiver [connection=Remoting connection <3f7dbbe3>,channel=jboss.ejb,nodename=DevApp01:DevApp01]} on channel Channel ID a49da456 (outbound) of Remoting connection 7900f3c9 to devapp01.magcore.XXXXXXXXXXXXX.com/XX.XX.XX.XXX:XXXX
Dec 14, 2021 11:58:43 AM org.jboss.ejb.client.ClusterContext registerEJBReceiver
INFO: Added a new EJB receiver in cluster context ejb for node DevApp01:DevApp01. Total nodes in cluster context = 1
Dec 14, 2021 11:58:43 AM org.jboss.ejb.client.ClusterContext registerEJBReceiver
INFO: Added a new EJB receiver in cluster context ejb for node DevApp00:DevApp00. Total nodes in cluster context = 2
Here is my jboss-ejb-client.properties
endpoint.name=client-endpoint
remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=false
invocation.timeout=3000
reconnect.tasks.timeout=2000
remote.connections=dev1,dev2
remote.clusters=ejb
# Dev1 - Node 1
remote.connection.dev1.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false
remote.connection.dev1.connect.options.org.jboss.remoting3.RemotingOptions.HEARTBEAT_INTERVAL=300000
remote.connection.dev1.host=devapp00.magcore.XXXXXXXXXXXXX.com
remote.connection.dev1.port=XXXX
remote.connection.dev1.username=XXXXXXXXXX
remote.connection.dev1.password=XXXXXXXXXX
# Dev2 - Node 2
remote.connection.dev2.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false
remote.connection.dev2.connect.options.org.jboss.remoting3.RemotingOptions.HEARTBEAT_INTERVAL=300000
remote.connection.dev2.host=devapp01.magcore.XXXXXXXXXXXXX.com
remote.connection.dev2.port=XXXX
remote.connection.dev2.username=XXXXXXXXXX
remote.connection.dev2.password=XXXXXXXXXX
# cluster 1
remote.cluster.ejb.connect.timeout=2500
remote.cluster.ejb.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false
remote.cluster.ejb.connect.options.org.xnio.Options.SSL_ENABLED=false
remote.cluster.ejb.username=XXXXXXXXXX
#Dev Password
remote.cluster.ejb.password=XXXXXXXXXX
This morning I tried 26 times and is hung every time, but it doesn't always hang.
If I deploy this via WebStart, it seems to work just fine.
Interestingly, it seems as if it is hanging on setting up the cluster. I don't know why I didn't see this before, but it doesn't really help me solve the problem.

RemoteException in connecting to Tomee (OpenEJB)

Working from the hello world sample, what can I do on tleilax to allow doge to connect to the locally running OpenEJB server? I've read through the documentation on how startup OpenEJB, but must be missing a step from the manual.
On tleilax, deploying Hello.jar:
thufir#tleilax:~$ openejb deploy Hello.jar
Mar 07, 2015 10:34:30 PM org.apache.openejb.client.EventLogger log
INFO: RemoteInitialContextCreated{providerUri=ejbd://localhost:4201}
Mar 07, 2015 10:34:31 PM org.apache.openejb.client.EventLogger log
INFO: ConnectionOpened{uri=ejbd://localhost:4201}
Mar 07, 2015 10:34:31 PM org.apache.openejb.client.EventLogger log
INFO: ServerAdded{server=ejbds://127.0.0.1:4203} ClusterMetaDataUpdated{provider=ejbd://localhost:4201, version=1425796337772, uris=2}
Mar 07, 2015 10:34:31 PM org.apache.openejb.client.EventLogger log
INFO: ServerAdded{server=ejbd://127.0.0.1:4201} ClusterMetaDataUpdated{provider=ejbd://localhost:4201, version=1425796337772, uris=2}
Mar 07, 2015 10:34:31 PM org.apache.openejb.client.EventLogger log
INFO: ServerRemoved{server=ejbd://localhost:4201} ClusterMetaDataUpdated{provider=ejbd://localhost:4201, version=1425796337772, uris=2}
Application deployed successfully at "Hello.jar"
App(id=/home/thufir/apache-openejb-4.7.1/apps/Hello.jar)
EjbJar(id=Hello, path=/home/thufir/apache-openejb-4.7.1/apps/Hello.jar)
Ejb(ejb-name=HelloBean, id=HelloBean)
Jndi(name=HelloBeanRemote)
Jndi(name=global/Hello/HelloBean!org.acme.Hello)
Jndi(name=global/Hello/HelloBean)
some output from tleilax openejb showing the deploy:
INFO: OpenWebBeans Container has started, it took 241 ms.
Mar 07, 2015 10:34:32 PM org.apache.openejb.assembler.classic.Assembler startEjbs
INFO: Created Ejb(deployment-id=HelloBean, ejb-name=HelloBean, container=My Stateless Container)
Mar 07, 2015 10:34:32 PM org.apache.openejb.assembler.classic.Assembler startEjbs
INFO: Started Ejb(deployment-id=HelloBean, ejb-name=HelloBean, container=My Stateless Container)
Mar 07, 2015 10:34:32 PM org.apache.openejb.assembler.classic.Assembler createApplication
INFO: Deployed Application(path=/home/thufir/apache-openejb-4.7.1/apps/Hello.jar)
scanning tleilax for open ports:
thufir#doge:~$
thufir#doge:~$ nmap 192.168.1.3
Starting Nmap 6.46 ( http://nmap.org ) at 2015-03-07 22:42 PST
Nmap scan report for 192.168.1.3
Host is up (0.00092s latency).
Not shown: 998 closed ports
PORT STATE SERVICE
22/tcp open ssh
119/tcp open nntp
Nmap done: 1 IP address (1 host up) scanned in 0.06 seconds
thufir#doge:~$
the bound services on tleilax:
Mar 07, 2015 10:32:17 PM org.apache.openejb.server.SimpleServiceManager start
INFO: ** Bound Services **
Mar 07, 2015 10:32:17 PM org.apache.openejb.server.SimpleServiceManager printRow
INFO: NAME IP PORT
Mar 07, 2015 10:32:17 PM org.apache.openejb.server.SimpleServiceManager printRow
INFO: httpejbd 127.0.0.1 4204
Mar 07, 2015 10:32:17 PM org.apache.openejb.server.SimpleServiceManager printRow
INFO: multipoint 127.0.0.1 4212
Mar 07, 2015 10:32:17 PM org.apache.openejb.server.SimpleServiceManager printRow
INFO: admin 127.0.0.1 4200
Mar 07, 2015 10:32:17 PM org.apache.openejb.server.SimpleServiceManager printRow
INFO: ejbd 127.0.0.1 4201
Mar 07, 2015 10:32:17 PM org.apache.openejb.server.SimpleServiceManager printRow
INFO: multicast 239.255.2.3 6142
Mar 07, 2015 10:32:17 PM org.apache.openejb.server.SimpleServiceManager printRow
INFO: ejbds 127.0.0.1 4203
Mar 07, 2015 10:32:17 PM org.apache.openejb.server.SimpleServiceManager printRow
INFO: multipulse 239.255.2.3 6142
Mar 07, 2015 10:32:17 PM org.apache.openejb.server.SimpleServiceManager start
INFO: -------
Mar 07, 2015 10:32:17 PM org.apache.openejb.server.SimpleServiceManager start
INFO: Ready!
So, the server is ready on tleilax. Why can't the client connect properly?
thufir#doge:~$
thufir#doge:~$ java -classpath .:NetBeansProjects/HelloClient/dist/HelloClient.jar:apache-openejb-4.7.1/lib/openejb-client-4.7.1.jar:netbeans-8.0.2/enterprise/modules/ext/javaee-api-7.0.jar org.acme.HelloClient
Mar 07, 2015 10:49:46 PM org.apache.openejb.client.EventLogger log
INFO: RemoteInitialContextCreated{providerUri=ejbd://192.168.1.3:4201}
Mar 07, 2015 10:49:46 PM org.apache.openejb.client.EventLogger log
WARNING: ConnectionFailed{uri=ejbd://192.168.1.3:4201 cause=java.io.IOException: Cannot connect to server 'ejbd://192.168.1.3:4201'. Check that the server is started and that the specified serverURL is correct.}
Mar 07, 2015 10:49:46 PM org.apache.openejb.client.EventLogger log
WARNING: BootstrappingConnection{provider=ejbd://192.168.1.3:4201}
Mar 07, 2015 10:49:46 PM org.apache.openejb.client.EventLogger log
WARNING: ConnectionFailed{uri=ejbd://192.168.1.3:4201 cause=java.io.IOException: Cannot connect to server 'ejbd://192.168.1.3:4201'. Check that the server is started and that the specified serverURL is correct.}
Mar 07, 2015 10:49:46 PM org.apache.openejb.client.EventLogger log
SEVERE: ConnectionStrategyFailed{strategy=StickyConnectionStrategy, cluster=org.apache.openejb.client.ClusterMetaData#7d261f7f, server=ejbd://192.168.1.3:4201}
Exception in thread "main" javax.naming.NamingException: Cannot lookup '/HelloBeanRemote'. [Root exception is java.rmi.RemoteException: Unable to connect; nested exception is:
java.io.IOException: Cannot connect to server 'ejbd://192.168.1.3:4201'. Check that the server is started and that the specified serverURL is correct.]
at org.apache.openejb.client.JNDIContext.lookup(JNDIContext.java:405)
at javax.naming.InitialContext.lookup(InitialContext.java:411)
at org.acme.HelloClient.main(HelloClient.java:16)
Caused by: java.rmi.RemoteException: Unable to connect; nested exception is:
java.io.IOException: Cannot connect to server 'ejbd://192.168.1.3:4201'. Check that the server is started and that the specified serverURL is correct.
at org.apache.openejb.client.Client.processRequest(Client.java:167)
at org.apache.openejb.client.Client.request(Client.java:141)
at org.apache.openejb.client.JNDIContext.request(JNDIContext.java:211)
at org.apache.openejb.client.JNDIContext.lookup(JNDIContext.java:399)
... 2 more
Caused by: java.io.IOException: Cannot connect to server 'ejbd://192.168.1.3:4201'. Check that the server is started and that the specified serverURL is correct.
at org.apache.openejb.client.SocketConnectionFactory$SocketConnection.failure(SocketConnectionFactory.java:334)
at org.apache.openejb.client.SocketConnectionFactory$SocketConnection.open(SocketConnectionFactory.java:308)
at org.apache.openejb.client.SocketConnectionFactory.getConnection(SocketConnectionFactory.java:162)
at org.apache.openejb.client.ConnectionManager.getConnection(ConnectionManager.java:112)
at org.apache.openejb.client.AbstractConnectionStrategy.connect(AbstractConnectionStrategy.java:105)
at org.apache.openejb.client.AbstractConnectionStrategy.connect(AbstractConnectionStrategy.java:81)
at org.apache.openejb.client.ConnectionManager.getConnection(ConnectionManager.java:88)
at org.apache.openejb.client.Client.processRequest(Client.java:165)
... 5 more
Caused by: java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:579)
at org.apache.openejb.client.SocketConnectionFactory$SocketConnection.open(SocketConnectionFactory.java:300)
... 11 more
thufir#doge:~$
thufir#doge:~$
For what it's worth, I checked that the HelloClient runs locally from tleilax fine:
thufir#tleilax:~$
thufir#tleilax:~$ java -classpath .:HelloClient.jar:apache-openejb-4.7.1/lib/openejb-client-4.7.1.jar:netbeans-8.0.2/enterprise/modules/ext/javaee-api-7.0.jar org.acme.HelloClient
Mar 07, 2015 10:56:46 PM org.apache.openejb.client.EventLogger log
INFO: RemoteInitialContextCreated{providerUri=ejbd://127.0.0.1:4201}
Mar 07, 2015 10:56:46 PM org.apache.openejb.client.EventLogger log
INFO: ConnectionOpened{uri=ejbd://127.0.0.1:4201}
Mar 07, 2015 10:56:46 PM org.apache.openejb.client.EventLogger log
INFO: ServerAdded{server=ejbds://127.0.0.1:4203} ClusterMetaDataUpdated{provider=ejbd://127.0.0.1:4201, version=1425796337772, uris=2}
Hello World!!!!
thufir#tleilax:~$
Of course, the client running locally on tleilax connects to 127.0.0.1, while the client on doge connects, or tries to connect, to the ip adress for tleilax: 192.168.1.3; the ip address is hardcoded in the sample.

Eclipse Does not show Tomcat server logs in terminal console

I've been extensively looking for a very very simple way to display the tomcat ERRORS/WARNINGS logs in my eclipse terminal console, I cannot proceed with my development, because I can't see what error or warnings tomcat might be telling me, here is a sample server log output where I suspect a "no mapping found for http request with uri in dispatcherservlet", but does not being shown in the output
Sep 04, 2014 2:19:43 PM org.apache.catalina.core.AprLifecycleListener init
INFO: Loaded APR based Apache Tomcat Native library 1.1.30 using APR version 1.4.8.
Sep 04, 2014 2:19:43 PM org.apache.catalina.core.AprLifecycleListener init
INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
Sep 04, 2014 2:19:43 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.j2ee.server:OnlineStudentRegistration' did not find a matching property.
Sep 04, 2014 2:19:43 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.j2ee.server:Spring.MVC' did not find a matching property.
Sep 04, 2014 2:19:44 PM org.apache.catalina.core.AprLifecycleListener initializeSSL
INFO: OpenSSL successfully initialized (OpenSSL 1.0.1g 7 Apr 2014)
Sep 04, 2014 2:19:44 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-apr-8080"]
Sep 04, 2014 2:19:44 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-apr-8009"]
Sep 04, 2014 2:19:44 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1799 ms
Sep 04, 2014 2:19:44 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Sep 04, 2014 2:19:44 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/8.0.9
Sep 04, 2014 2:19:45 PM org.apache.catalina.util.SessionIdGenerator createSecureRandom
INFO: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [107] milliseconds.
Sep 04, 2014 2:19:48 PM org.apache.catalina.core.ApplicationContext log
INFO: No Spring WebApplicationInitializer types detected on classpath
Sep 04, 2014 2:19:49 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring FrameworkServlet 'dispatcher'
Sep 04, 2014 2:19:49 PM org.springframework.web.servlet.DispatcherServlet initServletBean
INFO: FrameworkServlet 'dispatcher': initialization started
Sep 04, 2014 2:19:49 PM org.springframework.web.context.support.XmlWebApplicationContext prepareRefresh
INFO: Refreshing WebApplicationContext for namespace 'dispatcher-servlet': startup date [Thu Sep 04 14:19:49 PDT 2014]; root of context hierarchy
Sep 04, 2014 2:19:49 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from ServletContext resource [/WEB-INF/dispatcher-servlet.xml]
Sep 04, 2014 2:19:51 PM org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping registerHandlerMethod
INFO: Mapped "{[/addStudent],methods=[POST],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public org.springframework.web.servlet.ModelAndView com.osr.controllers.StudentLoginController.studentLogin(com.osr.domain.Student,org.springframework.validation.BindingResult)
Sep 04, 2014 2:19:51 PM org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping registerHandlerMethod
INFO: Mapped "{[/],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public org.springframework.web.servlet.ModelAndView com.osr.controllers.StudentLoginController.student()
Sep 04, 2014 2:19:51 PM org.springframework.web.servlet.DispatcherServlet initServletBean
INFO: FrameworkServlet 'dispatcher': initialization completed in 2417 ms
Sep 04, 2014 2:19:56 PM org.apache.catalina.core.ApplicationContext log
INFO: No Spring WebApplicationInitializer types detected on classpath
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Sep 04, 2014 2:19:56 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Sep 04, 2014 2:19:57 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring FrameworkServlet 'dispatcher'
Sep 04, 2014 2:19:59 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-apr-8080"]
Sep 04, 2014 2:19:59 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-apr-8009"]
Sep 04, 2014 2:19:59 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 14373 ms
is there any configuration with tomcat? or eclipse I am missing here?
Try this instead
right click on your project, and click run as...
you will find something occurs on your console. I think it may be a bug!

how to specify port on grails run-war

I can do grails test run-war and everything works fine, but grails test -Dserver.port=8099 run-war gives me this error:
Running Grails application..
[delete] Deleting: C:\nsl\target\tomcat-out.txt
[delete] Deleting: C:\nsl\target\tomcat-err.txt
[java] Java Result: 1
java.lang.RuntimeException: tomcat exited prematurely with code '1' (error output: 'Aug 18, 2011 12:44:10 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-localhost%2F127.0.0.1-8099
Aug 18, 2011 12:44:10 PM org.apache.catalina.core.StandardService start
INFO: Starting service Tomcat
Aug 18, 2011 12:44:10 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0-snapshot
Aug 18, 2011 12:44:10 PM org.apache.catalina.startup.ContextConfig defaultWebConfig
INFO: No default web.xml
Aug 18, 2011 12:44:11 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/core is already defined
Aug 18, 2011 12:44:11 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/fmt is already defined
Aug 18, 2011 12:44:11 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://www.springframework.org/tags is already defined
Aug 18, 2011 12:44:12 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
LifecycleException: service.getName(): "Tomcat"; Protocol handler start failed: java.lang.NullPointerException
at org.apache.catalina.connector.Connector.start(Connector.java:1137)
at org.apache.catalina.core.StandardService.start(StandardService.java:530)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:708)
at org.apache.catalina.startup.Tomcat.start(Tomcat.java:286)
at org.grails.tomcat.IsolatedTomcat.main(IsolatedTomcat.java:101)
Error loading Tomcat: service.getName(): "Tomcat"; Protocol handler start failed: java.lang.NullPointerException
')
at org.grails.tomcat.TomcatServer.start(TomcatServer.groovy:183)
at grails.web.container.EmbeddableServer$start.call(Unknown Source)
at _GrailsRun_groovy$_run_closure5_closure12.doCall(_GrailsRun_groovy:158)
at _GrailsRun_groovy$_run_closure5_closure12.doCall(_GrailsRun_groovy)
at _GrailsSettings_groovy$_run_closure10.doCall(_GrailsSettings_groovy:280)
at _GrailsSettings_groovy$_run_closure10.call(_GrailsSettings_groovy)
at _GrailsRun_groovy$_run_closure5.doCall(_GrailsRun_groovy:149)
at _GrailsRun_groovy$_run_closure5.call(_GrailsRun_groovy)
at _GrailsRun_groovy.runWar(_GrailsRun_groovy:125)
at _GrailsRun_groovy.this$4$runWar(_GrailsRun_groovy)
at _GrailsRun_groovy$_run_closure3.doCall(_GrailsRun_groovy:73)
at RunWar$_run_closure1.doCall(RunWar:49)
at gant.Gant$_dispatch_closure5.doCall(Gant.groovy:381)
at gant.Gant$_dispatch_closure7.doCall(Gant.groovy:415)
at gant.Gant$_dispatch_closure7.doCall(Gant.groovy)
at gant.Gant.withBuildListeners(Gant.groovy:427)
at gant.Gant.this$2$withBuildListeners(Gant.groovy)
at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source)
at gant.Gant.dispatch(Gant.groovy:415)
at gant.Gant.this$2$dispatch(Gant.groovy)
at gant.Gant.invokeMethod(Gant.groovy)
at gant.Gant.executeTargets(Gant.groovy:590)
at gant.Gant.executeTargets(Gant.groovy:589)
Server failed to start: java.lang.RuntimeException: tomcat exited prematurely with code '1' (error output: 'Aug 18, 2011 12:44:10 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-localhost%2F127.0.0.1-8099
Aug 18, 2011 12:44:10 PM org.apache.catalina.core.StandardService start
INFO: Starting service Tomcat
Aug 18, 2011 12:44:10 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0-snapshot
Aug 18, 2011 12:44:10 PM org.apache.catalina.startup.ContextConfig defaultWebConfig
INFO: No default web.xml
Aug 18, 2011 12:44:11 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/core is already defined
Aug 18, 2011 12:44:11 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/fmt is already defined
Aug 18, 2011 12:44:11 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://www.springframework.org/tags is already defined
Aug 18, 2011 12:44:12 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
LifecycleException: service.getName(): "Tomcat"; Protocol handler start failed: java.lang.NullPointerException
at org.apache.catalina.connector.Connector.start(Connector.java:1137)
at org.apache.catalina.core.StandardService.start(StandardService.java:530)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:708)
at org.apache.catalina.startup.Tomcat.start(Tomcat.java:286)
at org.grails.tomcat.IsolatedTomcat.main(IsolatedTomcat.java:101)
Error loading Tomcat: service.getName(): "Tomcat"; Protocol handler start failed: java.lang.NullPointerException
')
To change the port on which grails loads you can do one of the following...
1. Change the port by launching grails with the following command line entry:
grails -Dserver.port=8099 run-app
2. If you want the application to run on 8099 by default, write the following line in you BuildConfig.groovy file.
grails.server.port.http=8099

Issue with Axis2 WebService running on Apache Tomcat 7

I have a web service application that I deployed successfully on Apache Tomcat using Eclipse IDE. However after a restart to my computer is not working any more. While trying to the list of services I get the following.
HTTP Status 404 - /ScWS/services/listServices
type Status report
message /ScWS/services/listServices
description The requested resource (/ScWS/services/listServices) is not available.
Apache Tomcat/7.0.11
When Tomcat is loading I see the following in the console logs:
Mar 19, 2011 10:46:57 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/lib/jvm/java-6-openjdk/jre/lib/amd64/server:/usr/lib/jvm/java-6-openjdk/jre/lib/amd64:/usr/lib/jvm/java-6-openjdk/jre/../lib/amd64:/usr/java/packages/lib/amd64:/usr/lib/jni:/lib:/usr/lib
Mar 19, 2011 10:47:05 PM org.apache.coyote.AbstractProtocolHandler init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Mar 19, 2011 10:47:05 PM org.apache.coyote.AbstractProtocolHandler init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Mar 19, 2011 10:47:05 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 10342 ms
Mar 19, 2011 10:47:06 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Mar 19, 2011 10:47:06 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.11
Mar 19, 2011 10:47:08 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor ScWS.xml from /home/blueprint/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/conf/Catalina/localhost
Mar 19, 2011 10:47:08 PM org.apache.catalina.startup.SetContextPropertiesRule begin
WARNING: [SetContextPropertiesRule]{Context} Setting property 'source' to 'org.eclipse.jst.jee.server:ScWS' did not find a matching property.
Mar 19, 2011 10:47:11 PM org.apache.coyote.AbstractProtocolHandler start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Mar 19, 2011 10:47:11 PM org.apache.coyote.AbstractProtocolHandler start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Mar 19, 2011 10:47:11 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 5593 ms
Anyone have any ideas what might be the Issue?
I deleted everything about Tomcat and installed again and everything was up and running.