cxf wsdl2Java XMLConstant unknown - java

I am trying to create a SOAP Webservice in Java using Apache CXF. For the dependencies and the wsdl2Java task I use gradle. Until now it worked fine but somehow gradle cant create the Java Classes anymore (problem only on my computer, but it works on other buildservers). Another weird fact is that the gradle build within Eclipse works too, but not when I am trying to build via cmd or git bash.
The exception thrown is the following:
WSDLToJava Error: org.xml.sax.SAXNotRecognizedException: Eigenschaft "http://javax.xml.XMLConstants/property/accessExternalSchema" i
st unbekannt.
org.apache.cxf.tools.common.ToolException: org.xml.sax.SAXNotRecognizedException: Eigenschaft "http://javax.xml.XMLConstants/propert
y/accessExternalSchema" ist unbekannt.
at org.apache.cxf.tools.validator.internal.SchemaValidator.validate(SchemaValidator.java:215)
at org.apache.cxf.tools.validator.internal.SchemaValidator.validate(SchemaValidator.java:120)
at org.apache.cxf.tools.validator.internal.SchemaValidator.isValid(SchemaValidator.java:103)
at org.apache.cxf.tools.validator.internal.WSDL11Validator.isValid(WSDL11Validator.java:157)
at org.apache.cxf.tools.wsdlto.frontend.jaxws.wsdl11.JAXWSDefinitionBuilder.validate(JAXWSDefinitionBuilder.java:207)
at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.processWsdl(WSDLToJavaContainer.java:205)
at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:165)
at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:416)
at org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:103)
at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:113)
at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:86)
at org.apache.cxf.tools.wsdlto.WSDLToJava.main(WSDLToJava.java:184)
Caused by: org.xml.sax.SAXNotRecognizedException: Eigenschaft "http://javax.xml.XMLConstants/property/accessExternalSchema" ist unbe
kannt.
at com.sun.org.apache.xerces.internal.jaxp.validation.XMLSchemaFactory.setProperty(XMLSchemaFactory.java:399)
at org.apache.cxf.tools.validator.internal.SchemaValidator.createSchema(SchemaValidator.java:129)
at org.apache.cxf.tools.validator.internal.SchemaValidator.validate(SchemaValidator.java:194)
... 11 more

Related

Gerrit upgrade to 3.4.1 Failed with NoClassDefFoundError ChangeKeyAdapter

I came into an error of NoClassFound Error when I exec cmd 'bash gerrit.sh run'.
Before that I have make my Gerrit version upgraded from 3.2.3 to 3.4.1 by
jar -jar gerrit.3.4.1.jar init -d ${MY-GerritSite}.
And it returned Initialized success.
Here is my Error log when start Gerrit server.
Any help is appreciate.
Thank you.
com.google.inject.CreationException: Unable to create injector, see the following errors:
1) [Guice/ErrorInjectingConstructor]: NoClassDefFoundError: com/google/gerrit/server/change/ChangeKeyAdapter
at Log4jMessageLogger.<init>(Log4jMessageLogger.java:38)
at Log4jMessageLogger.class(Log4jMessageLogger.java:38)
while locating Log4jMessageLogger
while locating LifecycleListener annotated with #UniqueAnnotations$Internal(value=59)
Learn more:
https://github.com/google/guice/wiki/ERROR_INJECTING_CONSTRUCTOR
Caused by: NoClassDefFoundError: com/google/gerrit/server/change/ChangeKeyAdapter
at EventGsonProvider.get(EventGsonProvider.java:80)
at Log4jMessageLogger.<init>(Log4jMessageLogger.java:40)
at Log4jMessageLogger$$FastClassByGuice$$745685493.GUICE$TRAMPOLINE(<generated>)
at Log4jMessageLogger$$FastClassByGuice$$745685493.apply(<generated>)
at DefaultConstructionProxyFactory$FastClassProxy.newInstance(DefaultConstructionProxyFactory.java:82)
at ConstructorInjector.provision(ConstructorInjector.java:114)
at ConstructorInjector.construct(ConstructorInjector.java:91)
at ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:296)
at ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
at SingletonScope$1.get(SingletonScope.java:169)
at InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:45)
at FactoryProxy.get(FactoryProxy.java:60)
at InternalInjectorCreator.loadEagerSingletons(InternalInjectorCreator.java:213)
at InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:186)
at InternalInjectorCreator.build(InternalInjectorCreator.java:113)
at InjectorImpl.createChildInjector(InjectorImpl.java:239)
at Daemon.createSysInjector(Daemon.java:521)
at Daemon.start(Daemon.java:361)
at Daemon.run(Daemon.java:279)
at AbstractProgram.main(AbstractProgram.java:61)
at java.base/NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/Method.invoke(Method.java:566)
at GerritLauncher.invokeProgram(GerritLauncher.java:224)
at GerritLauncher.mainImpl(GerritLauncher.java:120)
at GerritLauncher.main(GerritLauncher.java:65)
at Main.main(Main.java:28)
Caused by: ClassNotFoundException: ChangeKeyAdapter
at java.base/URLClassLoader.findClass(URLClassLoader.java:471)
at java.base/ClassLoader.loadClass(ClassLoader.java:588)
at java.base/FactoryURLClassLoader.loadClass(URLClassLoader.java:899)
at java.base/ClassLoader.loadClass(ClassLoader.java:521)
... 28 more

