Agile 9.3.5 – Unable to login with SDK/API (60002)

Answered

Hi there all, I’m very new to java and Agile SDK development, and have been tasked to work on some basic apps that connect from a 3rd party application to Agile in order to exchange data.

At this point, I’m just attempting to create a session using the SDK, but I’m unsure of the error I’m getting. I’ve done some searching of the forums, but wasn’t able to find anything, maybe because my problem is too simple. I’ve basically copied the “Login” sample that comes with the SDK, and I get the same error when I run the .bat included in the sample folder, with my assumption on the correct parameters.

I would be grateful for any guidance anyone is willing to provide, and willing to add if more information is needed,

Agile Info:

9.3.5 (build 45)

HTTPS (certificate has been downloaded and added to the JRE)

Environment:

Maven project in Eclipse

AgileAPI.jar from 9.3.5 SDK (In ModulePath as Eclipse wouldn’t accept it correctly in Classpath)

JRE = jdk-11.0.5.10-hotspot

Compiler = 11

Relevant Code:

public static IAgileSession connect(final String strAgileURL, String strUsername, String strPassword) throws APIException{

/**factory = AgileSessionFactory.getInstance(URL); */

HashMap params = new HashMap();
params.put(AgileSessionFactory.USERNAME, strUsername);

params.put(AgileSessionFactory.PASSWORD, strPassword);

params.put(AgileSessionFactory.URL, strAgileURL);

/** session = factory.createSessionEx(params);*/

AgileSessionFactory instance = AgileSessionFactory.refreshInstanceEx(params);

//IAgileSession session = AgileSessionFactory.createSessionEx(params);
return (IAgileSession) instance.createSession(params);

}
public static Boolean disconnect(final IAgileSession session) throws APIException{

try {

session.close();

return true;

} catch (Exception e) {

e.printStackTrace();

return false;

}

}

Error:

WARNING: An illegal reflective access operation has occurred

WARNING: Illegal reflective access by weblogic.rjvm.MsgAbbrevInputStream to method java.io.ObjectInputStream.clear()

WARNING: Please consider reporting this to the maintainers of weblogic.rjvm.MsgAbbrevInputStream

WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations

WARNING: All illegal access operations will be denied in a future release

java.lang.NoClassDefFoundError: java/sql/Wrapper

at java.base/java.lang.ClassLoader.defineClass1(Native Method)

at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016)

at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:877)

at AgileAPI/com.agile.api.NetworkClassLoader.findClass(NetworkClassLoader.java:81)

at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)

at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)

at java.base/java.lang.Class.forName0(Native Method)

at java.base/java.lang.Class.forName(Class.java:315)

at weblogic.transaction.internal.PlatformHelper.getPlatformHelper(PlatformHelper.java:29)

at weblogic.transaction.internal.TransactionHelperImpl.<clinit>(TransactionHelperImpl.java:18)

at java.base/java.lang.Class.forName0(Native Method)

at java.base/java.lang.Class.forName(Class.java:315)

at weblogic.transaction.TransactionHelper.getTransactionHelper(TransactionHelper.java:71)

at weblogic.common.internal.RMIBootServiceImpl_12130_WLStub.authenticate(Unknown Source)

at weblogic.security.acl.internal.Security$1.run(Security.java:184)

at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)

at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)

at weblogic.security.acl.internal.Security.authenticate(Security.java:180)

at weblogic.security.acl.internal.Security.authenticate(Security.java:145)

at weblogic.security.auth.Authenticate.authenticate(Authenticate.java:112)

at com.agile.api.common.WebLogicAuthenticator.login(WebLogicAuthenticator.java:74)

at com.agile.api.pc.Session.authenticate(Session.java:1154)

at com.agile.api.pc.Session.<init>(Session.java:231)

at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)

at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)

at AgileAPI/com.agile.api.AgileSessionFactory.createSession(AgileSessionFactory.java:1061)

at wsDYNState/wsDYNState.agile.connect(agile.java:56)

at wsDYNState/wsDYNState.functions.main(functions.java:119)

Caused by: java.lang.ClassNotFoundException: java.sql.Wrapper

at AgileAPI/com.agile.api.NetworkClassLoader.findClass(NetworkClassLoader.java:86)

at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)

at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)

... 30 more

Caused by: java.io.IOException: Prohibited package for class: java.sql.Wrapper

at AgileAPI/com.agile.api.NetworkClassLoader.loadClassData(NetworkClassLoader.java:320)

