I have generated java classes from wsdl file using the apache cxf. It generates the JAXBElement. I make this as jar file and exposed as #WebService. If I generate the java files from the new wsdl, it doesn't generate teh necessary JAXBElement. Please help. thanks in advance.
Related
java.lang.RuntimeException: Unable to find specification: com/concordion/Concordion.html
I'm using Concordion 2.2.0 with Junit 5 jupiter using the Junit 4 vintage engine and a TFS build agent using maven. The maven surefire picks up the Concordion java file but simply can't find the corresponding Concordion html and so the auto-tests fail.
The html specification file is in the resources directory but it doesn't matter where I put it, the surefire / concordion libraries can't find it!
The specification files need to be on the classpath in the same package as the Java class. Typically this is under the src/test/resources folder. See https://concordion.org/coding/java/markdown/#locating-the-specification for more details.
Are you able to provide a simplified test case showing the issue?
Moving the specifications to the same location as the java files (src/test/java or src/main/java) should get it working in the short term.
I use Camel 2.22.1 with springboot 2.0.4.RELEASE. The camel component camel-saxon use default Saxon-HE. I have some Xquery files, which call Java method, so I want to replace Saxon-HE with Saxon-PE. I requested one test license for Saxon-PE and tried different ways and didn't get it work. The Saxon-PE jar file saxon9pe.jar is already loaded, however, it is still working as Saxon HE edition. I guess, the license is not correctly loaded by Saxon-PE.
I tried following ways, none of them has worked.
put license file saxon-license.lic and saxon9pe.jar in the same folder
define an environment variable SAXON_HOME, and put saxon-license.lic and saxonpe.jar in SAXON_HOME\bin
modify org.apache.camel.component.xquery.XQueryBuilder.configuration in class XqueryBuild.java in package org.apache.camel.component.xquery to set LICENSE_FILE_LOCATION ( I got Error: Unknown configuration property http://saxon.sf.net/feature/licenseFileLocation)
The Saxon Documentation mentioned to create an XML configuration file, but I don't know where should I put this XML configuration file.
When running an Xquery with Java call I got the error:
Caused by: net.sf.saxon.trans.XPathException: Cannot find a 0-argument function named Q{java:java.lang.Double}MAX_VALUE(). Reflexive calls to Java methods are not available under Saxon-HE at net.sf.saxon.query.UnboundFunctionLibrary.bindUnboundFunctionReferences(UnboundFunctionLibrary.java:166) ~[saxon9pe.jar!/:na]
at net.sf.saxon.query.QueryModule.bindUnboundFunctionCalls(QueryModule.java:1172) ~[saxon9pe.jar!/:na]
at net.sf.saxon.expr.instruct.Executable.fixupQueryModules(Executable.java:462) ~[saxon9pe.jar!/:na]
at net.sf.saxon.query.XQueryParser.makeXQueryExpression(XQueryParser.java:176) ~[saxon9pe.jar!/:na]
at net.sf.saxon.query.StaticQueryContext.compileQuery(StaticQueryContext.java:597) ~[saxon9pe.jar!/:na]
at net.sf.saxon.query.StaticQueryContext.compileQuery(StaticQueryContext.java:658) ~[saxon9pe.jar!/:na]
at org.apache.camel.component.xquery.XQueryBuilder$3.createQueryExpression(XQueryBuilder.java:276) ~[classes!/:2.23.1]
at org.apache.camel.component.xquery.XQueryBuilder.initialize(XQueryBuilder.java:745) ~[classes!/:2.23.1]
at org.apache.camel.component.xquery.XQueryBuilder.evaluateAsDOM(XQueryBuilder.java:190) ~[classes!/:2.23.1]
at org.apache.camel.component.xquery.XQueryBuilder.evaluate(XQueryBuilder.java:151) ~[classes!/:2.23.1]
... 40 common frames omitted
Can some share some experience with setting up Saxon-PE with camel to get calling Java working within Xquery?
Thanks!
From the extra information supplied, it looks as if you're picking up the Saxon JAR file but not the license file.
Putting the license file in the same folder as the JAR file is often enough, but it only works with some classloaders.
In general you either need to ensure that the directory containing the JAR file is on the classpath, or you need to (somehow) set Saxon's configuration property LICENSE_FILE_LOCATION.
According to https://github.com/apache/camel/blob/master/components/camel-saxon/src/main/docs/xquery-component.adoc, you can set Saxon configuration properties using configuration and configurationProperties, but I don't see any further explanation of how this works. I'll have a dig around.
I need to convert wadl to java pojo, for that i have downloaded apache cxf 3.0.1 version. But when i run wadl2java bat file in my command prompt, i am getting following exception
D:\software\apache-cxf-3.0.1\bin>wadl2java -h
Error: Could not find or load main class org.apache.cxf.tools.wadlto.WADLToJava
Here this script file is looking for WADLToJava class. i have downloaded the apache cxf source distribution, i can see that wadl2java class is there. Please suggest me how i can use apache cxf to generate java files from wadl url.
You need to set CFX_HOME and CLASSPATH environments variables.
CXF_HOME should be your installation dir, in your example;
CXF_HOME=D:\software\apache-cxf-3.0.1\
CLASSPATH is variable used for setting java classpath for wadl2java script, in your windows example;
CLASSPATH=.;%CXF_HOME%\lib\*
I was following http://code.google.com/appengine/articles/soap.html to create a Web Service in Google App Engine. After reach item no 4, where i need to run wsgen to generate wsdl file for my Web Service, I found the sample syntax was given for Linux. I managed to find the syntax for Window but when i run it, It creates a package called jaxws but no xsd and wsdl file created. It only creates package com.example.jaxws and no other java files created in side the package.
What I did:
1st I compile the java file in CMD
C:\Smartag_Eclipse_Project\HelloSOAPServer\src>javac com\example\Greeter.java
2nd I run wsgen
C:\Smartag_Eclipse_Project\HelloSOAPServer\src>wsgen -cp . com.example.Greeter -
wsdl
Appreciate if someone could help me on this. Thanks.
Problem solved.
wsgen -cp C:\Smartag_Eclipse_Project\HelloSOAPServer\war\WEB-INF\classes -wsdl -keep -r C:\Smartag_Eclipse_Project\HelloSOAPServer\war -d C:\Smartag_Eclipse_Project\HelloSOAPServer\war\WEB-INF\classes -s C:\Smartag_Eclipse_Project\HelloSOAPServer\src com.example.Greeter
We get the following error when we use WSDL2Java tool to generate stubs. The webservice is up and running.
WSDLToJava Error: org.apache.cxf.wsdl11.WSDLRuntimeException: Fail to create wsd
l definition from : http://scheduler.heartbeatsoftware.com/scheduler/WebServices
/SampleSNMWebService?wsdl
Caused by : WSDLException: faultCode=PARSER_ERROR: java.lang.IllegalArgumentExce
ption: InputSource must have a ByteStream or CharacterStream
If we donwload the wsdl and generate stubs from that wsdl, they are generated. But the java client using those stubs throws the same exception as above
Strangely when we deploy the same webservice on our LAN such a problem is not encountered stubs are generated sucessfully and the subsequent java client works well.
The webservice is created using apache cxf version 2.2.5 and hosted on tomcat 6
Any pointers would be appreciated
regards
Sameer
Found solution. Just need to modify the wsdl.java.bat to include proxy settings
-Dhttp.proxyHost= -Dhttp.proxyPort=8080