Error generating web services through the Apache CXF framework - java

I am trying to generate web services in Eclipse by using the Apache CXF framework.
First I am creating the Java class corresponding to the desired web service and then I generate two dynamic web projects, one for the web service (wsdl file) and another one for the clients. The web web services work well after I create them but after some time (one-three days) I get the error displayed in the image at the server startup.
INFO: Starting service Catalina
Dec 7, 2011 9:27:55 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.4
Dec 7, 2011 9:27:55 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(C:\Documents and Settings\user\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\Prosys_Doctorat_Servicii_FAS_servicii\WEB-INF\lib\geronimo-servlet_3.0_spec-1.0.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
Dec 7, 2011 9:27:59 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Error configuring application listener of class org.springframework.web.context.ContextLoaderListener
java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1672)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1517)
at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:415)
at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:397)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:118)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4287)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4816)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:140)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1028)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:773)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:140)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1028)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:278)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:140)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:429)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:140)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:662)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:140)
at org.apache.catalina.startup.Catalina.start(Catalina.java:592)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:290)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:418)
Dec 7, 2011 9:27:59 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Skipped installing application listeners due to previous error(s)
Dec 7, 2011 9:27:59 PM org.apache.catalina.core.StandardContext startInternal
Then when I try to call a web service from the project I get the following error:
Exception in thread "main" javax.xml.ws.WebServiceException: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service.
at org.apache.cxf.jaxws.ServiceImpl.<init>(ServiceImpl.java:149)
at org.apache.cxf.jaxws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:90)
at javax.xml.ws.Service.<init>(Unknown Source)
at read_variable_value.ReadVariableNodeService1Service.<init>(ReadVariableNodeService1Service.java:50)
at FAS.Model2_FAS.asociere_valori(Model2_FAS.java:206)
at FAS.Model2_FAS.main(Model2_FAS.java:2596)
Caused by: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service.
at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:93)
at org.apache.cxf.jaxws.ServiceImpl.initializePorts(ServiceImpl.java:203)
at org.apache.cxf.jaxws.ServiceImpl.<init>(ServiceImpl.java:147)
... 5 more
Caused by: javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR: Problem parsing 'http://localhost:8081/Prosys_Doctorat_Servicii_FAS_servicii/services/ReadVariableNodeService1Port?wsdl'.: java.io.FileNotFoundException: http://localhost:8081/Prosys_Doctorat_Servicii_FAS_servicii/services/ReadVariableNodeService1Port?wsdl
at com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:239)
at org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:186)
at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:91)
... 7 more
Caused by: java.io.FileNotFoundException: http://localhost:8081/Prosys_Doctorat_Servicii_FAS_servicii/services/ReadVariableNodeService1Port?wsdl
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
... 13 more
What can cause this error which only appears after the web services are used repeatedly?
http://i.stack.imgur.com/4mTNZ.jpg
http://i.stack.imgur.com/rYkQb.jpg
Hi, the client is automatically generated in the following way:
private static final QName SERVICE_NAME = new QName("http://read_variable/", "ReadVariableNodeServiceService");
URL wsdlURL = ReadVariableNodeServiceService.WSDL_LOCATION;
ReadVariableNodeServiceService ss = new ReadVariableNodeServiceService(wsdlURL, SERVICE_NAME);
SEIReadValue port = ss.getReadVariableNodeServicePort();
{
System.out.println("Invoking getValue...");
java.lang.String _getValue_arg0 = "Alina";
java.lang.String _getValue_arg1 = "WorkspaceS1";
try {
double _getValue__return = port.getValue(_getValue_arg0, _getValue_arg1);
System.out.println("getValue.result=" + _getValue__return);
................
Last week I have found an interesting documentation which recommends the following way to call a web service:
ClassPathXmlApplicationContext context=new ClassPathXmlApplicationContext(new String[]{"read_variable/client3_beans.xml"});
SEIReadValue port = (SEIReadValue) context.getBean("readvariableClient");
{
System.out.println("Invoking getValue...");
java.lang.String _getValue_arg0 = "Alina";
java.lang.String _getValue_arg1 = "WorkspaceS1";
try {
double _getValue__return = port.getValue(_getValue_arg0, _getValue_arg1);
System.out.println("getValue.result=" + _getValue__return);
.........
What do you think? May this be the reason for my error?
I am very happy that I have almost found out the cause of my error. But I am a beginner in web services and I haven't understood your message entirely.
I want to specify that I have a set of basic/simple web services, and then based on these web services I have created a complex web service where I obtain the context
of each simple web service in order to obtain its functionality, and as you said (as I understood) this is not the right approach.
ClassPathXmlApplicationContext context=new ClassPathXmlApplicationContext(new String[]{"write_a_matrix/client2_beans.xml"});
SEIWriteMatrix port = (SEIWriteMatrix) context.getBean("write_a_matrix_Client");
...........................................................
ClassPathXmlApplicationContext context_WV=new ClassPathXmlApplicationContext(new String[]{"write_value/client1_beans.xml"});
SEIWriteValue port_WV = (SEIWriteValue) context_WV.getBean("write_a_value_Client");
...........................................................
I have created a client_beans xml file for each web service client. Is it ok? Can you provide me an example of how to call a web service and the way to hold just one App context?
I will provide you my email address < berlindutza#yahoo.com > in case you want to communicate much easier because I have seen that we are limited to a certain number of characters (for the add comment section).
Thank you a lot!

Guessing here: You are probably recreating the CXF client for every request, instead of creating it once, keeping it as a singleton and using this one instance for every subsequent request.
Ideally you should be able to generate the client using the webservice interface. If you have explicitly specified a wsdl, cxf will generate a proxy based on the WSDL, which is what seems to be happening for you. Once in a while the service which serves out the wsdl fails and you get this error.
If you are using Spring, you can do something along these lines:
<bean id="clientFactory" class="org.apache.cxf.jaxws.JaxWsProxyFactoryBean">
<property name="serviceClass" value="...wsInterface" />
<property name="address" value="serviceURL" />
</bean>
<bean id="client" class="...wsInterface" factory-bean="clientFactory" factory-method="create" />

Related

BindException when trying to run dual projects

Trying to run 2 separate Vertx applications. They both connect to the same database. I am getting the following bind exception.
I am only using http server on one of the projects thus don't think the following even matters. But tried it anyway with no difference. The error seems to stem from the attempt to connect to DB or so I think based on the exception. How can I overcome this to be able to run both projects same time? Please advice. Thanks.
Passing in the following as an environment variable doesn't make a diff as expected:
http.port=8095
Neither does setting port in following way makes a diff.
int port = 8095;
DeploymentOptions options = new DeploymentOptions().setConfig(new JsonObject().put("http.port", port));
vertx.deployVerticle("verticle.MyVerticle", options);
Exception:
Aug 31, 2020 6:28:37 PM io.vertx.ext.asyncsql.impl.PostgreSQLClientImpl
INFO: Creating configuration for localhost:4040
Aug 31, 2020 6:28:38 PM io.vertx.core.impl.launcher.commands.VertxIsolatedDeployer
INFO: Succeeded in deploying verticle
Aug 31, 2020 6:28:38 PM io.vertx.core.impl.ContextImpl
SEVERE: Unhandled exception
rx.exceptions.OnErrorNotImplementedException: Address already in use
at rx.functions.Actions$NotImplemented.call(Actions.java:576)
at rx.functions.Actions$NotImplemented.call(Actions.java:572)
at rx.Single$11.onError(Single.java:1794)
at io.vertx.rx.java.SingleOnSubscribeAdapter.lambda$call$0(SingleOnSubscribeAdapter.java:33)
at io.vertx.rxjava.core.http.HttpServer$6.handle(HttpServer.java:312)
at io.vertx.rxjava.core.http.HttpServer$6.handle(HttpServer.java:307)
at io.vertx.core.http.impl.HttpServerImpl.lambda$null$4(HttpServerImpl.java:350)
at io.vertx.core.impl.ContextImpl.executeTask(ContextImpl.java:320)
at io.vertx.core.impl.EventLoopContext.lambda$executeAsync$0(EventLoopContext.java:38)
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute$$$capture(AbstractEventExecutor.java:163)
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:404)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:495)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:905)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.net.BindException: Address already in use
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Net.java:433)
at sun.nio.ch.Net.bind(Net.java:425)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
at io.netty.channel.socket.nio.NioServerSocketChannel.doBind(NioServerSocketChannel.java:130)
at io.netty.channel.AbstractChannel$AbstractUnsafe.bind(AbstractChannel.java:563)
at io.netty.channel.DefaultChannelPipeline$HeadContext.bind(DefaultChannelPipeline.java:1332)
at io.netty.channel.AbstractChannelHandlerContext.invokeBind(AbstractChannelHandlerContext.java:488)
at io.netty.channel.AbstractChannelHandlerContext.bind(AbstractChannelHandlerContext.java:473)
at io.netty.channel.DefaultChannelPipeline.bind(DefaultChannelPipeline.java:984)
at io.netty.channel.AbstractChannel.bind(AbstractChannel.java:259)
at io.netty.bootstrap.AbstractBootstrap$2.run(AbstractBootstrap.java:366)
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute$$$capture(AbstractEventExecutor.java:163)
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasksFrom(SingleThreadEventExecutor.java:380)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:355)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:486)
... 3 more

