Getting exception querying using EmbeddedConnection
pranavk Jun 19, 2017 10:20 AMHi,
While connecting to my application (running on a jetty server), I am able to properly connect and and run queries over Teiid when I use the SocketConnection (using URL format: jdbc:teiid:Portfolio@mm://localhost:31000). But when I try to create an EmbeddedConnection instead (using the jdbc:teiid:Portfolio) inside the same JVM, I am not able to create a connection in my setup. The driver.connect() call fails giving me 2 kinds of exceptions.
The first error I get here is:
jvm 1 | Caused by: javax.xml.stream.FactoryConfigurationError: Provider com.ctc.wstx.stax.WstxEventFactory not found
jvm 1 | at javax.xml.stream.FactoryFinder.newInstance(FactoryFinder.java:201)
jvm 1 | at javax.xml.stream.FactoryFinder.newInstance(FactoryFinder.java:152)
jvm 1 | at javax.xml.stream.FactoryFinder.find(FactoryFinder.java:265)
jvm 1 | at javax.xml.stream.FactoryFinder.find(FactoryFinder.java:227)
jvm 1 | at javax.xml.stream.XMLEventFactory.newInstance(XMLEventFactory.java:64)
jvm 1 | at __redirected.__XMLEventFactory.<clinit>(__XMLEventFactory.java:72)
jvm 1 | at __redirected.__JAXPRedirected.initAll(__JAXPRedirected.java:76)
jvm 1 | at org.jboss.modules.Module$1.run(Module.java:132)
jvm 1 | at org.jboss.modules.Module$1.run(Module.java:119)
jvm 1 | at java.security.AccessController.doPrivileged(Native Method)
jvm 1 | at org.jboss.modules.Module.<clinit>(Module.java:119)
jvm 1 | at org.teiid.jdbc.ModuleHelper.createFromModule(ModuleHelper.java:47)
jvm 1 | at org.teiid.jdbc.LocalProfile.createServerConnection(LocalProfile.java:60)
jvm 1 | at org.teiid.jdbc.LocalProfile.connect(LocalProfile.java:50)
jvm 1 | at org.teiid.jdbc.TeiidDriver.connect(TeiidDriver.java:105)
jvm 1 | at org.teiid.jdbc.TeiidDriver.connect(TeiidDriver.java:55)
jvm 1 | at java.sql.DriverManager.getConnection(DriverManager.java:664)
jvm 1 | at java.sql.DriverManager.getConnection(DriverManager.java:208)
The above exception shows up only for the first time, while subsequent attempts to query give me the following error:
jvm 1 | Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.jboss.modules.Module
jvm 1 | at org.teiid.jdbc.ModuleHelper.createFromModule(ModuleHelper.java:47)
jvm 1 | at org.teiid.jdbc.LocalProfile.createServerConnection(LocalProfile.java:60)
jvm 1 | at org.teiid.jdbc.LocalProfile.connect(LocalProfile.java:50)
jvm 1 | at org.teiid.jdbc.TeiidDriver.connect(TeiidDriver.java:105)
jvm 1 | at org.teiid.jdbc.TeiidDriver.connect(TeiidDriver.java:55)
jvm 1 | at java.sql.DriverManager.getConnection(DriverManager.java:664)
jvm 1 | at java.sql.DriverManager.getConnection(DriverManager.java:208)
While debugging I noticed at the point where the exception comes up, that the current classloader has both the Modules, WstxEventFactory classes available.
Could you please suggest on why this issue would be coming up/ is this an issue in general?
Thanks,
Pranav