Getting a NullPointerException from vertx - kubernetes

I have a vertx based java microservice running on a k8 cluster. When a new pod is installed, during the init I get this exception intermittently. Upgraded the vertx core and vertx web version from 3.5.3 to 3.9.3 but it didnt help. The app continues to be alive and fine after these exceptions. I wanted to know the root cause for this.
This is happening during init. Here is what I am doing during init
deploy verticle A:
vertx.deployVerticle(new Verticle_A(), serverOpts,this::deploymentHandler);
deploy verticle B:
vertx.deployVerticle(new Verticle_B(), serverOpts,this::deploymentHandler);
In each verticle I am doing:
httpServer = vertx.createHttpServer(serverOptions);
httpServer.requestHandler(req -> {
LOG.trace("Request hit the server " + req.absoluteURI());
});
httpServer.listen(Constants.PORT, (result) -> {
if (result.succeeded()) {
this.httpServer = result.result();
LOG.info("Successfully started server on port: " + Constants.PORT);
} else {
LOG.error("Failed to start server: ", result.cause());
}
});
Both the verticles are deployed successfully and the Http servers are started
I am new to vertx and k8s so any help would be appreciated.
SEVERE: Unhandled exception
java.util.NoSuchElementException: handler
at io.netty.channel.DefaultChannelPipeline.getContextOrDie(DefaultChannelPipeline.java:1073)
at io.netty.channel.DefaultChannelPipeline.addBefore(DefaultChannelPipeline.java:248)
at io.netty.channel.DefaultChannelPipeline.addBefore(DefaultChannelPipeline.java:237)
at io.vertx.core.http.impl.HttpHandlers.initializeWebsocketExtensions(HttpHandlers.java:92)
at io.vertx.core.http.impl.HttpHandlers.handle(HttpHandlers.java:69)
at io.vertx.core.http.impl.HttpHandlers.handle(HttpHandlers.java:34)
at io.vertx.core.impl.ContextImpl.executeTask(ContextImpl.java:366)
at io.vertx.core.impl.WorkerContext.lambda$wrapTask$0(WorkerContext.java:35)
at io.vertx.core.impl.TaskQueue.run(TaskQueue.java:76)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:830)
Oct 12, 2020 11:43:28 PM io.vertx.core.impl.ContextImpl
SEVERE: Unhandled exception
java.lang.NullPointerException
at io.vertx.core.http.impl.Http1xServerConnection.handleMessage(Http1xServerConnection.java:136)
at io.vertx.core.impl.ContextImpl.executeTask(ContextImpl.java:366)
at io.vertx.core.impl.WorkerContext.lambda$wrapTask$0(WorkerContext.java:35)
at io.vertx.core.impl.TaskQueue.run(TaskQueue.java:76)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:830)

Please try to provide more details next time but it seems you don't have "handler" but you tried to use it. I think it might be also not initialized properly. But I can't really know since you didn't provide source code.

Related

Javax.naming.NameNotFoundException using Javaee and Wildfly9