SWRLRuleEngineAPI: wrong class format appears in both Eclipse and NetBeans IDEs while doing SWRL inference

I have a simple ontology and trying to do SWRL inference. On Protege 3.5 (build 663) the Jess and Drools engines work as expected while using the SWRL API an error occurs. As described in SWRLRuleEngineAPI I am using the following code:
SWRLRuleEngine ruleEngine = P3SWRLRuleEngineFactory.create(owlModel);
SWRLFactory factory = new SWRLFactory(owlModel);
SWRLImp imp = factory.createImp("Person(?x) ∧ hasGender(?x, male) → Male(?x)");
ruleEngine.infer();
classes = owlModel.getUserDefinedOWLNamedClasses();
for (Iterator it = classes.iterator(); it.hasNext();) {
OWLNamedClass cls = (OWLNamedClass) it.next();
Collection instances = cls.getInstances(false);
System.out.println("Class " + cls.getBrowserText() + " (" + instances.size() + ")");
for (Iterator jt = instances.iterator(); jt.hasNext();) {
OWLIndividual individual = (OWLIndividual) jt.next();
System.out.println(" - " + individual.getBrowserText());
}
}
All Protege API jars are referenced correctly, the code compiles well and the model is read correctly. But the following error appears on both Eclipse and NetBeans when activating the rule engine (SWRLRuleEngine ruleEngine = P3SWRLRuleEngineFactory.create(owlModel)):
INFO: Updating underlying frames model in 1 ms
Rule engine 'Jess' registered with the SWRLTab rule engine manager.
Oct 14, 2015 8:00:10 AM org.protege.swrltab.p3.P3SWRLRuleEngineFactory registerRuleEngine
INFO: Rule engine 'Jess' registered with the SWRLTab rule engine manager.
Plugin 'SWRLJessTab' registered with the SWRLTab plugin manager.
Oct 14, 2015 8:00:10 AM edu.stanford.smi.protegex.owl.swrl.P3SWRLTabPluginManager registerPlugin
INFO: Plugin 'SWRLJessTab' registered with the SWRLTab plugin manager.
Rule engine 'Drools' registered with the SWRLTab rule engine manager.
Oct 14, 2015 8:00:10 AM org.protege.swrltab.p3.P3SWRLRuleEngineFactory registerRuleEngine
INFO: Rule engine 'Drools' registered with the SWRLTab rule engine manager.
Plugin 'SWRLDroolsTab' registered with the SWRLTab plugin manager.
Oct 14, 2015 8:00:10 AM edu.stanford.smi.protegex.owl.swrl.P3SWRLTabPluginManager registerPlugin
INFO: Plugin 'SWRLDroolsTab' registered with the SWRLTab plugin manager.
Plugin 'SQWRLQueryTab' registered with the SWRLTab plugin manager.
Oct 14, 2015 8:00:10 AM edu.stanford.smi.protegex.owl.swrl.P3SWRLTabPluginManager registerPlugin
INFO: Plugin 'SQWRLQueryTab' registered with the SWRLTab plugin manager.
java.lang.RuntimeException: wrong class format
at org.drools.commons.jci.compilers.EclipseJavaCompiler$2.findType(EclipseJavaCompiler.java:251)
at org.drools.commons.jci.compilers.EclipseJavaCompiler$2.findType(EclipseJavaCompiler.java:202)
at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.askForType(LookupEnvironment.java:109)
at org.eclipse.jdt.internal.compiler.lookup.UnresolvedReferenceBinding.resolve(UnresolvedReferenceBinding.java:49)
at org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.resolveType(BinaryTypeBinding.java:122)
at org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.superInterfaces(BinaryTypeBinding.java:1152)
at org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding.implementsInterface(ReferenceBinding.java:888)
at org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding.isCompatibleWith0(ReferenceBinding.java:1036)
at org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding.isCompatibleWith(ReferenceBinding.java:987)
at org.eclipse.jdt.internal.compiler.lookup.Scope.parameterCompatibilityLevel(Scope.java:3963)
at org.eclipse.jdt.internal.compiler.lookup.Scope.parameterCompatibilityLevel(Scope.java:3951)
at org.eclipse.jdt.internal.compiler.lookup.Scope.computeCompatibleMethod(Scope.java:555)
at org.eclipse.jdt.internal.compiler.lookup.Scope.getConstructor(Scope.java:1882)
at org.eclipse.jdt.internal.compiler.ast.AllocationExpression.resolveType(AllocationExpression.java:359)
at org.eclipse.jdt.internal.compiler.ast.LocalDeclaration.resolve(LocalDeclaration.java:210)
at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolveStatements(AbstractMethodDeclaration.java:463)
at org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements(MethodDeclaration.java:252)
at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolve(AbstractMethodDeclaration.java:422)
at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1148)
at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1258)
at org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.resolve(CompilationUnitDeclaration.java:538)
at org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:763)
at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:468)
at org.drools.commons.jci.compilers.EclipseJavaCompiler.compile(EclipseJavaCompiler.java:358)
at org.drools.commons.jci.compilers.AbstractJavaCompiler.compile(AbstractJavaCompiler.java:49)
at org.drools.rule.builder.dialect.java.JavaDialect.compileAll(JavaDialect.java:370)
at org.drools.compiler.DialectCompiletimeRegistry.compileAll(DialectCompiletimeRegistry.java:47)
at org.drools.compiler.PackageRegistry.compileAll(PackageRegistry.java:101)
at org.drools.compiler.PackageBuilder.compileAll(PackageBuilder.java:966)
at org.drools.compiler.PackageBuilder.compileAllRules(PackageBuilder.java:802)
at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:791)
at org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:462)
at org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:664)
at org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:48)
at org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:35)
at org.protege.swrlapi.drools.DroolsSWRLRuleEngine.defineDRLResource(Unknown Source)
at org.protege.swrlapi.drools.DroolsSWRLRuleEngine.defineDRLRule(Unknown Source)
at org.protege.swrlapi.drools.DroolsSWRLRuleEngine.resetRuleEngine(Unknown Source)
at org.protege.swrlapi.drools.DroolsSWRLRuleEngine.(Unknown Source)
at org.protege.swrlapi.drools.DroolsSWRLRuleEngineCreator.create(Unknown Source)
at org.protege.swrltab.p3.P3SWRLRuleEngineFactory.create(Unknown Source)
at org.protege.swrltab.p3.P3SWRLRuleEngineFactory.create(Unknown Source)
at com.demo.application.OWLAPIDemoApplication.main(OWLAPIDemoApplication.java:107)
Caused by: org.eclipse.jdt.internal.compiler.classfmt.ClassFormatException
at org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader.(ClassFileReader.java:372)
at org.drools.commons.jci.compilers.EclipseJavaCompiler$2.createNameEnvironmentAnswer(EclipseJavaCompiler.java:275)
at org.drools.commons.jci.compilers.EclipseJavaCompiler$2.findType(EclipseJavaCompiler.java:246)
... 42 more
Exception in thread "main" org.protege.swrlapi.exceptions.SWRLRuleEngineException: Error creating rule engine Drools. Exception: org.protege.owl.portability.exceptions.TargetRuleEngineException. Message: internal error generating Drools rule
rule scm_cls when CDA($c:c) then SCA sca1=new SCA($c, $c); ECA eca=new ECA($c, $c); SCA sca2=new SCA($c, "owl:Thing"); SCA sca3=new SCA("owl:Nothing", $c); inferrer.infer(sca1, eca, sca2, sca3); end
wrong class format
at org.protege.swrltab.p3.P3SWRLRuleEngineFactory.create(Unknown Source)
at org.protege.swrltab.p3.P3SWRLRuleEngineFactory.create(Unknown Source)
at com.demo.application.OWLAPIDemoApplication.main(OWLAPIDemoApplication.java:107)
Caused by: org.protege.owl.portability.exceptions.TargetRuleEngineException: internal error generating Drools rule
rule scm_cls when CDA($c:c) then SCA sca1=new SCA($c, $c); ECA eca=new ECA($c, $c); SCA sca2=new SCA($c, "owl:Thing"); SCA sca3=new SCA("owl:Nothing", $c); inferrer.infer(sca1, eca, sca2, sca3); end
wrong class format
at org.protege.swrlapi.drools.DroolsSWRLRuleEngine.defineDRLRule(Unknown Source)
at org.protege.swrlapi.drools.DroolsSWRLRuleEngine.resetRuleEngine(Unknown Source)
at org.protege.swrlapi.drools.DroolsSWRLRuleEngine.(Unknown Source)
at org.protege.swrlapi.drools.DroolsSWRLRuleEngineCreator.create(Unknown Source)
... 3 more
Caused by: java.lang.RuntimeException: wrong class format
at org.drools.commons.jci.compilers.EclipseJavaCompiler$2.findType(EclipseJavaCompiler.java:251)
at org.drools.commons.jci.compilers.EclipseJavaCompiler$2.findType(EclipseJavaCompiler.java:202)
at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.askForType(LookupEnvironment.java:109)
at org.eclipse.jdt.internal.compiler.lookup.UnresolvedReferenceBinding.resolve(UnresolvedReferenceBinding.java:49)
at org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.resolveType(BinaryTypeBinding.java:122)
at org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.superInterfaces(BinaryTypeBinding.java:1152)
at org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding.implementsInterface(ReferenceBinding.java:888)
at org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding.isCompatibleWith0(ReferenceBinding.java:1036)
at org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding.isCompatibleWith(ReferenceBinding.java:987)
at org.eclipse.jdt.internal.compiler.lookup.Scope.parameterCompatibilityLevel(Scope.java:3963)
at org.eclipse.jdt.internal.compiler.lookup.Scope.parameterCompatibilityLevel(Scope.java:3951)
at org.eclipse.jdt.internal.compiler.lookup.Scope.computeCompatibleMethod(Scope.java:555)
at org.eclipse.jdt.internal.compiler.lookup.Scope.getConstructor(Scope.java:1882)
at org.eclipse.jdt.internal.compiler.ast.AllocationExpression.resolveType(AllocationExpression.java:359)
at org.eclipse.jdt.internal.compiler.ast.LocalDeclaration.resolve(LocalDeclaration.java:210)
at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolveStatements(AbstractMethodDeclaration.java:463)
at org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements(MethodDeclaration.java:252)
at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolve(AbstractMethodDeclaration.java:422)
at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1148)
at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1258)
at org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.resolve(CompilationUnitDeclaration.java:538)
at org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:763)
at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:468)
at org.drools.commons.jci.compilers.EclipseJavaCompiler.compile(EclipseJavaCompiler.java:358)
at org.drools.commons.jci.compilers.AbstractJavaCompiler.compile(AbstractJavaCompiler.java:49)
at org.drools.rule.builder.dialect.java.JavaDialect.compileAll(JavaDialect.java:370)
at org.drools.compiler.DialectCompiletimeRegistry.compileAll(DialectCompiletimeRegistry.java:47)
at org.drools.compiler.PackageRegistry.compileAll(PackageRegistry.java:101)
at org.drools.compiler.PackageBuilder.compileAll(PackageBuilder.java:966)
at org.drools.compiler.PackageBuilder.compileAllRules(PackageBuilder.java:802)
at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:791)
at org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:462)
at org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:664)
at org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:48)
at org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:35)
at org.protege.swrlapi.drools.DroolsSWRLRuleEngine.defineDRLResource(Unknown Source)
... 7 more
Caused by: org.eclipse.jdt.internal.compiler.classfmt.ClassFormatException
at org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader.(ClassFileReader.java:372)
at org.drools.commons.jci.compilers.EclipseJavaCompiler$2.createNameEnvironmentAnswer(EclipseJavaCompiler.java:275)
at org.drools.commons.jci.compilers.EclipseJavaCompiler$2.findType(EclipseJavaCompiler.java:246)
... 42 more
Java Result: 1
UPDATE: After downgrading to Java 7 the following issue appears:
Exception in thread "main" java.lang.NullPointerException at
org.protege.owl.portability.p3.converters.P3OWLAxiomConverter.completeBulkConversion(Unknown
Source) at
org.protege.swrlapi.core.impl.AbstractSWRLRuleEngine.writeInferredKnowledge2OWL(Unknown
Source) at
org.protege.swrlapi.core.impl.AbstractSWRLRuleEngine.infer(Unknown
Source) at
com.demo.application.OWLAPIDemoApplication.main(OWLAPIDemoApplication.java:125)
Java Result: 1
It was the Protege version issue. I resolved that by downgrading to the 3.4.8 version which was suggested by Martin O'Connor Answer which has been under extensive review.
Thank you all for your efforts.