at AgileAPI/com.agile.api.NetworkClassLoader.findClass(NetworkClassLoader.java:80)

... 32 more

java.lang.NoClassDefFoundError: java/sql/Wrapper

at java.base/java.lang.ClassLoader.defineClass1(Native Method)

at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016)

at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:877)

at AgileAPI/com.agile.api.NetworkClassLoader.findClass(NetworkClassLoader.java:81)

at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)

at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)

at java.base/java.lang.Class.forName0(Native Method)

at java.base/java.lang.Class.forName(Class.java:315)

at weblogic.transaction.internal.PlatformHelper.getPlatformHelper(PlatformHelper.java:29)

at weblogic.transaction.internal.TransactionHelperImpl.<clinit>(TransactionHelperImpl.java:18)

at java.base/java.lang.Class.forName0(Native Method)

at java.base/java.lang.Class.forName(Class.java:315)

at weblogic.transaction.TransactionHelper.getTransactionHelper(TransactionHelper.java:71)

at weblogic.common.internal.RMIBootServiceImpl_12130_WLStub.authenticate(Unknown Source)

at weblogic.security.acl.internal.Security$1.run(Security.java:184)

at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)

at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)

at weblogic.security.acl.internal.Security.authenticate(Security.java:180)

at weblogic.security.acl.internal.Security.authenticate(Security.java:145)

at weblogic.security.auth.Authenticate.authenticate(Authenticate.java:112)

at com.agile.api.common.WebLogicAuthenticator.login(WebLogicAuthenticator.java:74)

at com.agile.api.pc.Session.authenticate(Session.java:1154)

at com.agile.api.pc.Session.<init>(Session.java:231)

at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)

at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)

at AgileAPI/com.agile.api.AgileSessionFactory.createSession(AgileSessionFactory.java:1061)

at wsDYNState/wsDYNState.agile.connect(agile.java:56)

at wsDYNState/wsDYNState.functions.main(functions.java:119)

Caused by: java.lang.ClassNotFoundException: java.sql.Wrapper

at AgileAPI/com.agile.api.NetworkClassLoader.findClass(NetworkClassLoader.java:86)

at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)

at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)

... 30 more

Caused by: java.io.IOException: Prohibited package for class: java.sql.Wrapper

at AgileAPI/com.agile.api.NetworkClassLoader.loadClassData(NetworkClassLoader.java:320)

at AgileAPI/com.agile.api.NetworkClassLoader.findClass(NetworkClassLoader.java:80)

... 32 more

Error code : 60002

Error message : You have not logged in.

Root Cause exception : java.lang.NoClassDefFoundError: java/sql/Wrapper
at AgileAPI/com.agile.api.AgileSessionFactory.createSession(AgileSessionFactory.java:1075)

at wsDYNState/wsDYNState.agile.connect(agile.java:56)

at wsDYNState/wsDYNState.functions.main(functions.java:119)

Exception in thread "main" java.lang.AssertionError: Exception caught: You have not logged in.

at junit@4.12/org.junit.Assert.fail(Assert.java:88)

at wsDYNState/wsDYNState.functions.main(functions.java:127)
Add Comment
1 Answer(s)
Best answer

Hello Warren

Looks like you are using the wrong Java version. It needs to match the server version. Please try with 1.8.0 minor version 51 or higher

Here is a snippet from the SDK manual

<<

Java Requirements

The Agile API must be compatible with the version of Java that the application server supports. To avoid problems, an Agile API Client must use the same version of Java that the connecting Oracle WebLogic Server 12.13 running the Sun Java Runtime Environment (JRE) 1.8 for interoperability and 2007 Daylight Saving Time compliance

>

Hope this helps

– Raj

 

Agile Expert Answered on January 15, 2020.

Thank you! This was the solution. I attempted 1.8 previously, but I don’t believe I set up the environment correctly and just assumed that wasn’t the issue. On the off hand chance you know, do you know if there is a setting in Agile that must be set to allow a particular user to log in with the API? I have one account that I can use to successfully log in, but another that cannot. My Agile administrators aren’t aware of anything.

 

Edit: Found the answer, one account I was using is LDAP, and the other is not. Needed to add this line during login to allow an LDAP user to connect.

System.setProperty("disable.agile.sessionID.generation", "true");
on January 15, 2020.

Yes, that’s correct. You need to put this -D option for LDAP accounts to login to Agile using SDK

on January 15, 2020.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.