Servlet problem in CF7->CF8 move

When trying to connect to an RMI Service from within a Java Servlet running on a Cold Fusion 8 server, our application is throwing an exception. The code is unchanged from what ran successfully on Cold Fusion 7. The interface that defines the RMI Service is:

public interface Request extends Remote, FsbConstants {
public Response handle(Datatable data) throws RemoteException;
}


the method where the RMI Call is being made and the problem is occuring is:

private Response getRequest(String service, Datatable data) {
try { return ((Request)Naming.lookup(service)).handle(data); }
catch (Exception excp) {
excp.printStackTrace();
return (new Response(Response.PAGE_NO_RMI_ERROR, data));
}
}


and the RMI method that is being called is:

public Response handle(Datatable data) throws RemoteException {
Processor processor = null;
Response result = null;
String action = null;
String page = null;
String sid = null;
Date fini, strt;
try {
sid = (String)data.get(SESSION_ID);
getSessionFromDb(sid, data);
action = getProcessorCode(INIData.get(((String)data.get(Processor.PROCESSOR)).trim()));
processor = getProcessor(action, data);
result = (Response)processor.process();
saveSessionToDb(sid, result);
}
catch(SQLException sqle) {
page = getPage(INIData.get(((String)data.get(PROCESSOR)).trim()));
sqle.printStackTrace();
return new Response(PAGE_SQL_ERROR, page, data);
}
catch(FsbException fsbe) {
page = getPage(INIData.get(((String)data.get(PROCESSOR)).trim()));
fsbe.printStackTrace();
return new Response(PAGE_RMI_ERROR, page, data);
}
return result;
}




Note that serveice is the name of the RMI service being connected to and data is an extension
of the standard Java Hash table. The exception that is thrown and its stack trace is as follows:

Exception: RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.net.MalformedURLException: no protocol: of
java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.net.MalformedURLException: no protocol: of
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:336)
at sun.rmi.transport.Transport$1.run(Transport.java:159)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:255)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:233)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:142)
at fsb.lib.request.RequestHandler_Stub.handle(Unknown Source)
at SingleSignOn.getRequest(SingleSignOn.java:320)
at SingleSignOn.doPost(SingleSignOn.java:569)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)
at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:284)
at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543)
at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:203)
at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428)
at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.net.MalformedURLException: no protocol: of
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:293)
at sun.rmi.transport.Transport$1.run(Transport.java:159)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.net.MalformedURLException: no protocol: of
at java.net.URL.<init>(URL.java:567)
at java.net.URL.<init>(URL.java:464)
at java.net.URL.<init>(URL.java:413)
at sun.rmi.server.LoaderHandler.pathToURLs(LoaderHandler.java:751)
at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:147)
at java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:620)
at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:247)
at sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.java:197)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1575)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1732)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
at sun.rmi.server.UnicastRef.unmarshalValue(UnicastRef.java:306)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:290)
... 9 more


We've tried setting the ports we're using as reserved so Windows doesn't assign them from the random pool, doesn't seem to have any effect on the issue.

Is there a setting or property we need to change to allow for an RMI connection from within cold fusion? Or any other suggestions? Any help is much appreciated. Thanks!
LVL 1
kcmurphy1Asked:
Who is Participating?
 
kcmurphy1Author Commented:
Reinstalling from scratch fixed the problem.
0
 
TimYatesCommented:
Can you print out the service in:

private Response getRequest(String service, Datatable data) {

It looks like it's getting passed an incorrect value
0
 
kcmurphy1Author Commented:
The values the getRequest(String service, Datatable data) method is
receiving are correct as the following listing shows.  The service is
the name of the RMI service and the data is a hashtable of name/value
pair strings:

Service: //172.55.192.51:1098/RequestProcessor
Data: {fsbSessionId=4A7D4E0C6C4C426AB5AA625A95E8DE80,
      newSessionId=false,
      processor=IOBPW111,
      userNumber=JavaProf}
Naming:  RequestHandler_Stub[UnicastRef [liveRef: [endpoint:[172.55.192.51:1152](remote),objID:[-1b56c07f:11659df3130:-7fff, -1499502016227772353]]]]
0
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

 
TimYatesCommented:
The exception you are getting is because the service has no protocol...

And if you look at the URL passed as the service, it indeed has no protocol...

Shouldn't it be:

    rmi://172.55.192.51:1098/RequestProcessor
0
 
kcmurphy1Author Commented:
Thank you TimYates:

We have tried it with and without the scheme and it still does not work.  Also the Java 1.4.2 documentation states that the scheme is unnecessary.  

The Naming class provides methods for storing and obtaining references to remote objects in a remote object registry. Each method of the Naming class takes as one of its arguments a name that is a java.lang.String in URL format (without the scheme component) of the form:

    //host:port/name
 
where host is the host (remote or local) where the registry is located, port is the port number on which the registry accepts calls, and where name is a simple string uninterpreted by the registry. Both host and port are optional.  If host is omitted, the host defaults to the local host. If port is omitted, then the port defaults to 1099, the "well-known" port that RMI's registry, rmiregistry, uses.
0
 
kcmurphy1Author Commented:
Thank you TimYates for your help.  We have tried it with and without the scheme and it still does not work.  Also the Java 1.4.2 documentation states that the scheme is unnecessary.  

The Naming class provides methods for storing and obtaining references to remote objects in a remote object registry. Each method of the Naming class takes as one of its arguments a name that is a java.lang.String in URL format (without the scheme component) of the form:

    //host:port/name
 
where host is the host (remote or local) where the registry is located, port is the port number on which the registry accepts calls, and where name is a simple string uninterpreted by the registry. Both host and port are optional.  If host is omitted, the host defaults to the local host. If port is omitted, then the port defaults to 1099, the "well-known" port that RMI's registry, rmiregistry, uses.
0
 
TimYatesCommented:
Is it still on Java 1.4.2 after the upgrade?

(just checking) ;-)
0
 
kcmurphy1Author Commented:
Sorry for the delay Tim.

I will be running Java 1.6.0_01 and CF 8,0,0,176276 coming from Java 1.4.2_09  and CF 7,0,2,142559  

Your assistance is greatly appreciated!
0
 
kcmurphy1Author Commented:
If anyone could provide further assistance with this matter, it would be greatly appreciated. We need to complete the upgrade by mid-december in support of a separate project.

The removal of the protocol is correct for Java 1.6:
http://java.sun.com/javase/6/docs/api/java/rmi/Naming.html
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.