This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Mastering Corda: Blockchain for Java Developers and have Jamiel Sheikh on-line!
See this thread for details.
Win a copy of Mastering Corda: Blockchain for Java Developers this week in the Cloud/Virtualization forum!

Frank VanOor

Ranch Hand
+ Follow
since Jun 18, 2004
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Frank VanOor

I've an EJB3 application deployed on Jboss 7.
As a test I wrote a client which calls a simple method on the remote bean. This method just returns an int value. The method is called x times in a loop. After about 30 times, JBoss closes the connection and the following message is displayed on the console

14:07:07,811 INFO [org.jboss.as.naming] (Remoting "alien2" task-1) JBAS011806: Channel end notification received, closing channel Channel ID 2ec193c9 (inbound) of Remoting connection 22c732c3 to null



On the client side, a Remote exception is received:

19 Nov 2013 14:07:07 INFO ChannelAssociation - Channel Channel ID f20f7f4a (outbound) of Remoting connection 46a3790d to localhost/127.0.0.1:4447 can no longer process messages
Exception in thread "main" 19 Nov 2013 14:07:07 ERROR RemoteNamingStoreV1 - Channel end notification received, closing channel Channel ID aec193c9 (outbound) of Remoting connection 46a3790d to localhost/127.0.0.1:4447
java.lang.reflect.UndeclaredThrowableException
at com.sun.proxy.$Proxy0.testRemoteConnection(Unknown Source)
at com.ecospeedtext.MainTest_1.main(MainTest_1.java:21)
Caused by: java.io.IOException: Channel Channel ID f20f7f4a (outbound) of Remoting connection 46a3790d to localhost/127.0.0.1:4447 has been closed
at org.jboss.ejb.client.remoting.ChannelAssociation$1.handleClose(ChannelAssociation.java:110)
at org.jboss.ejb.client.remoting.ChannelAssociation$1.handleClose(ChannelAssociation.java:102)
at org.jboss.remoting3.spi.SpiUtils.safeHandleClose(SpiUtils.java:54)
at org.jboss.remoting3.spi.AbstractHandleableCloseable$CloseHandlerTask.run(AbstractHandleableCloseable.java:501)
at org.jboss.remoting3.spi.AbstractHandleableCloseable.runCloseTask(AbstractHandleableCloseable.java:406)
at org.jboss.remoting3.spi.AbstractHandleableCloseable.closeComplete(AbstractHandleableCloseable.java:277)
at org.jboss.remoting3.remote.RemoteConnectionChannel.closeAction(RemoteConnectionChannel.java:517)
at org.jboss.remoting3.spi.AbstractHandleableCloseable.closeAsync(AbstractHandleableCloseable.java:359)
at org.jboss.remoting3.remote.RemoteConnectionHandler.closeAllChannels(RemoteConnectionHandler.java:382)
at org.jboss.remoting3.remote.RemoteConnectionHandler.sendCloseRequest(RemoteConnectionHandler.java:224)
at org.jboss.remoting3.remote.RemoteConnectionHandler.closeAction(RemoteConnectionHandler.java:368)
at org.jboss.remoting3.spi.AbstractHandleableCloseable.closeAsync(AbstractHandleableCloseable.java:359)
at org.jboss.remoting3.ConnectionImpl.closeAction(ConnectionImpl.java:52)
at org.jboss.remoting3.spi.AbstractHandleableCloseable.closeAsync(AbstractHandleableCloseable.java:359)
at org.jboss.remoting3.EndpointImpl.closeAction(EndpointImpl.java:201)
at org.jboss.remoting3.spi.AbstractHandleableCloseable.closeAsync(AbstractHandleableCloseable.java:359)
at org.jboss.naming.remote.client.EndpointCache.release(EndpointCache.java:58)
at org.jboss.naming.remote.client.EndpointCache$EndpointWrapper.closeAsync(EndpointCache.java:189)
at org.jboss.naming.remote.client.InitialContextFactory$1.close(InitialContextFactory.java:198)
at org.jboss.naming.remote.client.RemoteContext.finalize(RemoteContext.java:199)
at java.lang.ref.Finalizer.invokeFinalizeMethod(Native Method)
at java.lang.ref.Finalizer.runFinalizer(Unknown Source)
at java.lang.ref.Finalizer.access$100(Unknown Source)
at java.lang.ref.Finalizer$FinalizerThread.run(Unknown Source)



