openam13 snapshot ssoadm setup exception: ClassNotFoundException: org.forgerock.services.TransactionId - single-sign-on

I am getting the following exception while trying to run the ssoadm .setup script. This is with openam13 snapshot version i got on 01/04/2016. It worked before that. Can anyone point me to what might be the issue?
Executing command "/Users/sso-config/target/ssoadmintools/setup --path /apps/openam/server --log /apps/openam/log --acceptLicense --debug /apps/openam/debug" in working directory target/ssoadmintools/
Exception in thread "main" java.lang.NoClassDefFoundError: org/forgerock/services/TransactionId
at org.forgerock.openam.audit.context.AuditRequestContext$1.initialValue(AuditRequestContext.java:35)
at org.forgerock.openam.audit.context.AuditRequestContext$1.initialValue(AuditRequestContext.java:32)
at java.lang.ThreadLocal.setInitialValue(ThreadLocal.java:160)
at java.lang.ThreadLocal.get(ThreadLocal.java:150)
at org.forgerock.openam.audit.context.AuditRequestContext.get(AuditRequestContext.java:124)
at org.forgerock.openam.audit.context.AuditRequestContext.createSubTransactionIdValue(AuditRequestContext.java:160)
at org.forgerock.openam.ldap.LDAPRequests.newSimpleBindRequest(LDAPRequests.java:54)
at org.forgerock.openam.ldap.LDAPUtils.newConnectionFactory(LDAPUtils.java:249)
at org.forgerock.openam.ldap.LDAPUtils.newFailoverConnectionFactory(LDAPUtils.java:200)
at com.iplanet.services.ldap.DSConfigMgr.getNewFailoverConnectionFactory(DSConfigMgr.java:324)
at com.iplanet.services.ldap.DSConfigMgr.getNewConnectionFactory(DSConfigMgr.java:289)
at com.sun.identity.setup.Bootstrap.getConfiguration(Bootstrap.java:190)
at com.sun.identity.setup.Bootstrap.load(Bootstrap.java:136)
at com.sun.identity.tools.bundles.Main.main(Main.java:143)
Caused by: java.lang.ClassNotFoundException: org.forgerock.services.TransactionId
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 14 more
Command process exited with value 1

Can you try running the setup command from the directory where the script is located instead of using the absolute path to the script?
Try this:
./setup --path /apps/openam/server --log /apps/openam/log --acceptLicense --debug /apps/openam/debug
Instead of this:
/Users/sso-config/target/ssoadmintools/setup --path /apps/openam/server --log /apps/openam/log --acceptLicense --debug /apps/openam/debug
My guess is that java cannot find some libraries in the classpath when you use the absolute path.

Related

akka-http web-app fails to start on minimal docker jre 11 (what java modules for scala12 akka-http)?

I'm trying to Dockerize my (otherwise running nice) very small akka-http webapp. I'm using the buildfile indicated here. For convenience added:
FROM alpine:latest as packager
RUN apk --no-cache add openjdk11-jdk openjdk11-jmods
ENV JAVA_MINIMAL="/opt/java-minimal"
# build minimal JRE
RUN /usr/lib/jvm/java-11-openjdk/bin/jlink \
--verbose \
--add-modules \
java.base,java.sql,java.naming,java.desktop,java.management,java.security.jgss,java.instrument \
--compress 2 --strip-debug --no-header-files --no-man-pages \
--release-info="add:IMPLEMENTOR=radistao:IMPLEMENTOR_VERSION=radistao_JRE" \
--output "$JAVA_MINIMAL"
FROM alpine:latest
ENV JAVA_HOME=/opt/java-minimal
ENV PATH="$PATH:$JAVA_HOME/bin"
COPY --from=packager "$JAVA_HOME" "$JAVA_HOME"
COPY build/libs/application.jar app.jar
ENTRYPOINT ["java","-jar","/app.jar"]
However it fails to start with error below. Because I'm using a minimalistic setup for jre11 I think I might be missing some modules. But I'm not sure, and I don't know which java modules are mandatory for an akka-http scala-12 application. Hopefully somebody knows??
Exception in thread "main" java.lang.ExceptionInInitializerError
at akka.dispatch.AbstractNodeQueue.<clinit>(AbstractNodeQueue.java:181)
at akka.actor.LightArrayRevolverScheduler.<init>(LightArrayRevolverScheduler.scala:157)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.base/java.lang.reflect.Constructor.newInstance(Unknown Source)
at akka.actor.ReflectiveDynamicAccess.$anonfun$createInstanceFor$1(ReflectiveDynamicAccess.scala:33)
at scala.util.Try$.apply(Try.scala:209)
at akka.actor.ReflectiveDynamicAccess.createInstanceFor(ReflectiveDynamicAccess.scala:28)
at akka.actor.ReflectiveDynamicAccess.$anonfun$createInstanceFor$5(ReflectiveDynamicAccess.scala:39)
at scala.util.Success.flatMap(Try.scala:247)
at akka.actor.ReflectiveDynamicAccess.createInstanceFor(ReflectiveDynamicAccess.scala:39)
at akka.actor.ActorSystemImpl.createScheduler(ActorSystem.scala:925)
at akka.actor.ActorSystemImpl.<init>(ActorSystem.scala:786)
at akka.actor.ActorSystem$.apply(ActorSystem.scala:246)
at akka.actor.ActorSystem$.apply(ActorSystem.scala:289)
at akka.actor.ActorSystem$.apply(ActorSystem.scala:234)
at akka.actor.ActorSystem$.apply(ActorSystem.scala:225)
at nl.d8r.stretchsketch.WebServer$.main(Server.scala:37)
at nl.d8r.stretchsketch.WebServer.main(Server.scala)
Caused by: java.lang.ExceptionInInitializerError
at akka.util.Unsafe.<clinit>(Unsafe.java:42)
at akka.dispatch.AbstractNodeQueue.<clinit>(AbstractNodeQueue.java:179)
... 19 more
Caused by: java.lang.NoClassDefFoundError: sun/misc/Unsafe
at akka.util.Unsafe.<clinit>(Unsafe.java:22)
... 20 more
Caused by: java.lang.ClassNotFoundException: sun.misc.Unsafe
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source)
at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
... 21 more
You need to add a jvm argument to your ENTRYPOINT clause:
--add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED
and should look like the following:
ENTRYPOINT ["java", "--add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED", "-jar","/app.jar"]

