search cancel

EJB Execution Step to support JBOSS 7 server

book

Article ID: 187920

calendar_today

Updated On:

Products

CA Application Test Service Virtualization

Issue/Introduction

Trying to use the EJB Execution step to connect to a JBOSS 7 server.

 For now we tried with the predefined “JBoss 3.2/4.0” from the server list. The (unproven?) assumption being that a JBOSS 4.0 client could still connect to a JBOSS 7 server. After making jbossall-client.jar available to the workstation we are running into below errors when connecting to JNDI:

 ERROR - Error loading JNDI Name List: javax.naming.CommunicationException: Could not obtain connection to any of these urls: 10.229.252.29:4547 and discovery failed with error: javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out] [Root exception is javax.naming.CommunicationException: Failed to retrieve stub from server 10.229.252.29:4547 [Root exception is java.io.StreamCorruptedException: invalid stream header: 0000001D]]

ERROR - Error loading JNDI Name List: javax.naming.CommunicationException: Could not obtain connection to any of these urls: 10.229.252.29:4447 and discovery failed with error: javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out] [Root exception is javax.naming.CommunicationException: Failed to retrieve stub from server 10.229.252.29:4447 [Root exception is java.io.StreamCorruptedException: invalid stream header: 0000001D]]

 DevTest EJB Execution Step connect to a JBOSS 7 server?

 

Cause

DevTest comes with client library needed to work with JBoss 3.2/4.0 which is LISA_HOME/hotDeploy/jbossall-client.jar. This JAR file may not work for JBoss EAP 7.1 and causing the issue.

Environment

All supported DevTest releases.

Resolution

1. Refer to section "Enterprise JavaBean Execution" in the documentation of the DevTest release you are running.
2. DevTest comes with client library needed to work with JBoss 3.2/4.0 which is nothing but LISA_HOME/hotDeploy/jbossall-client.jar. This JAR file may not work for JBoss EAP 7.1
3. In order to support a new version of JBoss, just follow the steps below.
     A. Copy the client JAR file  jboss-client.jar from JBoss server's bin\client folder and place it in LISA_HOME\hotDeploy folder
 
    B. Edit the file LISA_HOME\j2eeservers.xml in a text editor and add the following definition to support new version of JBoss.
 
  <Server>
      <name>JBOSS 7.0</name>
      <jndiDriver>org.jboss.naming.remote.client.InitialContextFactory</jndiDriver>
      <jndiUrlPrefix>remote://</jndiUrlPrefix>
      <jndiDefPort>4547</jndiDefPort>
      <jndiNeedsClass>false</jndiNeedsClass>
      <clientJarMsg>The JBOSS client driver is not installed.  This screen will help you put it there.</clientJarMsg>
      <jarName>jboss-client.jar</jarName>
      <noEJBClientMsg>We cannot find the EJB client jar.  This is the same jar you deploy to JBOSS.  Please provide it here so we can copy it into your Hot Deploy. In many cases you will find this jar inside of an EAR.</noEJBClientMsg>
      <doEJBCopy>true</doEJBCopy>
  </Server>
 
C. Edit the file lisa.properties in LISA_HOME to load the correct JAR file. Search for the entry 'LISA_JMX_JBOSS3240' and update the name of JAR file. 
LISA_JMX_JBOSS3240={{LISA_HOME}}/lib/mx4j.lib{{path.separator}}{{LISA_HOME}}/hotDeploy/jboss-client.jar

D. Just to be on the safe side, move the existing jbossall-client.jar file from LISA_HOME/hotDeploy to some other folder outside LISA_HOME.

4. Close workstation if it is open and launch it again
5. Choose the new JBoss Version in the EJB Test Step as shown below.

Additional Information

https://stackoverflow.com/questions/20732328/cannot-instantiate-class-org-jnp-interfaces-namingcontextfactory/20739137
https://developer.jboss.org/thread/223048
https://stackoverflow.com/questions/36007698/jboss-eap-6-error-in-creating-initialcontext
https://stackoverflow.com/questions/22990092/how-can-i-open-jboss-port-4447
https://stackoverflow.com/questions/52688497/cannot-deploy-kitchensink
BROADCOM CONFIDENTIAL INFORMATION
2 / 2 ©2016 Broadcom Corporation
https://developers.redhat.com/quickstarts/eap/ejb-remote/
https://stackoverflow.com/questions/11307316/how-to-change-port-number-in-jboss-7
https://developer.jboss.org/thread/274788
https://www.baeldung.com/wildfly-ejb-jndi
https://developer.jboss.org/thread/198813