How to use the library in JavaEE.
In JavaSE works, but in JavaEE (WildFlyserver) not work
coInitialize fails.
@Singleton
@Startup
@Path("readservice")
public class GenericResource {
@PostConstruct
private void init() {
System.out.println("Start Init Sources");
JOpc.coInitialize(); //error. server shutdown.
System.out.println("Finish Init Sources");
//initSources();
}
Log:
16:34:20,751 INFO [org.jboss.weld.deployer] (MSC service thread 1-3) WFLYWELD0006: Starting Services for CDI deployment: kron.tm3.opc.webtest-1.0.war
16:34:20,755 INFO [org.jboss.weld.deployer] (MSC service thread 1-3) WFLYWELD0009: Starting weld service for deployment kron.tm3.opc.webtest-1.0.war
16:34:20,876 INFO [stdout] (ServerService Thread Pool -- 66) Start Init Sources
16:34:20,879 INFO [org.jboss.as.server] (Thread-2) WFLYSRV0220: Server shutdown has been requested.
16:34:20,882 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-1) WFLYJCA0010: Unbound data source [java:jboss/datasources/KRONTM2DS]
16:34:20,883 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-8) WFLYJCA0010: Unbound data source [java:jboss/datasources/KRON4DS]
16:34:20,883 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-1) WFLYJCA0010: Unbound data source [java:jboss/datasources/TMOPCDS]
16:34:20,885 INFO [org.wildfly.extension.undertow] (MSC service thread 1-8) WFLYUT0019: Host default-host stopping
16:34:20,888 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-6) WFLYJCA0019: Stopped Driver service with driver-name = sqljdbc4