Hello I am facing this exception when trying to lookup the jndi name in order to do a junit test in my JavaEE project using Wildfly9 server:
javax.naming.NameNotFoundException: phenomenon-ejb/ClientSessionBean!utilities.CllientSessionBeanRemote -- service jboss.naming.context.java.jboss.exported.phenomenon-ejb."ClientSessionBean!utilities.CllientSessionBeanRemote"
at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:106)
at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:207)
at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:184)
at org.jboss.naming.remote.protocol.v1.Protocol$1.handleServerMessage(Protocol.java:127)
at org.jboss.naming.remote.protocol.v1.RemoteNamingServerV1$MessageReciever$1.run(RemoteNamingServerV1.java:73)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
This is the junit code I wrote:
public class JunitTester {
#org.junit.Test
public void Test() throws NamingException {
Context ctx = new InitialContext();
CllientSessionBeanRemote gest = (CllientSessionBeanRemote) ctx.lookup("/phenomenon-ejb/ClientSessionBean!"+ CllientSessionBeanRemote.class.getCanonicalName());
System.out.println(gest.Verify_No_Existence("Multiskan"));
}
}
Here is my jndi.properties file:
java.naming.factory.url.pkgs=org.jboss.ejb.client.naming
java.naming.factory.initial=org.jboss.naming.remote.client.InitialContextFactory
java.naming.provider.url=http-remoting://localhost:8080
jboss.naming.client.ejb.context=true
jboss.naming.client.connect.options.org.xnio.Options.SASL_POLICY_NOPLAINTEXT=false
And this is the output showed in the console when I deploy the application:
java:global/phenomenon-ear/phenomenon-ejb/ClientSessionBean!utilities.ClientSessionBean
java:app/phenomenon-ejb/ClientSessionBean!utilities.ClientSessionBean
java:module/ClientSessionBean!utilities.ClientSessionBean
java:global/phenomenon-ear/phenomenon-ejb/ClientSessionBean!utilities.CllientSessionBeanRemote
java:app/phenomenon-ejb/ClientSessionBean!utilities.CllientSessionBeanRemote
java:module/ClientSessionBean!utilities.CllientSessionBeanRemote
java:global/phenomenon-ear/phenomenon-ejb/ClientSessionBean!utilities.CllientSessionBeanLoacal
java:app/phenomenon-ejb/ClientSessionBean!utilities.CllientSessionBeanLoacal
java:module/ClientSessionBean!utilities.CllientSessionBeanLoacal
By the way the handshake is currectly done and my only problem is how to know the jndiname or why is the server not recognizing the one I wrote:
INFO: JBoss Remoting version 4.0.5.Beta1
juil. 22, 2020 2:08:34 PM org.jboss.ejb.client.remoting.VersionReceiver handleMessage
INFO: EJBCLIENT000017: Received server version 2 and marshalling strategies [river]
juil. 22, 2020 2:08:34 PM org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver associate
INFO: EJBCLIENT000013: Successful version handshake completed for receiver context EJBReceiverContext{clientContext=org.jboss.ejb.client.EJBClientContext#757942a1, receiver=Remoting connection EJB receiver [connection=Remoting connection <260479b4>,channel=jboss.ejb,nodename=desktop-k8fvkco]} on channel Channel ID a12ae3eb (outbound) of Remoting connection 651ca769 to localhost/127.0.0.1:8080
any advice could help, thanks.
The Wildfly Naming subsystem bind entries into the following global JNDI namespaces:
java:global
java:jboss
java:
However:
Only entries within the java:jboss/exported context are accessible
over remote JNDI.
Make sure your business objects are "properly exposed" with the #Remote annotation.
Check: Naming Subsystem ConfiguraAtion

com.mongodb.MongoTimeoutException: Timed out after 30000 ms while waiting to connect. Client view of cluster state is {type=UNKNOWN, servers=[]

We are trying to connect to Mongo Atlas from Java code using
URI "mongodb+srv::#serveraddress/dbname?retryWrites=true&w=1" but getting MongoTimeoutException exception.
Strange thing here is in exception trace servers=[] list is empty.
What could be the possible reasons for this error?
MongoDB Server and Java Driver Details:
MongoDB Server: 4.2
MongoDB java Driver: 3.12.5
spring-data-mongodb: 2.1.5.RELEASE
Please let me know if any further information needed.
Thank you for the help.
com.mongodb.MongoTimeoutException: Timed out after 30000 ms while waiting to connect. Client view of cluster state is {type=UNKNOWN, servers=[]
at com.mongodb.internal.connection.BaseCluster.getDescription(BaseCluster.java:182)
at com.mongodb.internal.connection.AbstractMultiServerCluster.getDescription(AbstractMultiServerCluster.java:54)
at com.mongodb.client.internal.MongoClientDelegate.getConnectedClusterDescription(MongoClientDelegate.java:152)
at com.mongodb.client.internal.MongoClientDelegate.createClientSession(MongoClientDelegate.java:103)
at com.mongodb.Mongo.createClientSession(Mongo.java:832)
at com.mongodb.MongoClient.startSession(MongoClient.java:582)
at com.mongodb.MongoClient.startSession(MongoClient.java:569)
at com.shutterfly.services.project.InitMongoDBCollection.onApplicationEvent(InitMongoDBCollection.java:36)
at com.shutterfly.services.project.InitMongoDBCollection.onApplicationEvent(InitMongoDBCollection.java:20)
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:402)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:359)
at org.springframework.boot.context.event.EventPublishingRunListener.running(EventPublishingRunListener.java:105)
at org.springframework.boot.SpringApplicationRunListeners.running(SpringApplicationRunListeners.java:78)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:332)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248)
at com.shutterfly.services.project.Application.main(Application.java:18)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:53)
at java.lang.Thread.run(Thread.java:748)
Adding the answer so that it should be helpful for others, who might see similar issue in future.
We have resolved this issue, The problem was it was taking time to find the list of clusters and connect to that with default time, we can use "MongoClientOptionsFactoryBean" to customised the parameters and can override the default configuration.
#Bean
public MongoClientOptionsFactoryBean getMongoClientOptionsFactoryBean() {
MongoClientOptionsFactoryBean mongoClientOptionsFactoryBean = new MongoClientOptionsFactoryBean();
mongoClientOptionsFactoryBean.setConnectTimeout(timeout);
mongoClientOptionsFactoryBean.setConnectionsPerHost(connectionsPerHost);
mongoClientOptionsFactoryBean.setMaxWaitTime(maxWaitTime);
mongoClientOptionsFactoryBean.setServerSelectionTimeout(ServerSelectionTimeout);
mongoClientOptionsFactoryBean.setThreadsAllowedToBlockForConnectionMultiplier(connMultiplier);
return mongoClientOptionsFactoryBean;
}
in my case mongo was simply not running :)
please, check it with:
systemctl status mongod.service
and make sure it is enabled before rebooting the server:
systemctl enable mongod.service
so I have same problem
I fix it by this code
use this import
import com.mongodb.client.MongoClient;
and this is the code
String web="mongodb://";
MongoClient mongoClient = MongoClients.create(web+ENVIRONMENT);
database = mongoClient.getDatabase("PUT_HERE_YOUR_DB_NAME");
MAYBE in some place you will need change the web
String web="mongodb+srv://"

