issue with package-info.java - java

I have generated webservice client proxy using wsdl in jdeveloper. I got all generated class and able to make a webservice call.
But when I try to patch these java files to production instance, the class file for package-info.java is not getting generated, so getting the exception while creating the jar file.
If i remove package-info.java class manually, getting the error saying, "Client received SOAP Fault from server : Failure in SDOSerializer.deserialize." .
Is there anyway, that I can remove the package-info.java file and its dependencies, with out getting any error? or any other suggestions?

Related

How to generate wsdl with package name?

I am getting
Web service client cannot be created by JAXWS:wsimport utility.
A class/interface with the same name "test.ArcSightLoginServiceException" is already in use
....
error when I try to generate java artifacts with a specific package name(package name is "test").
How can I handle this error? Is there anything wrong with my wsdl or its about Netbeans?

NoSuchMethod Exception though method present in jar

I am using one third party jar ( Jar has Model classes) in Restful web service. It is working fine in one environment. But it is not working properly in another environment. for Marshaling purpose I am using that jar. some of the fields are missed in marshaled XML. But those fields getter/Setter are available in jar. To verify that, I called that missed fields setter method, got NoSuchMethod Exception. I verified that jar is present in WAR. I kept the same jar in ext library option in server start up script. it works fine.
Why it is now working fine ?
What is the issue ?
Why NoSuchMethod Exception happened ?
Thanks in advance.

How to add Authentication Header to WebService Stub?

I have generated stubs using Apache CXF, IBM Jax-WS and Axis as well in Eclipse and RAD 7.0 .
In all the 3 above scenarios it gives me the following exception
Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: ARERR [149] A user name must be supplied in the control record
After searching i concluded that i have to add Authentication Info to the Soap header created by Client Stubs.
i tried the answer on this link
How do you add a Soap Header defined in a wsdl to a web service client in CXF?
but couldn't succeed. I am newbie to SOAP and WebServices
So if anyone has worked on it kindly Help.
I had this problem a few days ago and it was a headache for me. When generating the stubs you have to add a the flag -XadditionalHeaders to the wsimport command.
"C:\Program Files\Java\jdk1.X.X_XX\bin\wsimport.exe" -p com.company.package -keep -XadditionalHeaders -d folder1 http://mywsdllocation.com/doc.wsdl
Where:
-p: package that will contain generated classes
-keep: keep .java files (otherwise tou'll only get .class files)
-XadditionalHeaders: classes for authentication will be created
-d: Folder where generated classes will be placed.
After that, you only have to copy generated java files to your project, under the picked package (com.company.package in this case). Then you have you create an AuthenticationInfo object and inserting it in the stub method's call, something like this:
WSService service = new WSService();
WSPortTypePortType port = service.WSPortTypeSoap();
AuthenticationInfo auth = new AuthenticationInfo();
auth.setUserName(yourUsername);
auth.setPassword(yourPassword);
port.method(param1,param2,auth);
Hope it helps!

NoClassDefFoundError: Could not initialize class org.apache.axis2.description.AxisService

While running the application I was getting the following errors.
java.lang.NoClassDefFoundError: Could not initialize class org.apache.axis2.description.AxisService
AxisService class is in axis2-kernel-1.6.2.jar file. Some of the classes from this jar are working fine without any issues, but some classes are throwing NoClassDefFoundError from this jar file at runtime. AxisService class is present in axis2-kernel-1.6.2.jar, even it throws error.
This is working fine in local machine. But error getting in Oracle r12 server.I have already set the class path for the jar file.
I am Using Java version is 1.6 and Apache axis2.1.6.2.
Had the same issue. I had included only jars that I needed to compile the application.
When I included everything from \axis2-1.6.2\lib\ folder, this exception were gone.
I had a similar problem using Tomcat and Axis2 and after a week finding out the error I realized there was a axis configuration problem. especifically my aplication can't instantiate the class which accedded to persistence layer. I include this parameter line:
<parameter name="ServiceTCCL">composite</parameter>
in services.xml file which is used by axis2 to work.
For more information see the comments in http://wso2.com/node/1131

Error : Failed to load WS-Security Policy definition from classpath resource: META-INF/policy.xml

I am getting error when i calling webservices java file.
Even i included the Policy.xml in that location , eventhough getting error.
Failed to load WS-Security Policy definition from classpath resource: META-INF/policy.xml
Please let me what is reason is behind ?
META-INF/Policy.xml is not the same as META-INF/policy.xml... in your example you show that you've included it with a capital P. If that's the case, try renaming it at to lowercase 'policy.xml' and see if it works.
If that fails, open your WAR file and make sure that it's actually in the META-INF directory.

Categories