WSDL2Java tool error Apache CXF - cxf

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

Related

Camel JBang Error : imported package/class does not exist in the Camel Router program

I am using CXF SOAP to invoke a SOAP webservice. Here I am attaching the sample code from GitHub. and the command i use to run is as below.
Git Repository
https://github.com/gtata007/camel-k-soap/tree/develop
JBang run command below :
camel run TestWeb.java --deps=camel-cxf:3.14.0
While I am trying to build/run the application with the camel Jbang command to test this webservice locally, it started throwing an error. Because it is unable to reference the java package/classes from in my route builder java code. What are the possible ways to build this application by referring to the class files?
Below is the error stack trace for reference.
org.joor.ReflectException: Compilation error:
/TestWeb.java:5: error: package org.oorsprong.websamples_countryinfo does not exist
import org.oorsprong.websamples_countryinfo.CountryInfoService;
^
at org.apache.camel.dsl.java.joor.MultiCompile.compileUnit(MultiCompile.java:144)
at org.apache.camel.dsl.java.joor.JavaRoutesBuilderLoader.doLoadRoutesBuilders(JavaRoutesBuilderLoader.java:122)
at org.apache.camel.dsl.support.ExtendedRouteBuilderLoaderSupport.loadRoutesBuilders(ExtendedRouteBuilderLoaderSupport.java:48)
at org.apache.camel.impl.engine.DefaultRoutesLoader.findRoutesBuilders(DefaultRoutesLoader.java:119)
at org.apache.camel.main.DefaultRoutesCollector.collectRoutesFromDirectory(DefaultRoutesCollector.java:148)
at org.apache.camel.main.RoutesConfigurer.configureRoutes(RoutesConfigurer.java:187)
at org.apache.camel.main.BaseMainSupport.configureRoutes(BaseMainSupport.java:652)
at org.apache.camel.main.MainSupport.initCamelContext(MainSupport.java:404)
at org.apache.camel.main.KameletMain.doInit(KameletMain.java:265)
at org.apache.camel.support.service.BaseService.init(BaseService.java:83)
at org.apache.camel.support.service.BaseService.start(BaseService.java:111)
at org.apache.camel.dsl.jbang.core.commands.Run.run(Run.java:560)
at org.apache.camel.dsl.jbang.core.commands.Run.call(Run.java:208)
at org.apache.camel.dsl.jbang.core.commands.Run.call(Run.java:75)
at picocli.CommandLine.executeUserObject(CommandLine.java:2041)
at picocli.CommandLine.access$1500(CommandLine.java:148)
at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
at picocli.CommandLine.execute(CommandLine.java:2170)
at org.apache.camel.dsl.jbang.core.commands.CamelJBangMain.run(CamelJBangMain.java:129)
at main.CamelJBang.main(CamelJBang.java:36)
For your information, I have completed the setup of Camel Jbang in my system to test my Camel routes locally before it is deployed to the container. I am using CamelK version 1.10.2.

Maven cxf-codegen-plugin with NTLM Authentication - fails with java.io.IOException: Server returned HTTP response code: 401 for URL

I'm trying to generate java code using cxf-codegen-plugin for a SOAP webservice that is secured over NTLM. I'm not sure how do pass on the username/pwd/domain information to maven to connect to the remote server while generating the java code. I could open the wsdl using the browser using the username/pwd/domain combination I have. However, I'm wondering how to do it via command-line by passing some extra vm args to - mvn package. Or is there any other plugin config that I can do which helps me to do this?

How call GAE EndpointV2 from Java Client

How can I call GAE Endpoints V2 from my Java Client using google-api-client:1.23.0 library.
I followed the migration description (https://cloud.google.com/endpoints/docs/frameworks/java/migrating) for the backend . Deployment worked fine.
But using the generated endpoints client libs I get the error:
Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: java.lang.NoSuchMethodError: com.google.api.client.googleapis.services.json.AbstractGoogleJsonClient$Builder.setBatchPath(Ljava/lang/String;)Lcom/google/api/client/googleapis/services/AbstractGoogleClient$Builder;
at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:133)
Caused by: java.lang.NoSuchMethodError: com.google.api.client.googleapis.services.json.AbstractGoogleJsonClient$Builder.setBatchPath(Ljava/lang/String;)Lcom/google/api/client/googleapis/services/AbstractGoogleClient$Builder;
at com.example.qwarks.backend.qwarksApi.QwarksApi$Builder.setBatchPath(QwarksApi.java:2098)
at com.example.qwarks.backend.qwarksApi.QwarksApi$Builder.<init>(QwarksApi.java:2077)
at com.example.qwarks.utility.Api.<clinit>(Api.java:24)
at com.example.qwarks.screens.SplashScreen.<init>(SplashScreen.java:105)
at com.example.qwarks.Qwarks.create(Qwarks.java:59)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:149)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:126)
I found the problem, I had to remove
compile project(path: ':backend', configuration: 'endpoints')
from my gradle dependencies

How to deploy an adf web application that contains j2ee components on tomee?

Firstly, I installed tomcat 7, then i could deploy adf application acc to following url: https://blogs.oracle.com/adfthoughts/entry/running_adf_essentials_in_tomcat
But i want server to run a j2ee application which has model project with jpa and hibernate etc, so i need to TomEE for that. I installed TomEE 1.5.2 version on my win7 system, i applied the same steps that already done for tomcat 7, result is failure.
Plz help me, I am getting following errors:
Caused by: org.apache.tomee.catalina.TomEERuntimeException: org.apache.openejb.OpenEJBException: Cannot unmarshall the JSP tag library definition file: jar:file:/u02/RTE/apache-tomee-plus-1.5.2/webapps/rcf-dvt-demo/WEB-INF/lib/adf-richclient-impl-12-abrams-SNAPSHOT.jar!/META-INF/afu.tld: unexpected element (uri:"http://java.sun.com/xml/ns/javaee", local:"code"). Expected elements are <{^#}text>
at org.apache.tomee.catalina.TomcatWebAppBuilder.loadApplication(TomcatWebAppBuilder.java:1903)
at org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:1073)
at org.apache.tomee.catalina.TomcatWebAppBuilder.configureStart(TomcatWebAppBuilder.java:1033)
at org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:124)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5179)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 11 more
I believe the problem is not in ADF, your problem is in the implementation that Tomee is using for EJB (JPA) which is openEJB, see if you configured your EJB Layer correctly?

Error while creating web service using apache CXF wizard

I am creating a web service through the apache CXF. but while i proceed(before the wsdl gets created), i receive the following error
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/cxf/tools/java2wsdl/JavaToWSDL
This seems like the java2ws.bat file has some error.
The statement in the bat file is
"%JAVA_HOME%\bin\java" -Djava.endorsed.dirs="%CXF_HOME%\lib\endorsed" -cp "%CXF_JAR%;%TOOLS_JAR%;%CLASSPATH%" -Djava.util.logging.config.file="%CXF_HOME%\etc\logging.properties" org.apache.cxf.tools.java2ws.JavaToWS %*
It seems like at Run time,jvm is not able to find the CXF.jar.I added it in the classpath but still the same error
please help me to solve the issue
The problem arises while creating JVM. You can refer : Java Refuses to Start - Could not reserve enough space for object heap
It solved my problem.

Resources