# Could not initialize class sun.security.ssl.SSLContextImp

**URL:** <https://dev.lucee.org/t/could-not-initialize-class-sun-security-ssl-sslcontextimp/3972>\
**Category:** support\
**Created:** [May 31, 2018, 3:32pm UTC](https://dev.lucee.org/t/could-not-initialize-class-sun-security-ssl-sslcontextimp/3972 "2018-05-31T15:32:11Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![nalbee](https://dev.lucee.org/user_avatar/dev.lucee.org/nalbee/32/3115_2.png) [@nalbee](https://dev.lucee.org/u/nalbee)\
**Post date:** [May 31, 2018, 3:32pm UTC](https://dev.lucee.org/t/could-not-initialize-class-sun-security-ssl-sslcontextimp/3972/1 "2018-05-31T15:32:11Z")

</div>

**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.

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

```

Any ideas on how to fix it?

Thanks in advance.

```auto
"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

```

---

<div class="post-metadata">

**Author:** ![bdw429s](https://dev.lucee.org/user_avatar/dev.lucee.org/bdw429s/32/37_2.png) [@bdw429s](https://dev.lucee.org/u/bdw429s)\
**Post date:** [May 31, 2018, 3:37pm UTC](https://dev.lucee.org/t/could-not-initialize-class-sun-security-ssl-sslcontextimp/3972/2 "2018-05-31T15:37:48Z")

</div>

Are you on a recent version of Java?

---

<div class="post-metadata">

**Author:** ![nalbee](https://dev.lucee.org/user_avatar/dev.lucee.org/nalbee/32/3115_2.png) [@nalbee](https://dev.lucee.org/u/nalbee)\
**Post date:** [May 31, 2018, 4:33pm UTC](https://dev.lucee.org/t/could-not-initialize-class-sun-security-ssl-sslcontextimp/3972/3 "2018-05-31T16:33:46Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![bdw429s](https://dev.lucee.org/user_avatar/dev.lucee.org/bdw429s/32/37_2.png) [@bdw429s](https://dev.lucee.org/u/bdw429s)\
**Post date:** [May 31, 2018, 4:46pm UTC](https://dev.lucee.org/t/could-not-initialize-class-sun-security-ssl-sslcontextimp/3972/4 "2018-05-31T16:46:59Z")

</div>

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](https://www.java.com/en/download/faq/release_dates.xml)

---

<div class="post-metadata">

**Author:** ![nalbee](https://dev.lucee.org/user_avatar/dev.lucee.org/nalbee/32/3115_2.png) [@nalbee](https://dev.lucee.org/u/nalbee)\
**Post date:** [May 31, 2018, 4:55pm UTC](https://dev.lucee.org/t/could-not-initialize-class-sun-security-ssl-sslcontextimp/3972/5 "2018-05-31T16:55:27Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![nalbee](https://dev.lucee.org/user_avatar/dev.lucee.org/nalbee/32/3115_2.png) [@nalbee](https://dev.lucee.org/u/nalbee)\
**Post date:** [May 31, 2018, 8:24pm UTC](https://dev.lucee.org/t/could-not-initialize-class-sun-security-ssl-sslcontextimp/3972/6 "2018-05-31T20:24:14Z")

</div>

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?

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

```

---

<div class="post-metadata">

**Author:** ![bdw429s](https://dev.lucee.org/user_avatar/dev.lucee.org/bdw429s/32/37_2.png) [@bdw429s](https://dev.lucee.org/u/bdw429s)\
**Post date:** [May 31, 2018, 8:42pm UTC](https://dev.lucee.org/t/could-not-initialize-class-sun-security-ssl-sslcontextimp/3972/7 "2018-05-31T20:42:55Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![nalbee](https://dev.lucee.org/user_avatar/dev.lucee.org/nalbee/32/3115_2.png) [@nalbee](https://dev.lucee.org/u/nalbee)\
**Post date:** [May 31, 2018, 8:55pm UTC](https://dev.lucee.org/t/could-not-initialize-class-sun-security-ssl-sslcontextimp/3972/8 "2018-05-31T20:55:43Z")

</div>

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.

```auto
"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"

```

---

<div class="post-metadata">

**Author:** ![bdw429s](https://dev.lucee.org/user_avatar/dev.lucee.org/bdw429s/32/37_2.png) [@bdw429s](https://dev.lucee.org/u/bdw429s)\
**Post date:** [May 31, 2018, 9:00pm UTC](https://dev.lucee.org/t/could-not-initialize-class-sun-security-ssl-sslcontextimp/3972/9 "2018-05-31T21:00:23Z")

</div>

> 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 🙂

---

<div class="post-metadata">

**Author:** ![nalbee](https://dev.lucee.org/user_avatar/dev.lucee.org/nalbee/32/3115_2.png) [@nalbee](https://dev.lucee.org/u/nalbee)\
**Post date:** [June 1, 2018, 3:28pm UTC](https://dev.lucee.org/t/could-not-initialize-class-sun-security-ssl-sslcontextimp/3972/10 "2018-06-01T15:28:32Z")

</div>

Thanks. I really appreciated the help.

---

<div class="post-metadata">

**Author:** ![skyflare](https://dev.lucee.org/user_avatar/dev.lucee.org/skyflare/32/3078_2.png) [@skyflare](https://dev.lucee.org/u/skyflare)\
**Post date:** [November 17, 2020, 6:17am UTC](https://dev.lucee.org/t/could-not-initialize-class-sun-security-ssl-sslcontextimp/3972/11 "2020-11-17T06:17:49Z")

</div>

I found this thread after updating my ubuntu server. My Lucee install was set to use a different java version then the apt-get packages installed in ubuntu. When the latest openjdk update came out 11.0.9, Lucee stopped working for CFHTTP with the error you had. I found that my JDK files had symbolic links to the /etc/ folder which was shared with the apt-get package. I had to make /etc/init.d/lucee\_ctl point to JDK installation that was completely separate and not using any symbolic links to get it working again.

Just sharing in case it happens to anyone else. I have a customized version of lucee, and a different java version because of that.
