ClassNotFoundException: com.sun.net.httpserver.HttpHandler when deploying Activiti REST application in JBoss EAP 6.x
Environment
Red Hat JBoss Enterprise Application Platform (EAP) 6.2.x
Issue
- Missing access to 'com/sun/net/httpserver' in Sun JDK module. Per this bug report Activiti uses the Restlet framework (http://restlet.com/):
http://jira.codehaus.org/browse/ACT-2069
When deploying on JBoss EAP 6.2.4 it is missing access to com.sun.net.httpserver.HttpHandler and throws the exception below:
java.lang.ClassNotFoundException: com.sun.net.httpserver.HttpHandler from [Module "deployment.activiti-rest-example.war:main" from Service Module Loader]
Resolution
Add a dependency on com/sun/net/httpserver in the jboss-deployment-structure.xml as shown below:
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.1">
<deployment>
<dependencies>
<module name="sun.jdk"/>
<system>
<paths>
<path name="com/sun/net/httpserver"/>
</paths>
</system>
</dependencies>
</deployment>
</jboss-deployment-structure>
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