The Client Java code:



The remote method :



Many thanks in advance.

Frank
I removed the prefix from the context lookup , and now I can access the bean.
ctx.lookup("ecospeedtextear1-ear/ecospeedtextear1-ejb/LTextsEjbBean!com.ecospeed.text.ejb.LTextsEjbRemote");

Many thanks !!!

Frank
7 years ago
I've created a new project from maven archtype (Jboss ...). I had to rename because of Maven.
The ear file is now : ecospeedtextear1-ear.ear
The EJB jar is now : ecospeedtextear1-ejb.jar

The ear looks like this




On the console, I can see that JBoss is adding entries.




The bindings which are important are

java:global/ecospeedtextear1-ear/ecospeedtextear1-ejb/LTextsEjbBean!com.ecospeed.text.ejb.LTextsEjbRemote
java:app/ecospeedtextear1-ejb/LTextsEjbBean!com.ecospeed.text.ejb.LTextsEjbRemote
java:module/LTextsEjbBean!com.ecospeed.text.ejb.LTextsEjbRemote
java:jboss/exported/ecospeedtextear1-ear/ecospeedtextear1-ejb/LTextsEjbBean!com.ecospeed.text.ejb.LTextsEjbRemote
java:global/ecospeedtextear1-ear/ecospeedtextear1-ejb/LTextsEjbBean
java:app/ecospeedtextear1-ejb/LTextsEjbBean
java:module/LTextsEjbBean


Now, from a java client, I do a lookup :




I can see on JBoss log, the connection request due to --> new InitialContext(props);


But when context.lookup(...) is called , the following exception:





7 years ago
jar -tf ecospeedtextear-1.0.ear



jar -tf ecospeedtext-1.0.jar



console






7 years ago
I've put it in the root, redeployed it, but still the console doesn't show that jndi has new entires.
7 years ago
The jar which contains the ejb : ecospeedtext-1.0.jar
It's location is in the lib directory. Should the ejb jar be at the root of the ear ?

The content of application.xml

<?xml version="1.0" encoding="UTF-8"?>
<application xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_6.xsd" version="6">
<display-name>ecospeedtextear</display-name>
<library-directory>lib</library-directory>
</application>

thanks, Frank
7 years ago
jar -tf ecospeedtextear-1.0.ear

META-INF/
META-INF/MANIFEST.MF
lib/
lib/commons-codec-1.5.jar
lib/ecospeedtext-1.0.jar
lib/jcl-over-slf4j-1.7.5.jar
lib/junit-3.8.1.jar
lib/log4j-1.2.17.jar
lib/mediacreative-1.0.jar
lib/mysql-connector-java-5.1.18.jar
lib/poi-3.9.jar
lib/slf4j-api-1.7.5.jar
lib/slf4j-log4j12-1.7.5.jar
lib/slf4j-nop-1.7.5.jar
lib/slf4j-simple-1.7.5.jar
META-INF/application.xml
META-INF/maven/
META-INF/maven/com.ecospeed.text/
META-INF/maven/com.ecospeed.text/ecospeedtextear/
META-INF/maven/com.ecospeed.text/ecospeedtextear/pom.xml
META-INF/maven/com.ecospeed.text/ecospeedtextear/pom.properties



The output of the JBoss console :

Calling "C:\jboss-as-7.1.1.Final\bin\standalone.conf.bat"
===============================================================================

JBoss Bootstrap Environment

JBOSS_HOME: C:\jboss-as-7.1.1.Final

JAVA: C:\Program Files\Java\jdk1.7.0_45\bin\java

JAVA_OPTS: -XX:+TieredCompilation -Dprogram.name=standalone.bat -Xms64M -Xmx512M -XX:MaxPermSize=256M -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djava.net.preferIPv4Stack=true -Dorg.jb
ning=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djboss.server.default.config=standalone.xml