Milo: Connect to (public) OPC-UA-Server

First of all: I'm a newbie to OPCUA. :)
I'm trying to connect an Milo Client to our Server but don't really understand whats going wrong. The sample Client and Server work fine together, but when I try to connect the client sample with one of the public OPC-UA-Test-Servers I get those exceptions:
15:48:34.729 [ua-netty-event-loop-0] DEBUG
org.eclipse.milo.opcua.stack.client.handlers.UaTcpClientAcknowledgeHandler
- Sent Hello message on channel=[id: 0xc22800c2, L:/10.22.19.217:58947 - R:opcua.demo-this.com/52.233.134.134:51210]. 15:48:34.729 [ua-netty-event-loop-0] WARN io.netty.channel.DefaultChannelPipeline -
An exceptionCaught() event was fired, and it reached at the tail of
the pipeline. It usually means the last handler in the pipeline did
not handle the exception. java.io.IOException: An existing connection
was forcibly closed by the remote host at
sun.nio.ch.SocketDispatcher.read0(Native Method) at
sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:43) at
sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223) at
sun.nio.ch.IOUtil.read(IOUtil.java:192) at
sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:380) at
io.netty.buffer.PooledUnsafeDirectByteBuf.setBytes(PooledUnsafeDirectByteBuf.java:221)
at
io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:898)
at
io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:242)
at
io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:119)
at
io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:528)
at
io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:485)
at
io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:399)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:371) at
io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:112)
at java.lang.Thread.run(Thread.java:745) 15:48:39.612
[ForkJoinPool.commonPool-worker-1] DEBUG
org.eclipse.milo.opcua.stack.client.ClientChannelManager - Channel
bootstrap failed: timed out waiting for acknowledge
org.eclipse.milo.opcua.stack.core.UaException: timed out waiting for
acknowledge at
org.eclipse.milo.opcua.stack.client.handlers.UaTcpClientAcknowledgeHandler.lambda$startHelloTimeout$4(UaTcpClientAcknowledgeHandler.java:156)
at
org.eclipse.milo.opcua.stack.client.handlers.UaTcpClientAcknowledgeHandler$$Lambda$27/469017260.run(Unknown
Source) at
io.netty.util.HashedWheelTimer$HashedWheelTimeout.expire(HashedWheelTimer.java:581)
at
io.netty.util.HashedWheelTimer$HashedWheelBucket.expireTimeouts(HashedWheelTimer.java:655)
at
io.netty.util.HashedWheelTimer$Worker.run(HashedWheelTimer.java:367)
at java.lang.Thread.run(Thread.java:745) 15:48:39.613 [main] ERROR
org.eclipse.milo.examples.client.ClientExampleRunner - Error running
example: UaException: status=Bad_Timeout, message=timed out waiting
for acknowledge java.util.concurrent.ExecutionException: UaException:
status=Bad_Timeout, message=timed out waiting for acknowledge at
java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:357)
at
java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1887)
at
org.eclipse.milo.examples.client.ClientExampleRunner.createClient(ClientExampleRunner.java:56)
at
org.eclipse.milo.examples.client.ClientExampleRunner.run(ClientExampleRunner.java:103)
at
org.eclipse.milo.examples.client.BrowseExample.main(BrowseExample.java:40)
Caused by: org.eclipse.milo.opcua.stack.core.UaException: timed out
waiting for acknowledge at
org.eclipse.milo.opcua.stack.client.handlers.UaTcpClientAcknowledgeHandler.lambda$startHelloTimeout$4(UaTcpClientAcknowledgeHandler.java:156)
at
org.eclipse.milo.opcua.stack.client.handlers.UaTcpClientAcknowledgeHandler$$Lambda$27/469017260.run(Unknown
Source) at
io.netty.util.HashedWheelTimer$HashedWheelTimeout.expire(HashedWheelTimer.java:581)
at
io.netty.util.HashedWheelTimer$HashedWheelBucket.expireTimeouts(HashedWheelTimer.java:655)
at
io.netty.util.HashedWheelTimer$Worker.run(HashedWheelTimer.java:367)
at java.lang.Thread.run(Thread.java:745) 15:48:42.842
[threadDeathWatcher-2-1] DEBUG io.netty.buffer.PoolThreadCache - Freed
2 thread-local buffer(s) from thread: ua-netty-event-loop-0
I took the sample-Code and removed the Certificate/Keypair and changed the URL to opc.tcp://opcua.demo-this.com:51210/UA/SampleServer since the public server doesn't need authorization:
SecurityPolicy securityPolicy = clientExample.getSecurityPolicy();
EndpointDescription[] endpoints = UaTcpStackClient.getEndpoints("opc.tcp://opcua.demo-this.com:51210/UA/SampleServer").get();
EndpointDescription endpoint = Arrays.stream(endpoints)
.filter(e -> e.getSecurityPolicyUri().equals(securityPolicy.getSecurityPolicyUri()))
.findFirst().orElseThrow(() -> new Exception("no desired endpoints returned"));
logger.info("Using endpoint: {} [{}]", endpoint.getEndpointUrl(), securityPolicy);
loader.load();
OpcUaClientConfig config = OpcUaClientConfig.builder()
.setApplicationName(LocalizedText.english("eclipse milo opc-ua client"))
.setApplicationUri("urn:eclipse:milo:examples:client")
//.setCertificate(loader.getClientCertificate())
//.setKeyPair(loader.getClientKeyPair())
.setEndpoint(endpoint)
.setIdentityProvider(clientExample.getIdentityProvider())
.setRequestTimeout(uint(5000))
.build();
return new OpcUaClient(config);
What am I missing?
Greetings and thanks in advance :)
Buried in that stack trace is the real problem: UaException: timed out waiting for acknowledge.
Maybe your firewall or network setup is blocking it, or maybe the server didn't send it back, but the problem is that the client never received the Acknowledge message in response to its Hello.
FWIW, I can run the ReadExample against that public server with no issue. In ReadExample I overrode getSecurityPolicy() and returned SecurityPolicy.None and in ClientExampleRunner just replaced the endpoint URL.

