Connect to Agile from Spring Boot application – not working
Hello,
I have a simple Spring Boot application where I imported the AgileAPI, and some other dependencies. (dependencies were took from Oracle’s webservice example, but anyway I think AgileAPI should enough)
When I’m trying to connect to agile with the following code I receive an error.
Do you know why it is not working? If I mistype the password for example, I receive back another error that the username/password wasn’t correct so i think it really tries to connect, but some why it is not working.
private static IAgileSession connect2(IAgileSession session) throws APIException {
//System.setProperty("disable.agile.sessionID.generation", "true");
HashMap params = new HashMap();
params.put(AgileSessionFactory.USERNAME, "****");
params.put(AgileSessionFactory.PASSWORD, "****");
AgileSessionFactory factory = AgileSessionFactory.getInstance("https://agileserver/Agile");
session = factory.createSession(params);
return SpringBootApplication.session;
}
public static void main(String[] args) throws APIException {
SpringApplication.run(SpringBootApplication.class, args);
session = connect2(session);
String a = "done";
}
}
020-08-27 11:57:54.526 INFO 16644 — [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ”
2020-08-27 11:57:54.529 INFO 16644 — [ main] c.ni.apps.plm.ccb.SpringBootApplication : Started SpringBootApplication in 14.192 seconds (JVM running for 15.635)
Exception in thread “main” java.lang.NoClassDefFoundError: com/bea/common/security/utils/HMAC
at weblogic.security.HMAC.digest(HMAC.java:22)
at weblogic.rjvm.JVMID.getUnique32BitNumber(JVMID.java:305)
……..
Caused by: java.lang.ClassNotFoundException: com.bea.common.security.utils.HMAC
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
… 32 more
Error code : 60002
Error message : You have not logged in.
Root Cause exception : java.lang.NoClassDefFoundError: com/bea/common/security/utils/HMAC
Is some weblogic dependency missing? I tried to add many types, but I wasn’t able to add them, I had an issue with all.
Thanks,
Feri
Hi Feri,
Could you please confirm if the AgileAPI Jar which you are using in your custom Application is Taken from Application Server.
let me know if you are receiving same error with Non SSL URL as well.
Thank You
Karthik