Running Groovy Script with Highscale lib causes SecurityException - java

While running a groovy script I get this exception:
Caught: java.lang.ExceptionInInitializerError
java.lang.ExceptionInInitializerError
Caused by: java.lang.SecurityException: Prohibited package name: java.util.concurrent
I noticed a library in my classpath high-scale-lib-1.0.6.jar which has a class java.util.concurrent.ConcurrentHashMap.class in the library.
I need this library so what can I do to get groovy scripts running? I read something about whitelists for such cases.
Any ideas on how I could solve this issue ?

Related

NoClassDefFoundError error message in eclipse

I am running a program on eclipse and I keep getting this error:
Unable to initialize main class com.logic.AddProduct
Caused by: java.lang.NoClassDefFoundError: org/hibernate/Session
Any explainations?
Hibernate JAR (hibernate-core i suppose) or onr of its dependencies is probably not in your runtime classpath.

Running an error after the project is packaged

The project runs normally in eclipse, but there is a problem when the project is packaged and runs in the terminal. How should this problem be solved?
D:>java -jar
optaplanner-examples-7.4.1.Final-jar-with-dependencies.jar
D:\roster_450.xml 100 Exception in thread "main"
java.lang.ExceptionInInitializerError
at org.kie.api.internal.utils.ServiceRegistry.getInstance(ServiceRegistry.java:27)
at org.kie.api.KieServices$Factory$LazyHolder.(KieServices.java:332)
at org.kie.api.KieServices$Factory.get(KieServices.java:339)
at org.optaplanner.core.config.score.director.ScoreDirectorFactoryConfig.buildDroolsScoreDirectorFactory(ScoreDirectorFactoryConfig.java:460)
at org.optaplanner.core.config.score.director.ScoreDirectorFactoryConfig.buildScoreDirectorFactory(ScoreDirectorFactoryConfig.java:331)
at org.optaplanner.core.config.solver.SolverConfig.buildSolver(SolverConfig.java:220)
at org.optaplanner.core.impl.solver.AbstractSolverFactory.buildSolver(AbstractSolverFactory.java:61)
at org.optaplanner.examples.common.app.CommonApp.createSolver(CommonApp.java:105)
at org.optaplanner.examples.nurserostering.app.NurseRosteringApp.createSolutionBusiness(NurseRosteringApp.java:94)
at org.optaplanner.examples.nurserostering.app.NurseRosteringApp.init(NurseRosteringApp.java:85)
at org.optaplanner.examples.nurserostering.app.NurseRosteringApp.main(NurseRosteringApp.java:77)
Caused by: java.lang.RuntimeException: Child services
[org.kie.api.internal.assembler.KieAssemblers] have no parent
at org.kie.api.internal.utils.ServiceDiscoveryImpl.buildMap(ServiceDiscoveryImpl.java:186)
at org.kie.api.internal.utils.ServiceDiscoveryImpl.getServices(ServiceDiscoveryImpl.java:97)
at org.kie.api.internal.utils.ServiceRegistryImpl.(ServiceRegistryImpl.java:36)
at org.kie.api.internal.utils.ServiceRegistryImpl$LazyHolder.(ServiceRegistryImpl.java:32)
... 11 more
Drools doesn't like uber-jarring because several jars have a META-INF directory with files with the same name. So last-one-wins.
Either don't use uber-jarring or doing use Drools score calculation.

how to run evalb in stanford corNLP?

I'm not familiar with stanford coreNLP. I want to use one of its classes Evalb. I've imported all packages (although many of them have errors). class Evalb doesn't have any error. when I run it I got this exception :
Exception in thread "main" java.lang.ExceptionInInitializerError
at edu.stanford.nlp.international.Language.<clinit>(Language.java:15)
at edu.stanford.nlp.parser.metrics.Evalb.usage(Evalb.java:136)
at edu.stanford.nlp.parser.metrics.Evalb.main(Evalb.java:163)
Caused by: java.lang.RuntimeException: Uncompilable source code - package java.util.function does not exist
at edu.stanford.nlp.parser.lexparser.AbstractTreebankParserParams.<clinit>(AbstractTreebankParserParams.java:13)
... 3 more
Java Result: 1
I have installed JDK 1.8
How can I fix this?

Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Level

I am trying to run RestClient .From this code I deleted all Loggers related code.But I kept classpath for log4j same. Then run the application ,it gives following two exceptions
java.lang.NoClassDefFoundError: org/apache/log4j/Level
Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Level
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/log4j/Level
Please give reason for those exceptions.
Other jars that you use most likely will use log4j. Also, make sure you remove imports of log4j, not just the code that uses it.

Error in executing JAX-RPC

Help me on this exception , Occurs during calling wcf webservice
Log by netbeans
Exception in thread "main" java.lang.ExceptionInInitializerError
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:107)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:78)
at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.java:107)
at $Proxy32.logon(Unknown Source)
at newtestclient.NewTestClient.main(NewTestClient.java:92)
Caused by: java.lang.ClassCastException: com.sun.xml.bind.v2.runtime.JAXBContextImpl cannot be cast to com.sun.xml.internal.bind.api.JAXBRIContext
at com.sun.xml.internal.ws.fault.SOAPFaultBuilder.<clinit>(SOAPFaultBuilder.java:533)
... 5 more
Java Result: 1
The exception says :
java.lang.ClassCastException: com.sun.xml.bind.v2.runtime.JAXBContextImpl cannot be cast to com.sun.xml.internal.bind.api.JAXBRIContext.
It's a common error that appears when there is a conflict between libraries and its dependencies. You should try to execute your code in a test project with only the libraries from JAX-RPC, and then add one by one the rest of your app libraries.
Also, you should check your server libraries to discard any kind of conflict for having the same library (or its dependencies) in your app and in your server with different versions.

Categories

Resources