JBoss EJB application stops accepting connections

We are running a web application that is deployed as a single ear file to JBoss 7.1.1 and is using a number of ejb's. We having an issue where everything is working just fine but about twice a day the application stops accepting connections. When this happens the following shows up in the server log:
14:49:00,582 ERROR [org.jboss.remoting.remote.connection] (Remoting "step" read-1) JBREM000200: Remote connection failed: java.io.IOException: Received an invalid message length of 1195986768
The following also appears upstream in the log:
14:33:29,042 INFO [org.jboss.as.naming] (Remoting "step" task-3) JBAS011806: Channel end notification received, closing channel Channel ID 676ac4e7 (inbound) of Remoting connection 611812ed to null
14:33:50,071 ERROR [org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler] (EJB default - 10) Could not write method invocation result for method due to : org.jboss.remoting3.NotOpenException: Writes closed
at org.jboss.remoting3.remote.RemoteConnectionChannel.openOutboundMessage(RemoteConnectionChannel.java:107) [jboss-remoting-3.2.3.GA.jar:3.2.3.GA]
at org.jboss.remoting3.remote.RemoteConnectionChannel.writeMessage(RemoteConnectionChannel.java:296) [jboss-remoting-3.2.3.GA.jar:3.2.3.GA]
at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler.writeMethodInvocationResponse(MethodInvocationMessageHandler.java:330)
at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler.access$500(MethodInvocationMessageHandler.java:64)
at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler$1.run(MethodInvocationMessageHandler.java:226)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_45]
at java.util.concurrent.FutureTask.run(FutureTask.java:262) [rt.jar:1.7.0_45]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_45]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_45]
at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_45]
at org.jboss.threads.JBossThread.run(JBossThread.java:122) [jboss-threads-2.0.0.GA.jar:2.0.0.GA]
This is the exception we are seeing on the client side when we try to create an ejb connection
javax.naming.NamingException: Failed to create remoting connection [Root exception is java.lang.RuntimeException: Operation failed with status WAITING]
at org.jboss.naming.remote.client.ClientUtil.namingException(ClientUtil.java:36)
at org.jboss.naming.remote.client.InitialContextFactory.getInitialContext(InitialContextFactory.java:121)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:684)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:307)
at javax.naming.InitialContext.init(InitialContext.java:242)
at javax.naming.InitialContext.<init>(InitialContext.java:216)
Caused by: java.lang.RuntimeException: Operation failed with status WAITING
at org.jboss.naming.remote.protocol.IoFutureHelper.get(IoFutureHelper.java:89)
at org.jboss.naming.remote.client.NamingStoreCache.getRemoteNamingStore(NamingStoreCache.java:56)
at org.jboss.naming.remote.client.InitialContextFactory.getOrCreateCachedNamingStore(InitialContextFactory.java:166)
at org.jboss.naming.remote.client.InitialContextFactory.getOrCreateNamingStore(InitialContextFactory.java:139)
at org.jboss.naming.remote.client.InitialContextFactory.getInitialContext(InitialContextFactory.java:104)
... 91 more
So far we have been unable to figure out what is causing the application to stop accepting ejb connections.
We have been able to figure out that if we start jboss and remove the application (or try to connect to a fresh JBoss instance where the application has not been deployed) we get the exact same error right down to the number of bytes in the "invalid message length of" error if we try to get an ejb connection.
We can also get a similar error if we try to connect to the application using some other protocol (e.g. if we type http://localhost:4447 into a browser window we see a similar exception but the length of the message is different).
The code that attemts the ejb connection looks like this:
public void initialize(String host, int port, String instance, String user, String password) {
this.host = host;
this.port = port;
this.user = user;
if (instance != null) {
this.instance = instance;
}
final Properties jndiProperties = new Properties();
String providerURL = "remote://" + host + ":" + port;
jndiProperties.put(Context.INITIAL_CONTEXT_FACTORY, org.jboss.naming.remote.client.InitialContextFactory.class.getName());
jndiProperties.put(Context.PROVIDER_URL, providerURL);
jndiProperties.put("jboss.naming.client.ejb.context", true);
jndiProperties.put("jboss.naming.client.connect.options.org.xnio.Options.SASL_POLICY_NOPLAINTEXT", "false");
jndiProperties.put(Context.SECURITY_PRINCIPAL, user);
jndiProperties.put(Context.SECURITY_CREDENTIALS, password);
try {
context = new InitialContext(jndiProperties);
logger.info("JNDI context initialized.");
} catch (NamingException e) {
throw new RuntimeException(e);
}
}
When we open the JBoss admin console it indicates that the application is still deployed and enabled.
What would cause the application to stop accepting connections and given the errors we are seeing?
Any help would be greatly appreciated.
Thanks in advance.

JBoss- JMS - Failed to download and/or install client side AOP stack

When tried to build a JMS Client to get a connection to messaging on JBoss5(default configuration), I encounter this error(at line: Connection conn = qcf.createQueueConnection();). This is maven project with following libraries in classpath.
jboss:jnp-client:jar:4.0.2:compile
jboss:jboss-aop:jar:JBOSSAS-5.1:compile
jboss:jboss-messaging-client:jar:1.4.7.GA:compile
jboss:jbossall-client:jar:JBOSSAS-5.1:compile
jboss:jboss-common-core:jar:JBOSSAS-5.1:compile
jboss:jboss-mdr:jar:JBOSSAS-5.1:compile
jboss:jboss-logging-spi:jar:JBOSSAS-5.1:compile
org.jboss.remoting:jboss-remoting:jar:2.5.3.SP1:compile
For a very simple code this did not make sense. Any help is appreciated.
My code is as following:
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
env.put(Context.PROVIDER_URL, "jnp://localhost:1099");
env.put(Context.OBJECT_FACTORIES, "ConnectionFactory");
env.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
InitialContext iniCtx = new InitialContext(env);
Object tmp = iniCtx.lookup("java:/XAConnectionFactory");
QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
Connection conn = qcf.createQueueConnection();
The error I was getting is
Exception in thread "main" java.lang.RuntimeException: Failed to download and/or install client side AOP stack
at org.jboss.jms.client.JBossConnectionFactory.createConnectionInternal(JBossConnectionFactory.java:199)
at org.jboss.jms.client.JBossConnectionFactory.createQueueConnection(JBossConnectionFactory.java:101)
at org.jboss.jms.client.JBossConnectionFactory.createQueueConnection(JBossConnectionFactory.java:95)
at com.test.JMSExample.main(JMSExample.java:120)
Caused by: org.jboss.jms.exception.MessagingNetworkFailureException: Failed to connect client
at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.createClient(ClientConnectionFactoryDelegate.java:347)
at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.org$jboss$jms$client$delegate$ClientConnectionFactoryDelegate$getClientAOPStack$aop(ClientConnectionFactoryDelegate.java:246)
at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.getClientAOPStack(ClientConnectionFactoryDelegate.java)
at org.jboss.jms.client.ClientAOPStackLoader.load(ClientAOPStackLoader.java:75)
at org.jboss.jms.client.JBossConnectionFactory.createConnectionInternal(JBossConnectionFactory.java:192)
... 3 more
Caused by: java.lang.reflect.InvocationTargetException
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.jboss.remoting.InvokerRegistry.loadClientInvoker(InvokerRegistry.java:460)
at org.jboss.remoting.InvokerRegistry.createClientInvoker(InvokerRegistry.java:359)
at org.jboss.remoting.Client$6.run(Client.java:724)
at java.security.AccessController.doPrivileged(Native Method)
at org.jboss.remoting.Client.connect(Client.java:720)
at org.jboss.remoting.Client.connect(Client.java:668)
at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.createClient(ClientConnectionFactoryDelegate.java:343)
... 7 more
Caused by: java.lang.NoSuchMethodError: org.jboss.util.propertyeditor.PropertyEditors.mapJavaBeanProperties(Ljava/lang/Object;Ljava/util/Properties;Z)V
at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.mapJavaBeanProperties(MicroSocketClientInvoker.java:1359)
at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.setup(MicroSocketClientInvoker.java:533)
at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.<init>(MicroSocketClientInvoker.java:292)
at org.jboss.remoting.transport.socket.SocketClientInvoker.<init>(SocketClientInvoker.java:78)
at org.jboss.remoting.transport.bisocket.BisocketClientInvoker.<init>(BisocketClientInvoker.java:166)
at org.jboss.remoting.transport.bisocket.TransportClientFactory.createClientInvoker(TransportClientFactory.java:44)
... 18 more
It looks like there is a mismatch between JAR files or connectivity problem. Try to do following steps:
1) set -verbose:class option of JVM running JBoss AS and examine the output to find where MicroSocketClientInvoker.class comes from, it looks like JBoss couldn't find a method from it.
2) check if port 4457 is opened, because JBoss messaging connector uses default serverBindPort on 4457.
Hope it helps.
I had the same issue. The issue can be caused by several underlying root causes. In order to evaluate your specific root cause you need to look at the exception stack trace all the way down the "Caused by" exception the to root exception.
In my case the problem was caused by a truststore certificate file that had been corrupted due to incorrectly filtering it during processResources taks of my gradle project. Binary files get corrupted when they are filtered during processResources. For me the fix was to exclude the my certificate.truststore file from resource filtering.