I have many machines, identical. All are running Tomcat 8.5.31 and java 1.8.0_171-b11
I have a database class that creates an entity manager. I call the class from CDI on all machines, which works.
The method calls createEntityManagerFactory("jdbc/mydatabase")
I then call the same method using a listener defined in the web.xml and again it works, but only on some machines, the exact same .war
The only difference I can find is, the machines that it doesn't work on run Bitdefender?
On the machines that it doesn't work, I get the following null pointer,
java.lang.NullPointerException
at javax.persistence.spi.PersistenceProviderResolverHolder$DefaultPersistenceProviderResolver.getProviderNames(PersistenceProviderResolverHolder.java:197)
at javax.persistence.spi.PersistenceProviderResolverHolder$DefaultPersistenceProviderResolver.getPersistenceProviders(PersistenceProviderResolverHolder.java:112)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:76)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:54)
at com.tillsystem.managers.DatabaseManager.getEntityManageriTill(DatabaseManager.java:55)
at com.tillsystem.managers.DatabaseManager.getTableTransactionsIds(DatabaseManager.java:245)
at com.tillsystem.sync.SyncService.downloadTransactions(SyncService.java:249)
at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1590)
at java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1582)
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)