java.lang.NoSuchFieldError: WADL_JSON in creating jersey rest client

I am creating jersey rest client with jackson pojo mapping.
here is code spinet:
ClientConfig clientConfig = new DefaultClientConfig();
clientConfig.getClasses().add(JacksonJsonProvider.class);
clientConfig.getFeatures().put(JSONConfiguration.FEATURE_POJO_MAPPING, Boolean.TRUE);
client = Client.create(clientConfig);
webResource = client.resource("url to exposed rest web service");
This code is throwing following exception at line client = Client.create(clientConfig)
Sep 01, 2014 12:42:04 PM com.sun.jersey.core.spi.component.ProviderFactory __getComponentProvider
SEVERE: The provider class, class com.sun.jersey.json.impl.provider.entity.JSONRootElementProvider$Wadl, could not be instantiated. Processing will continue but the class will not be utilized
java.lang.NoSuchFieldError: WADL_JSON
at com.sun.jersey.json.impl.provider.entity.JSONRootElementProvider$Wadl.<init>(JSONRootElementProvider.java:138)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at com.sun.jersey.core.spi.component.ComponentConstructor._getInstance(ComponentConstructor.java:161)
at com.sun.jersey.core.spi.component.ComponentConstructor.getInstance(ComponentConstructor.java:141)
at com.sun.jersey.core.spi.component.ProviderFactory.__getComponentProvider(ProviderFactory.java:163)
at com.sun.jersey.core.spi.component.ProviderFactory.getComponentProvider(ProviderFactory.java:134)
at com.sun.jersey.core.spi.component.ProviderServices.getComponent(ProviderServices.java:232)
at com.sun.jersey.core.spi.component.ProviderServices.getProvidersAndServices(ProviderServices.java:149)
at com.sun.jersey.core.spi.factory.MessageBodyFactory.initReaders(MessageBodyFactory.java:153)
at com.sun.jersey.core.spi.factory.MessageBodyFactory.init(MessageBodyFactory.java:145)
at com.sun.jersey.api.client.Client.<init>(Client.java:275)
at com.sun.jersey.api.client.Client.<init>(Client.java:150)
at com.sun.jersey.api.client.Client.create(Client.java:476)
at com.snapdeal.rnrs.client.RClient.<init>(RClient.java:29)
at com.snapdeal.rnrs.client.RestClient.main(RestClient.java:45)
Sep 01, 2014 12:42:04 PM com.sun.jersey.core.spi.component.ProviderFactory __getComponentProvider
SEVERE: The provider class, class com.sun.jersey.json.impl.provider.entity.JSONRootElementProvider$Wadl, could not be instantiated. Processing will continue but the class will not be utilized
java.lang.NoSuchFieldError: WADL_JSON
at com.sun.jersey.json.impl.provider.entity.JSONRootElementProvider$Wadl.<init>(JSONRootElementProvider.java:138)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at com.sun.jersey.core.spi.component.ComponentConstructor._getInstance(ComponentConstructor.java:161)
at com.sun.jersey.core.spi.component.ComponentConstructor.getInstance(ComponentConstructor.java:141)
at com.sun.jersey.core.spi.component.ProviderFactory.__getComponentProvider(ProviderFactory.java:163)
at com.sun.jersey.core.spi.component.ProviderFactory.getComponentProvider(ProviderFactory.java:134)
at com.sun.jersey.core.spi.component.ProviderServices.getComponent(ProviderServices.java:232)
at com.sun.jersey.core.spi.component.ProviderServices.getProvidersAndServices(ProviderServices.java:149)
at com.sun.jersey.core.spi.factory.MessageBodyFactory.initWriters(MessageBodyFactory.java:171)
at com.sun.jersey.core.spi.factory.MessageBodyFactory.init(MessageBodyFactory.java:146)
at com.sun.jersey.api.client.Client.<init>(Client.java:275)
at com.sun.jersey.api.client.Client.<init>(Client.java:150)
at com.sun.jersey.api.client.Client.create(Client.java:476)
at com.snapdeal.rnrs.client.RClient.<init>(RClient.java:29)
at com.snapdeal.rnrs.client.RestClient.main(RestClient.java:45)
I am using following jars:
jackson-core-asl:1.9.13
jackson-jaxrs:1.9.13
jackson-xc:1.9.13
jersey-client:1.1.5.1
I am fed up searching google and stackoverflow, but could not find any solution. Please suggest some solution if any one faced the same error and solved the problem.
I got the solution of the problem. It was due to jar conflicts.
I change jersey-client:1.1.5.1 to jersey-client:1.18