BIRT Build standalone report generator in a JAR

I have built a Java 1.8 application under Maven in Eclipse that allows me to generate BIRT reports in a programmatic way without the need for the UI. Within Eclipse everything works fine. If I compile the code into a JAR file and try to run it however I run into problems with java.lang.NoClassDefFoundErrors. Clearly I have a missing dependancy but I don't know how to resolve the problem.
The error is
java -cp target/* com.resonancex.scheduler.Scheduler
Establishing conection...
Connected
Got products to report
ProductId=1 ProductType=BREN Isin=XS1939207996 Template=BREN_MU
* birtEngine EngineConfig: org.eclipse.birt.report.engine.api.EngineConfig.emitterConfigs={html=org.eclipse.birt.report.engine.api.HTMLEmitterConfig#71bbf57e};
* Birt Engine Startring ....
Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/core/runtime/CoreException
at org.eclipse.birt.core.framework.Platform.createPlatformLauncher(Platform.java:115)
at org.eclipse.birt.core.framework.Platform.startup(Platform.java:74)
at com.resonancex.scheduler.BirtEngine.start(BirtEngine.java:33)
at com.resonancex.scheduler.BirtEngine.getBirtEngine(BirtEngine.java:47)
at com.resonancex.scheduler.BIRTReportGenerator.setReportCustom(BIRTReportGenerator.java:67)
at com.resonancex.scheduler.Scheduler.generateAllReports(Scheduler.java:68)
at com.resonancex.scheduler.Scheduler.main(Scheduler.java:79)
Caused by: java.lang.ClassNotFoundException: org.eclipse.core.runtime.CoreException
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
I added the library org.eclipse.birt.runtime_4.8.0-20180626-4.8.0 which appears to be the required BIRT runtime. Can anyone give me a few pointers as to what else I may need?
Just in case anyone else tries to do this I thought I would list the libraries I needed to install to get standalone BIRT report generation running running. The list is as follows. Obviously this list may change over time so keep that in mind:
axis-1.4.jar
batik-anim-1.7.jar
batik-awt-util-1.7.jar
batik-bridge-1.7.jar
batik-css-1.7.jar
batik-dom-1.7.jar
batik-gvt-1.7.jar
batik-i18n-1.9.jar
batik-parser-1.7.jar
batik-script-1.7.jar
batik-svg-dom-1.7.jar
batik-transcoder-1.7.jar
batik-util-1.8.jar
batik-xml-1.7.jar
hibernate-agroal-5.4.9.Final.jar
icu4j-4.8.jar
itext-2.1.7.jar
mssql-jdbc-7.4.1.jre8.jar
org.apache.batik.css-1.6.0.jar
org.eclipse.birt.runtime_4.8.0-20180626-4.8.0.jar
org.eclipse.core.runtime_3.14.0.v20180417-0825-4.8.0.jar
org.eclipse.datatools.connectivity.oda-3.5.0.201603142002.jar
org.eclipse.datatools.connectivity.oda.consumer-3.3.0.201603142002.jar
org.eclipse.emf.common-2.16.0.jar
org.eclipse.emf.ecore-2.11.1.jar
org.eclipse.emf.ecore.xmi-2.11.1.jar
org.eclipse.equinox.common_3.10.0.v20180412-1130-4.8.0.jar
org.eclipse.equinox.registry_3.8.0.v20180426-1327-4.8.0.jar
org.eclipse.osgi_3.13.0.v20180409-1500-4.8.0.jar
org.mozilla.javascript-1.7.5.v201504281450.jar
org.w3c.dom.smil_1.0.1.v200903091627-4.8.0.jar
org.w3c.dom.svg-1.1.0.jar
sac-1.3.jar
xml-apis-1.4.01.jar

Jenkins Pipeline error when building

We have been trying to get Pipeline working on Jenkins 2.107 however it keeps coming up with an error that i have struggled to locate online. We have a Windows 2008 R2 server with Jenkins running as a service.
I have installed the pipeline plugin and set up the Hello World provided to test it. As soon s it starts to build it throws this error to the console.
Running in Durability level: MAX_SURVIVABILITY [BFA] Scanning build
for known causes... [BFA] No failure causes found [BFA] Done. 0s
java.lang.ClassNotFoundException:
org.kohsuke.groovy.sandbox.GroovyInterceptor at
jenkins.util.AntClassLoader.findClassInComponents(AntClassLoader.java:1374)
at jenkins.util.AntClassLoader.findClass(AntClassLoader.java:1327)
at jenkins.util.AntClassLoader.loadClass(AntClassLoader.java:1080)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) Caused:
java.lang.NoClassDefFoundError:
org/kohsuke/groovy/sandbox/GroovyInterceptor at
org.jenkinsci.plugins.workflow.cps.CpsGroovyShellFactory.makeClassLoader(CpsGroovyShellFactory.java:113)
at
org.jenkinsci.plugins.workflow.cps.CpsGroovyShellFactory.build(CpsGroovyShellFactory.java:119)
at
org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:556)
at
org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:520)
at
org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:319)
at
hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429) Finished: FAILURE
We are running Java 8 and i have set Jenkins to use Java 8 in the config file. I have researched this error but can't seem to find something similar.
We have another server which runs pipeline fine however the differences are that this is windows 2012 server and it is running an older version of Jenkins and Java. Other than the two differences all plugins and config match.
I had this error and resolved it by upgrading the Script Security plugin to version 1.44 (had 1.41).

Running jenkins job getting error -> FATAL: Could not initialize class hudson.util.ProcessTree$UnixReflection

Good evening,
I have been pulling my hair with that error, not able to get any solution over the internet.
Just trying to build my Javascript project with Jenkins. my test are written with Jasmine framework and are all passing but if fails because of that error:
FATAL: Could not initialize class hudson.util.ProcessTree$UnixReflection
java.lang.NoClassDefFoundError: Could not initialize class hudson.util.ProcessTree$UnixReflection
at hudson.util.ProcessTree$Unix.get(ProcessTree.java:506)
at hudson.util.ProcessTree.killAll(ProcessTree.java:144)
at hudson.Proc$LocalProc.destroy(Proc.java:380)
at hudson.Proc$LocalProc.join(Proc.java:353)
at hudson.tasks.CommandInterpreter.join(CommandInterpreter.java:155)
at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:109)
at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:66)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
at hudson.model.Build$BuildExecution.build(Build.java:206)
at hudson.model.Build$BuildExecution.doRun(Build.java:163)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
at hudson.model.Run.execute(Run.java:1728)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:405)
Already tried to downgrade Java JDK from 1.8 to 1.7

CFX wadl2java problem generating java

Hi I'm trying to generate the Java classes that are defined in the following WADL
http://www.epo.org/searching/free/ops.html
I'm trying to do it by command line. I've download the WADL and the XSD and also the apache-cfx-2.4.2.
I've tried to run the following command:
wadl2java" -verbose ops.wadl
I'm getting this error:
org.apache.cxf.tools.common.ToolException: java.lang.NullPointerException
at org.apache.cxf.tools.wadlto.jaxrs.JAXRSContainer.execute(JAXRSContainer.java:75)
at org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:103)
at org.apache.cxf.tools.wadlto.WADLToJava.run(WADLToJava.java:65)
at org.apache.cxf.tools.wadlto.WADLToJava.run(WADLToJava.java:57)
at org.apache.cxf.tools.wadlto.WADLToJava.main(WADLToJava.java:99)
Caused by: java.lang.NullPointerException
at org.apache.cxf.jaxrs.ext.codegen.SourceGenerator.createCodeModel(SourceGenerator.java:914)
at org.apache.cxf.jaxrs.ext.codegen.SourceGenerator.generateSchemaCodeAndInfo(SourceGenerator.java:182)
Does anyone know how to generate Java Classes from WADL without using Maven (I haven't got the permission to use it)?
I ended up using the XSD's and generating the code from there.
I used the JAXB xcj command.

Categories

Resources