OSGI Bundle for MSSQL - error javax.net.SocketFactory classdefnotfound | Community
Skip to main content
crich2784
Level 6
June 3, 2021
Solved

OSGI Bundle for MSSQL - error javax.net.SocketFactory classdefnotfound

  • June 3, 2021
  • 1 reply
  • 1616 views

I am trying to create an OSGI bundle for MSSQL driver.  I'll post my Manifest below.

Basically, I get an error javax.net.SocketFactory no class def found.

 

 

com.adobe.granite.workflow.WorkflowException: Process execution resulted in an error at com.adobe.granite.workflow.core.job.HandlerBase.executeProcess(HandlerBase.java:201) [com.adobe.granite.workflow.core:2.0.240.CQ650-B0016] at com.adobe.granite.workflow.core.job.JobHandler.process(JobHandler.java:260) [com.adobe.granite.workflow.core:2.0.240.CQ650-B0016] at org.apache.sling.event.impl.jobs.JobConsumerManager$JobConsumerWrapper.process(JobConsumerManager.java:502) [org.apache.sling.event:4.2.12] at org.apache.sling.event.impl.jobs.queues.JobQueueImpl.startJob(JobQueueImpl.java:293) [org.apache.sling.event:4.2.12] at org.apache.sling.event.impl.jobs.queues.JobQueueImpl.access$100(JobQueueImpl.java:60) [org.apache.sling.event:4.2.12] at org.apache.sling.event.impl.jobs.queues.JobQueueImpl$1.run(JobQueueImpl.java:229) [org.apache.sling.event:4.2.12] at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:834) Caused by: java.lang.NoClassDefFoundError: javax/net/SocketFactory at com.microsoft.sqlserver.jdbc.SocketFinder.getSocketFactory(IOBuffer.java:2636) at com.microsoft.sqlserver.jdbc.SocketFinder.getConnectedSocket(IOBuffer.java:2687) at com.microsoft.sqlserver.jdbc.SocketFinder.getDefaultSocket(IOBuffer.java:2674) at com.microsoft.sqlserver.jdbc.SocketFinder.findSocket(IOBuffer.java:2358) at com.microsoft.sqlserver.jdbc.TDSChannel.open(IOBuffer.java:672) at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:2747) at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:2418) at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectInternal(SQLServerConnection.java:2265) at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:1291)

 

Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Jdbc Bundle-SymbolicName: com.s360g.mssql.jdbc Bundle-Version: 1.0.0 Automatic-Module-Name: com.s360g.mssql.jdbc Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Export-Package: com.microsoft.sqlserver.jdbc, microsoft.sql Import-Package: javax.naming, javax.naming.spi, javax.net, javax.net.ssl, javax.security.auth, javax.security.auth.login, javax.security.auth.x500, javax.sql, javax.transaction.xa, javax.xml.parsers, javax.xml.stream, javax.xml.transform, javax.xml.transform.dom, javax.xml.transform.sax, javax.xml.transform.stax, javax.xml.transform.stream, org.ietf.jgss, org.w3c.dom, org.xml.sax, org.xml.sax.helpers

 

 

Help would be appreciated.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by joerghoh

javax.net should be provided by the java runtime, and for that reason the Felix Framework makes the export of that package. Nevertheless I am not sure what happens if that package is provided by the Java runtime.

 

What version of Java are you using? Can you show the version as exposed in the MBean java.lang:Runtime of AEM (/system/console/jmx)

1 reply

joerghoh
Adobe Employee
joerghohAdobe EmployeeAccepted solution
Adobe Employee
June 3, 2021

javax.net should be provided by the java runtime, and for that reason the Felix Framework makes the export of that package. Nevertheless I am not sure what happens if that package is provided by the Java runtime.

 

What version of Java are you using? Can you show the version as exposed in the MBean java.lang:Runtime of AEM (/system/console/jmx)

crich2784
crich2784Author
Level 6
June 3, 2021
Thank you for replying. Jorg, I might be overcomplicating this. Maybe I do not need to wrap into OSGI container. I just tried to point straight to the jar downloaded from Microsoft as it has an osgi Activator,etc in the jar. That worked and started. Still having a problem finding my JDBC DataSource but, maybe the driver issue is solved. Verifying my direction would be great.