Jini (Apache River) cannot initialize Reggie (Lookup Service) script

I know Jini (Apache River) is a pretty old and outdated technology, but I need it for an university project.
The problem is I cannot even start the lookup service script (jrmp-reggie.sh). Executing the httpd.sh works good.
Any advice? Thanks.
By the way, here is the output I'm getting:
+ java -Djava.security.policy=config/start.policy -Djava.ext.dirs=../../lib-ext/ -jar ../../lib/start.jar config/start-reggie.config
Jun 14, 2013 8:19:51 PM com.sun.jini.reggie.RegistrarImpl <init>
SEVERE: Reggie initialization failed
java.lang.ExceptionInInitializerError
at net.jini.config.AbstractConfiguration.getEntryInternal(AbstractConfiguration.java:371)
at net.jini.config.AbstractConfiguration.getEntry(AbstractConfiguration.java:193)
at com.sun.jini.reggie.RegistrarImpl.init(RegistrarImpl.java:4554)
at com.sun.jini.reggie.RegistrarImpl.access$000(RegistrarImpl.java:143)
at com.sun.jini.reggie.RegistrarImpl$1.run(RegistrarImpl.java:448)
at com.sun.jini.reggie.RegistrarImpl.loginAndRun(RegistrarImpl.java:461)
at com.sun.jini.reggie.RegistrarImpl.<init>(RegistrarImpl.java:396)
at com.sun.jini.reggie.TransientRegistrarImpl.<init>(TransientRegistrarImpl.java:39)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at com.sun.jini.start.NonActivatableServiceDescriptor.create(NonActivatableServiceDescriptor.java:674)
at com.sun.jini.start.ServiceStarter.create(ServiceStarter.java:287)
at com.sun.jini.start.ServiceStarter.processServiceDescriptors(ServiceStarter.java:445)
at com.sun.jini.start.ServiceStarter.main(ServiceStarter.java:476)
Caused by: java.lang.RuntimeException: Unexpected exception
at com.sun.jini.logging.Levels.createLevel(Levels.java:142)
at com.sun.jini.logging.Levels.<clinit>(Levels.java:52)
... 16 more
Caused by: java.io.EOFException
at java.io.ObjectInputStream$BlockDataInputStream.peekByte(ObjectInputStream.java:2596)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1316)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1989)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1913)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1796)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1348)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370)
at com.sun.jini.logging.Levels.createLevel(Levels.java:138)
... 17 more
Jun 14, 2013 8:19:51 PM com.sun.jini.start.ServiceStarter checkResultFailures
WARNING: Exception creating service.
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at com.sun.jini.start.NonActivatableServiceDescriptor.create(NonActivatableServiceDescriptor.java:674)
at com.sun.jini.start.ServiceStarter.create(ServiceStarter.java:287)
at com.sun.jini.start.ServiceStarter.processServiceDescriptors(ServiceStarter.java:445)
at com.sun.jini.start.ServiceStarter.main(ServiceStarter.java:476)
Caused by: java.lang.ExceptionInInitializerError
at net.jini.config.AbstractConfiguration.getEntryInternal(AbstractConfiguration.java:371)
at net.jini.config.AbstractConfiguration.getEntry(AbstractConfiguration.java:193)
at com.sun.jini.reggie.RegistrarImpl.init(RegistrarImpl.java:4554)
at com.sun.jini.reggie.RegistrarImpl.access$000(RegistrarImpl.java:143)
at com.sun.jini.reggie.RegistrarImpl$1.run(RegistrarImpl.java:448)
at com.sun.jini.reggie.RegistrarImpl.loginAndRun(RegistrarImpl.java:461)
at com.sun.jini.reggie.RegistrarImpl.<init>(RegistrarImpl.java:396)
at com.sun.jini.reggie.TransientRegistrarImpl.<init>(TransientRegistrarImpl.java:39)
... 8 more
Caused by: java.lang.RuntimeException: Unexpected exception
at com.sun.jini.logging.Levels.createLevel(Levels.java:142)
at com.sun.jini.logging.Levels.<clinit>(Levels.java:52)
... 16 more
Caused by: java.io.EOFException
at java.io.ObjectInputStream$BlockDataInputStream.peekByte(ObjectInputStream.java:2596)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1316)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1989)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1913)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1796)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1348)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370)
at com.sun.jini.logging.Levels.createLevel(Levels.java:138)
... 17 more
Jun 14, 2013 8:19:51 PM com.sun.jini.start.ServiceStarter checkResultFailures
WARNING: Associated service descriptor [0]: [http://t420:8080/reggie-dl.jar http://t420:8080/jsk-dl.jar, config/reggie.policy, ../../lib/reggie.jar, com.sun.jini.reggie.TransientRegistrarImpl, [config/jrmp-reggie.config], com.sun.jini.start.NonActivatableServiceDescriptor$1#c27ce4, BasicProxyPreparer[]]
This looks like the same error I have seen when upgrading the JDK. Try JDK 1.6.0_38 (if you are using a higher version). Also the Apache River project did come across this issue and appeared to have a workaround which involves changing Levels.java
https://issues.apache.org/jira/browse/RIVER-415
Regards
Rod
Sounds like you didn't start rmid possibly.
I guess the Reggie script attempts to gain access to configuration files, but it cant!
If the script is located in: river/examples/hello/scripts
Copy it on folder higher. I mean river/examples/hello/
Then, run it. Just let me know about your output. You are using 'sh' file. But, do not use the 'bat' file. Let me know the result.

Unable to Create map entries in Hazelcast

I am using Hazelcast v2.5 and Maven plugin in Eclipse . I tried running an example program in Eclipse which creates 3 map entries in the ABCD namespace . When I run my code in Eclipse it shows this WARNING message
Feb 07, 2013 12:08:23 PM com.hazelcast.impl.ConcurrentMapManager
WARNING: [192.168.1.36]:5702 [dev] Caller -> RedoLog{name=c:ABCD, redoType=REDO_TARGET_UNKNOWN, operation=CONCURRENT_MAP_MERGE, target=null / connected=false, redoCount=53, migrating=null
partition=Partition [227]{
}
}
This keeps on Iterating till the redo threshold exceeds.
Feb 07, 2013 12:08:42 PM com.hazelcast.impl.LifecycleServiceImpl
WARNING: [192.168.1.36]:5702 [dev] [CONCURRENT_MAP_MERGE] Redo threshold[90] exceeded! Last redo cause: REDO_TARGET_UNKNOWN, Name: c:ABCD
com.hazelcast.core.OperationTimeoutException: [CONCURRENT_MAP_MERGE] Redo threshold[90] exceeded! Last redo cause: REDO_TARGET_UNKNOWN, Name: c:ABCD
at com.hazelcast.impl.BaseManager$ResponseQueueCall.getRedoAwareResult(BaseManager.java:640)
at com.hazelcast.impl.BaseManager$ResponseQueueCall.getResult(BaseManager.java:627)
at com.hazelcast.impl.BaseManager$RequestBasedCall.getResultAsBoolean(BaseManager.java:437)
at com.hazelcast.impl.BaseManager$ResponseQueueCall.getResultAsBoolean(BaseManager.java:544)
at com.hazelcast.impl.ConcurrentMapManager$MPut.mergeOne(ConcurrentMapManager.java:1758)
at com.hazelcast.impl.ConcurrentMapManager$MPut.merge(ConcurrentMapManager.java:1747)
at com.hazelcast.impl.LifecycleServiceImpl$1.run(LifecycleServiceImpl.java:143)
at com.hazelcast.impl.executor.ParallelExecutorService$ParallelExecutorImpl$ExecutionSegment.run(ParallelExecutorService.java:212)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
at com.hazelcast.impl.ExecutorThreadFactory$1.run(ExecutorThreadFactory.java:38)
Why does this occur ?
Please Help.!
You can do the following just to get started with a barebones Java class (I suggest you go through a more detailed tutorial as it might be more useful - I have not gone over accessing Hazelcast service):
Specify the map in the hazelcast.xml file as follows:
<map name="testMap">
<backup-count>1</backup-count>
<eviction-policy>NONE</eviction-policy>
<max-size policy="cluster_wide_map_size">0</max-size>
<eviction-percentage>25</eviction-percentage>
<merge-policy>hz.ADD_NEW_ENTRY</merge-policy>
<map-store enabled="true">
<class-name>models.test.StoreLoadTestMap</class-name>
<write-delay-seconds>5</write-delay-seconds>
</map-store>
<entry-listeners>
<entry-listener include value="true"local="false">models.test.ListenerTestMap</entry-listener>
</entry-listeners>
</map>
Once done, you can simply call the following from your Java app:
IMap<String, testObject> testMap = Hazelcast.getMap("testMap");
Now, you should be able to put/get values to and from the map as needed. You can use tcp or multicasting for replication based on your use case (use tcp if possible) and retrieve info from the second map for confirmation of data replication. Please also understand how data gets replicated across maps.
Hope it helps

Categories