Start a conversation

Datasource lookup is not working after an upgrade to 2020 R1 with JBoss application server.

Overview

You have a JSP page that is performing a remote JNDI lookup of the BizLogic data source that worked with Aurea Process (formerly known as CX Process, Savvion and SBM) 2015 SP1 with the Pramati application server but is now failing after upgrading to Aurea Process 2020 R1 with the JBoss application server. 

The following is the code used to perform the remote JNDI data source lookup that works with Aurea Process 2015 SP1 with Pramati:

ds = (DataSource)ctx.lookup(jndiDB); 
con = ds.getConnection();
stmt = con.createStatement();

When you try to run this same remote JNDI data source lookup with Aurea Process 2020 R1 with JBoss, you get the following error:

javax.naming.NameNotFoundException: jdbc/BizLogicDB -- service jboss.naming.context.java.jboss.exported.jdbc.BizLogicDB 
at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:103)
at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:197)
at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:174)
at org.jboss.naming.remote.protocol.v1.Protocol$1.handleServerMessage(Protocol.java:127) [jboss-remote-naming-1.0.8.Final-redhat-1.jar:1.0.8.Final-redhat-1]
at org.jboss.naming.remote.protocol.v1.RemoteNamingServerV1$MessageReciever$1.run(RemoteNamingServerV1.java:73) [jboss-remote-naming-1.0.8.Final-redhat-1.jar:1.0.8.Final-redhat-1]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_55]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_55]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_55]

Solution

Diagnosis

As per the information from the following discussions on the JBoss forum, the remote lookup of a data source is not supported in JBoss Enterprise Application Platform 6.x and JBoss Community Edition 7.x.

Solution Steps

The com.savvion.sbm.util.ServiceLocator class provided by Aurea Process can be used to perform a data source lookup.  The following code example will show how to include the com.savvion.sbm.util.ServiceLocator class and use the getDataSource method to retrieve the Aurea Process data source:

<%@page import="javax.naming.InitialContext,com.savvion.sbm.util.ServiceLocator,javax.naming.Context,java.sql.*,javax.sql.*, contentType="text/html;charset=UTF-8"%> 

private DataSource ds;
Connection con = null;
String jndiDB ="jdbc/SBMCommonDB";
ds = ServiceLocator.self().getDataSource(jndiDB);
con = ds.getConnection();
Note: Since the jdbc/BizLogicDB data source is only deployed on the EJB server and your JSP pages are executed on the portal server, you will not be able to access this data source in your JSP because JBoss doesn't allow a lookup to a data source that is external to portal server where the JSP is executed.

Testing

Once you have made the changes specified above, your JSP page will be able to perform a data source lookup to create an Aurea Process database connection.

Choose files or drag and drop files
Was this article helpful?
Yes
No
  1. Priyanka Bhotika

  2. Posted

Comments