Could not initialize class sun.security.ssl.SSLContextImp


#1

lucee 5.2.7.62. CommandBox 4.0

I am getting this error when I do a CFHTTP ? It happens at irregular intervals and on startup.

Could not initialize class sun.security.ssl.SSLContextImpl$TLS12Context

Any ideas on how to fix it?

Thanks in advance.

"ERROR","cfthread-0","05/31/2018","09:53:11","",";Could not initialize class sun.security.ssl.SSLContextImpl$TLS12Context;lucee.runtime.exp.NativeException: Could not initialize class sun.security.ssl.SSLContextImpl$TLS12Context
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:264)
	at java.security.Provider$Service.getImplClass(Provider.java:1634)
	at java.security.Provider$Service.newInstance(Provider.java:1592)
	at sun.security.jca.GetInstance.getInstance(GetInstance.java:236)
	at sun.security.jca.GetInstance.getInstance(GetInstance.java:164)
	at javax.net.ssl.SSLContext.getInstance(SSLContext.java:156)
	at lucee.runtime.tag.Http.ssl(Http.java:1425)
	at lucee.runtime.tag.Http._doEndTag(Http.java:725)
	at lucee.runtime.tag.Http.doEndTag(Http.java:710)
	at readmodbus_cfm$cf.threadCall(/readmodbus.cfm:564)
	at lucee.runtime.thread.ChildThreadImpl.execute(ChildThreadImpl.java:204)
	at lucee.runtime.thread.ChildThreadImpl.run(ChildThreadImpl.java:147)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class sun.security.ssl.SSLContextImpl$TLS12Context
	... 13 more

#2

Are you on a recent version of Java?


#3

java -version
java version “1.8.0_65”
Java™ SE Runtime Environment (build 1.8.0_65-b17)
Java HotSpot™ Client VM (build 25.65-b01, mixed mode)


#4

That’s pretty old. I don’t know if it will solve your error, but it’s worth trying before you go down any other roads. That was released back in October 20, 2015 according to this link!

https://www.java.com/en/download/faq/release_dates.xml


#5

ok, I’ll try giving that a go. I really appreciate your input. Thanks.


#6

ok Its on 1.8.0_171 (Oracle Corporation) 32bit. hopefully that will help.

My non heap is 115% now in cfadmin.

I’m kinda struggling with finding an example for changing non-heap. Does non-heap matter?

Is this the right format to edit to server-test.json?

{
    "name":"test",
    "web":{
        "host":"0.0.0.0",
        "http":{
            "port":"80"
        }
    },
    "jvm":{
        "heapSize":512,
        "minHeapSize":256,
        "Non-Heap":60
    }
}

#7

I wouldn’t worry about the non-heap number. The setting you showed above doesn’t exist. It’s likely some sort of bug that Lucee is showing a number greater than 115% but unless you’re actually getting memory errors in your app I wouldn’t worry. That said, your app might breath a bit better if you give it more than 512MB, assuming you have it available.

Back to your original question, did the new version of Java fix your error?


#8

Yes, the error did go away. So that was really great advise.

The last of the goofy errors I have are: ExternalAgent does not contain a Instrumentation instance. Should I be concerned about this or not a big deal?

I can’t thank you enough for making commandbox and releasing 4.0, its really been fantastic.

"INFO","XNIO-1 task-3","05/31/2018","15:36:34","Instrumentation","found [lucee.runtime.instrumentation.ExternalAgent] in ClassLoader [sun.misc.Launcher$AppClassLoader@1f96302]"
"INFO","XNIO-1 task-3","05/31/2018","15:36:34","Instrumentation","ExternalAgent does not contain a Instrumentation instance"
"INFO","XNIO-1 task-3","05/31/2018","15:36:34","Instrumentation","found [lucee.runtime.instrumentation.ExternalAgent] in ClassLoader [sun.misc.Launcher$AppClassLoader@1f96302]"
"INFO","XNIO-1 task-3","05/31/2018","15:36:34","Instrumentation","ExternalAgent does not contain a Instrumentation instance"
"INFO","XNIO-1 task-3","05/31/2018","15:36:34","Instrumentation","found [lucee.runtime.instrumentation.ExternalAgent] in ClassLoader [sun.misc.Launcher$AppClassLoader@1f96302]"
"INFO","XNIO-1 task-3","05/31/2018","15:36:34","Instrumentation","ExternalAgent does not contain a Instrumentation instance"
"INFO","XNIO-1 task-3","05/31/2018","15:36:34","Instrumentation","looking for tools.jar"
"INFO","XNIO-1 task-3","05/31/2018","15:36:34","Instrumentation","tools.jar used:/usr/lib/jvm/java-8-oracle/jre/lib/tools.jar"
"INFO","XNIO-1 task-3","05/31/2018","15:36:34","Instrumentation","loaded VirtualMachine class:com.sun.tools.attach.VirtualMachine"
"INFO","XNIO-1 task-3","05/31/2018","15:36:34","Instrumentation","try to load agent (path:/root/.CommandBox/server/484FEEDEE58E3D1C8571FF0E5645633D-test/lucee-5.2.7.62/WEB-INF/lucee-server/context/lucee-external-agent.jar)"
"INFO","XNIO-1 task-3","05/31/2018","15:36:34","Instrumentation","pid:1426"
"INFO","XNIO-1 task-3","05/31/2018","15:36:34","Instrumentation","found [lucee.runtime.instrumentation.ExternalAgent] in ClassLoader [sun.misc.Launcher$AppClassLoader@1f96302]"
"INFO","XNIO-1 task-3","05/31/2018","15:36:34","Instrumentation","ExternalAgent does contain a Instrumentation instance"
"INFO","main","05/31/2018","15:48:10","OSGi","add bundle:/root/.CommandBox/server/484FEEDEE58E3D1C8571FF0E5645633D-test/lucee-5.2.7.62/WEB-INF/lucee-web/context/lucee-admin.lar"
"INFO","main","05/31/2018","15:48:10","OSGi","add bundle:/root/.CommandBox/server/484FEEDEE58E3D1C8571FF0E5645633D-test/lucee-5.2.7.62/WEB-INF/lucee-web/context/lucee-context.lar"

#9

ExternalAgent does not contain a Instrumentation instance

That’s not an error, it’s just debugging output. You can see those lines start with “INFO”.

I’m glad CommandBox is proving useful for you :slight_smile:


#10

Thanks. I really appreciated the help.