===============================================================================

13:11:36,064 INFO [org.jboss.modules] JBoss Modules version 1.1.1.GA
13:11:36,365 INFO [org.jboss.msc] JBoss MSC version 1.0.2.GA
13:11:36,404 INFO [org.jboss.as] JBAS015899: JBoss AS 7.1.1.Final "Brontes" starting
13:11:37,325 INFO [org.xnio] XNIO Version 3.0.3.GA
13:11:37,325 INFO [org.jboss.as.server] JBAS015888: Creating http management service using socket-binding (management-http)
13:11:37,333 INFO [org.xnio.nio] XNIO NIO Implementation Version 3.0.3.GA
13:11:37,340 INFO [org.jboss.remoting] JBoss Remoting version 3.2.3.GA
13:11:37,359 INFO [org.jboss.as.logging] JBAS011502: Removing bootstrap log handlers
13:11:37,629 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 31) JBAS010280: Activating Infinispan subsystem.
13:11:37,749 INFO [org.jboss.as.naming] (ServerService Thread Pool -- 38) JBAS011800: Activating Naming Subsystem
13:11:37,820 INFO [org.jboss.as.security] (ServerService Thread Pool -- 44) JBAS013101: Activating Security Subsystem
13:11:37,844 INFO [org.jboss.as.osgi] (ServerService Thread Pool -- 39) JBAS011940: Activating OSGi Subsystem
13:11:37,879 INFO [org.jboss.as.webservices] (ServerService Thread Pool -- 48) JBAS015537: Activating WebServices Extension
13:11:37,913 INFO [org.jboss.as.configadmin] (ServerService Thread Pool -- 26) JBAS016200: Activating ConfigAdmin Subsystem
13:11:38,394 INFO [org.jboss.as.security] (MSC service thread 1-1) JBAS013100: Current PicketBox version=4.0.7.Final
13:11:38,713 INFO [org.jboss.as.connector] (MSC service thread 1-13) JBAS010408: Starting JCA Subsystem (JBoss IronJacamar 1.0.9.Final)
13:11:38,886 INFO [org.jboss.as.naming] (MSC service thread 1-10) JBAS011802: Starting Naming Service
13:11:39,922 INFO [org.jboss.as.mail.extension] (MSC service thread 1-12) JBAS015400: Bound mail session [java:jboss/mail/Default]
13:11:40,724 INFO [org.jboss.ws.common.management.AbstractServerConfig] (MSC service thread 1-15) JBoss Web Services - Stack CXF Server 4.0.2.GA
13:11:40,826 INFO [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 27) JBAS010403: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3)
13:11:41,176 INFO [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-10) Starting Coyote HTTP/1.1 on http--127.0.0.1-8080
13:11:44,106 INFO [org.jboss.as.server.deployment.scanner] (MSC service thread 1-9) JBAS015012: Started FileSystemDeploymentService for directory C:\jboss-as-7.1.1.Final\standalone\deployments
13:11:44,245 INFO [org.jboss.as.remoting] (MSC service thread 1-3) JBAS017100: Listening on /127.0.0.1:4447
13:11:44,246 INFO [org.jboss.as.remoting] (MSC service thread 1-11) JBAS017100: Listening on /127.0.0.1:9999
13:11:44,865 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-1) JBAS010400: Bound data source [java:jboss/datasources/ExampleDS]
13:11:45,106 INFO [org.jboss.as] (Controller Boot Thread) JBAS015951: Admin console listening on http://127.0.0.1:9990
13:11:45,108 INFO [org.jboss.as] (Controller Boot Thread) JBAS015874: JBoss AS 7.1.1.Final "Brontes" started in 9300ms - Started 133 of 208 services (74 services are passive or on-demand)
13:11:50,391 INFO [org.jboss.as.repository] (HttpManagementService-threads - 2) JBAS014900: Content added at location C:\jboss-as-7.1.1.Final\standalone\data\content\97\3ca8e6bd6f39ce3d39f62ee4540d2fe0d3ae57\content
13:11:54,577 INFO [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015876: Starting deployment of "ecospeedtextear-1.0.ear"
13:11:56,549 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-7) JBAS010404: Deploying non-JDBC-compliant driver class com.mysql.jdbc.Driver (version 5.1)
13:11:56,930 INFO [org.jboss.as.server] (HttpManagementService-threads - 2) JBAS018559: Deployed "ecospeedtextear-1.0.ear"