Why dbca giving error NoClassDefFoundError

After doing the configuraton on Putty for X11. When I am running dbca I am getting the following error:
[oracle#XYZ bin]$ dbca
Exception in thread "main" java.lang.NoClassDefFoundError: Could not
initialize class sun.awt.X11.XToolkit
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at java.awt.Toolkit$2.run(Toolkit.java:860)
at java.awt.Toolkit$2.run(Toolkit.java:855)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:854)
From command promt i have already run the command for Xming:
"C:\Program Files (x86)\Xming\Xming.exe" :0 -clipboard -multiwindow -ac
run this, export DISPLAY=localhost:10.0
after that, run dbca

Scalatest runner results in VerifyError: Cannot inherit from final class

I am trying to run all the tests (all of them extend FlatSpec) in a jar using the ScalaTest Runner, but get a message for VerifyError. However, I am able to individually run the tests.
The jar was compiled using sbt test:assembly. I am trying to run the tests in another environment where sbt is not available. The tests are available in the jar in com/tfs/test path, as shown in the output below:
samik#samik-lap:~/git/proj$ jar tf test-2018.2.jar | grep MyTest
com/tfs/test/MyTest$$anonfun$1$$anonfun$apply$mcV$sp$1.class
com/tfs/test/MyTest$$anonfun$4.class
com/tfs/test/MyTest$$anonfun$5.class
com/tfs/test/MyTest$$typecreator4$1.class
com/tfs/test/MyTest$$typecreator5$1.class
com/tfs/test/MyTest$$typecreator9$1.class
com/tfs/test/MyTest.class
The following command runs the specific test just fine:
samik#samik-lap:~/git/proj$ scala -J-Xmx2g -cp "scalatest_2.11-3.0.5.jar:scalactic_2.11-3.0.5.jar:test-2018.2.jar" org.scalatest.run com.tfs.test.MyTest
0 [ScalaTest-main] INFO com.tfs.test.MyTest - Starting MyTest test application
Start Time: 0 sec
...
However, when I use Runner to run all the tests (there are ~7 similar tests in the jar available at the same path), it doesn't work.
samik#samik-lap:~/git/proj$ scala -J-Xmx2g -cp "scalatest_2.11-3.0.5.jar:scalactic_2.11-3.0.5.jar" org.scalatest.tools.Runner -o -R test-2018.2.jar
Discovery starting.
*** RUN ABORTED ***
java.lang.VerifyError: Cannot inherit from final class
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
How do I get all the tests to run through Runner? How do I get to know what is happening inside and where the issue is? Thanks for any pointer.

How to compile and run H2 TriggerSample

I copied TriggerSample.java to this directory. Then:
javac -cp h2-1.3.168.jar TriggerSample.java
creates
TriggerSample$MyTrigger.class ... and ... TriggerSample.class
Then:
java TriggerSample
says:
Exception in thread "main" java.lang.NoClassDefFoundError: TriggerSample (wrong name: org/h2/samples/TriggerSample)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
also no go with:
java org.h2.samples.TriggerSample
java org/h2/samples/TriggerSample
How exactly to run that example from the command line?
This is a regular Java problem. The package name of class TriggerSample is org.h2.samples. You should use the directory name org/h2/samples.
Create a directory org/h2/samples
mkdir org/h2/samples
Move the file TriggerSample.java to that directory
Run
javac -cp h2-1.3.168.jar org/h2/samples/TriggerSample.java
Then run
java -cp h2-1.3.168.jar:. org.h2.samples.TriggerSample
Or: remove the package declaration of the file TriggerSample.java.

How can I use the Scala program schema2src?

This perhaps more a Server Fault question...
I installed schema2src via sbaz and now I would like to convert a DTD (Apple's plist schema) to Scala source.
$ schema2src
usage:
schema2src [flags] --module mname arg*
or
schema2src dtd arg*
or (experimental)
schema2src xsd arg* (this doesn't work at all yet)
where supported [flags] may be:
--verbose prints some debugging information
However, if I try give any argument, it appears it can't find Scala:
$ schema2src --verbose
Exception in thread "main" java.lang.NoClassDefFoundError: scala/runtime/BoxesUtility
at schema2src.Main$.processArgs(Main.scala:56)
at schema2src.Main$.main(Main.scala:25)
at schema2src.Main.main(Main.scala)
Caused by: java.lang.ClassNotFoundException: scala.runtime.BoxesUtility
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:315)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330)
at java.lang.ClassLoader.loadClass(ClassLoader.java:250)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398)
... 3 more
I have scala in my PATH...
Any suggestions? Assuming that problem can be fixed, is this the correct syntax?
$ schema2src PropertyList-1.0.dtd
I think it is now http://scalaxb.org/