Custom Class issue with GCF

Greetings All,

I am working on creating a custom class that will DES, then BASE64 encrypt a string and pass it back to the GCF for posting. The JAVA compiles fine, but won't run on the command-line. It is based on Sungard's Sample.java file found in /opt/luminis/webapps/cpipconnector/WEB-INF/config/sample/. I've created the class file in /opt/luminis/webapps/cpipconnector/WEB-INF/classes/com/campuspipeline/sso/authenticator/custom/ as directed by Sungard Support. However, when it is run on the command-line, I receive the following error:

 

Exception in thread "main" java.lang.NoClassDefFoundError: TFShim (wrong name: com/campuspipeline/sso/authenticator/custom/TFShim)
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)

 

Sungard Support also received this error when they attempted to run the Sample.java file.

When the GCF hits the custom class, it generates the following error in the cpipconnector.log:

 

[2010-03-05 16:25:50,930] [ERROR] http-8008-Processor25:/powerfaids/Authenticate com.campuspipeline.sso.authenticator.SSOOperations.authenticateUser:218
>>> authentication failed with exception:
java.lang.InstantiationException: com.campuspipeline.sso.authenticator.custom.TFShim
        at java.lang.Class.newInstance0(Class.java:335)
        at java.lang.Class.newInstance(Class.java:303)
        at com.campuspipeline.sso.authenticator.HttpSteps.opCall(HttpSteps.java:1212)
        at com.campuspipeline.sso.authenticator.HttpSteps.opExecuteSession(HttpSteps.java:1271)
        at com.campuspipeline.sso.authenticator.HttpSteps.opSession(HttpSteps.java:1370)
        at com.campuspipeline.sso.authenticator.HttpSteps.opExecuteClient(HttpSteps.java:1383)
        at com.campuspipeline.sso.authenticator.HttpSteps.opClient(HttpSteps.java:1410)
        at com.campuspipeline.sso.authenticator.HttpSteps.opExecute(HttpSteps.java:1425)
        at com.campuspipeline.sso.authenticator.HttpSteps.Execute(HttpSteps.java:1454)
        at com.campuspipeline.sso.authenticator.SSOOperations.authenticateUser(SSOOperations.java:158)
        at com.campuspipeline.cpipconnector.CpipOperationsDefault.perform1_3_6_1_4_1_4409_1_1_4_2(CpipOperationsDefault.java:221)
        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:585)
        at com.campuspipeline.cpipconnector.CpipOperationsBase.perform(CpipOperationsBase.java:63)
        at com.campuspipeline.cpipconnector.CpipConnectorServlet.doPost(CpipConnectorServlet.java:164)
        at com.campuspipeline.cpipconnector.CpipConnectorServlet.doGet(CpipConnectorServlet.java:103)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:627)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:875)
        at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
        at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
        at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
        at java.lang.Thread.run(Thread.java:595)
 

Now this is the part where I admit that I am a complete novice at JAVA. I believe the fix would be to add a main in to the script, but I don't knowwhere or how, or if that is even the answer. I am posting all of my files so that anyone may use them, and hopefully someone can help me.

 

Thank You!

Bill

wshew at framingham dot edu

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

custom class

http://www.cs.usfca.edu/~parrt/course/601/lectures/java.tools.html

 

Check out the packages and directory section.  I'm not a java wiz either, but I think it has to do with knowing how to call the file correctly given its package and directory structure.  

 

 

Suggested fixes

From looking at this:

  1. The problem with running from the command line looks to be that you are giving the file name and not the class name on the command line.  You should use the class name com.campuspipeline.... instead of com/campuspipeline/...
  2. Your problem with GCF calling it is that the class must have an implicit or explicit no arguments constructor.  Your constructor has multiple arguments, which GCF does not know how to instantiate.

Thank you both!

Thank you both for your replies. I am still plugging away at this. I've also learned that the class must be the same name as your connector. Odd but true!

Class name

Actually, with the right parameters to the CALL element you can use any class name you want.  Here is an example from one of our GCF files:

       <CALL a:class="edu.ipfw.luminis.mapWorks.Authenticate">
           <PARAM a:value="URL"/>
       </CALL>

In this case, URL was the name of the return variable in which to put results of call.  The "Authenticate" class uses a web service call to get the URL the particular person would use to access the application in question.

The Java code (with out the guts) looks like:

package edu.ipfw.luminis.mapWorks;

import com.campuspipeline.sso.authenticator.ExternalAuthenticationProcessor;

public class Authenticate implements ExternalAuthenticationProcessor {
    public void Process(SymbolTable st, String[] args) {
        String u = st.getValue("${_USERNAME}");
        String r = // calculate the return URL;
        st.setValue(args[0], r);
    }
}

Syndicate content