7 years ago
I've a simple session bean which implements a remote interface.



Above bean and it's interface is packaged in a jar. This jar is then deployed in JBoss 7 correctly. I can access the bean remotely from a client application. On the console I can see how JBoss registers the bean in the JNDI.

JNDI bindings for session bean named LTextsEjbBean in deployment unit deployment "ecospeedtext-1.0.jar" are as follows:

java:global/ecospeedtext-1.0/LTextsEjbBean!com.ecospeed.text.ejb.LTextsEjbRemote
java:app/ecospeedtext-1.0/LTextsEjbBean!com.ecospeed.text.ejb.LTextsEjbRemote
java:module/LTextsEjbBean!com.ecospeed.text.ejb.LTextsEjbRemote
java:jboss/exported/ecospeedtext-1.0/LTextsEjbBean!com.ecospeed.text.ejb.LTextsEjbRemote
java:global/ecospeedtext-1.0/LTextsEjbBean
java:app/ecospeedtext-1.0/LTextsEjbBean
java:module/LTextsEjbBean

JNDI bindings for session bean named LTextsEjb in deployment unit deployment "ecospeedtext-1.0.jar" are as follows:

java:global/ecospeedtext-1.0/LTextsEjb!com.ecospeed.text.ejb.LTextsEjbRemote
java:app/ecospeedtext-1.0/LTextsEjb!com.ecospeed.text.ejb.LTextsEjbRemote
java:module/LTextsEjb!com.ecospeed.text.ejb.LTextsEjbRemote
java:jboss/exported/ecospeedtext-1.0/LTextsEjb!com.ecospeed.text.ejb.LTextsEjbRemote
java:global/ecospeedtext-1.0/LTextsEjb
java:app/ecospeedtext-1.0/LTextsEjb
java:module/LTextsEjb




The jar which contains the session bean will need to access other jars, so I need to package all the jars in an EAR file.

When I deploy this ear file, I don't see JBoss registering the session bean in the JNDI anymore. Also, the remote client is not working anymore. It throws an exception:

javax.naming.NameNotFoundException

My question : why is JBoss not registering the beans anymore ... or better ... what do I have to do so that JBoss sees the beans and registres them in JNDI ?

Many thanks, Frank
7 years ago
On another Forum I was given the solution:

This is produced by a example jsp (webapps/examples/jsp/simpletag/foo.jsp) with the following lines:

<eg:log>
Did you see me on the stderr window?
</eg:log>

7 years ago
Hi,

I've an application deployed on Tomcat 7, and this morning I noticed two messages on Tomcat console:

Did you see me on the stderr window?
Did you see me on the browser window as well?


Somebody managed to write remotely these messages. Do I have to be worried ? did somebody hack my website ?


thanks,

Frank
7 years ago
Thanks a lot for information.

Renaming stockdomain to ROOT seems an overkill. www.stock-domain.com:8080 can be "exposed" to the world. Tomcat may handle all requests directly.
I only need one redirect : from www.stock-domain.com to http://127.0.0.1:8080/stockdomain/financeMainLayout.htm. Can this be specified somehow in apache config ?


thanks,

Frank
7 years ago
I've added JkMount /* ajp13 at the end if the file mod_jk.conf.

Now, when entering www.stock-domain.com, I see the Tomcat welcome page.
Any suggestion how to forward to "http://www.stock-domain.com/stockdomain/financeMainLayout.htm".

Thanks,


Frank

7 years ago

Tanks for reply.
How can I make it for www.stock-domain.com ?
7 years ago
typing mistake C:\apache-tomcat-7.0.32\confworkers.properties --> C:\apache-tomcat-7.0.32\conf\workers.properties
7 years ago