How do I configure mule to use a class customization tool when generating the JAX-WS classes from a WSDL?
I cannot modify the WSDL and I get the following error in Mule Studio:
"A class/interface with the same name "xxx.xxx" is already in use. Use a class customization to resolve this conflict."
Any help will be greatly appreciated.
Run wsimport with the -B-XautoNameResolution (no spaces)
Related
I'm using Liferay 7.1 GA1 Version. I have generated my service/api java classes with service-builder that Liferay IDE provides me.
How can I use these service classes in my other modules? I would like to use "MyServiceBuilder" generated classes in "MyPortlet" like you can see in the following picture.
Thanks.
Picture
Structure your project like this:
in the gradle file of the portlet add:
compileOnly project(":modules:test-service:test-service-api")
Right click and select Gradle > Refresh Gradle Project on the test-service folder.
Then use OSGi Declarative Services in your portlet:
#Reference
protected FooLocalService _fooLocalService;
In mule ldap connector examples shows xsd available in the http://www.mulesoft.org/schema/mule/ldap/3.3/mule-ldap.xsd. But runtime it shows error, as this xsd not existsing. I browsed http://www.mulesoft.org/schema/mule/ there is no ldap directory after that. Any change in the ldap connector support? Am I wrong using mulestudio(3.5)? I used demo application in the https://github.com/mulesoft/ldap-connector
I'm getting an error like this
org.xml.sax.SAXParseException; lineNumber: 10; columnNumber: 122; schema_reference.4: Failed to read schema document 'http://www.mulesoft.org/schema/mule/ldap/3.3/mule-ldap.xsd'
It seems like the Mule LDAP conncetor is having support only for Mule 3.3.2 and Mule 3.4 versions.
Try changing the schema declaration to the below one.
<mule xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ldap="http://www.mulesoft.org/schema/mule/ldap"
xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/core
http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/ldap
http://www.mulesoft.org/schema/mule/ldap/current/mule-ldap.xsd">
<!-- here goes your flows and configuration elements -->
</mule>
If not try changing you Mule version to 3.4.
Please refer to the link below for more details
Mule LDAP Connector
Hope this helps.
Do you have the LDAP connector in your build path? XSDs are always present in your JARs but not always on the web. If you're using MuleStudio, all you need to do is to drag an LDAP message processor from the palette into your flow. Doing so will cause MuleStudio to load the necessary libraries for the LDAP connector and modify your namespaces accordingly.
Judging by the error that you posted, it seems that you are missing a JAR file from your build path. If you are using a Maven project, you can take a look here to learn how to add the necessary dependencies to your pom.xml file. If you're working with a normal Mule project, dragging and dropping an LDAP message processor into your flow should be enough.
I should mention that you need to install the LDAP connector in Mule Studio before you can use it. You can do so through the Cloud Connectors update site that comes bundled with Mule Studio. You can access this update site by going on Help > Install New Software and choosing it from the drop down list.
If you're interested in learning more on how to use Mule, we host a number of interesting blog posts on http://blog.ricston.com.
Inside my Mule ESB 3.3.0 app, running in standalone mode, I have a transformer that calls Groovy code that is included as a maven dependent jar. In my groovy code, I am calling a Java object that has a newInstance() static method, like so:
TransformerFactory.newInstance("net.sf.saxon.TransformerFactoryImpl", null)
This is causing errors in Groovy because I think its trying to call the Groovy enhanced Class.newInstance() method. This does not happen when running outside Mule standalone (see update below for description of test). How can I make it call the Java method and not the Groovy one?
Here is a snippet of my stack trace. You can see its calling DefaultGroovyMethods.newInstance(). But I want to call the javax.xml.transform.TransformerFactory.newInstance(String, ClassLoader) method instead. How?
groovy.lang.GroovyRuntimeException: Could not find matching constructor for: javax.xml.transform.TransformerFactory(java.lang.String, null)
at groovy.lang.MetaClassImpl.invokeConstructor(MetaClassImpl.java:1459)
at groovy.lang.MetaClassImpl.invokeConstructor(MetaClassImpl.java:1375)
at org.codehaus.groovy.runtime.InvokerHelper.invokeConstructorOf(InvokerHelper.java:824)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.newInstance(DefaultGroovyMethods.java:18025)
UPDATE:
More info about the runtime environment. The Groovy code is packaged as a jar file and called from a Mule ESB app. Mule 3.3.0 ships with groovy-all-1.8.6.jar.
UPDATE2:
I did some further tests and compiled a Groovy class into a jar file and called it from a standalone Java program and did not experience this issue. This leads me to believe that it is an issue running from the Mule 3.3.0 standalone environment. I am adding a mule tag to this post. Hopefully a Mule expert can tell me what is going on.
With some help from the Groovy user mailing list, we determined that there must be another jar on the mule classpath that is providing the javax.xml.transformer.Transformer class. I added this sample code:
Class klass = TransformerFactory.class;
URL location = klass.getResource('/'+klass.getName().replace('.', '/')+".class");
And sure enough! Mule is adding their own XML API jar.
TranformerFactory JAR: jar:file:/D:/java/mule/mule-standalone-3.3.0/lib/endorsed/xml-apis-1.3.04.jar!/javax/xml/transform/TransformerFactory.class
Why are you overriding the JDK Mule?
My work around was to instantiate the Saxon TransformerFactory directly. Its not very elegant, but my only option.
tFactory = new net.sf.saxon.TransformerFactoryImpl()
Using Mule IDE version 3.2.3 to invoke JAX-WS web service. In the "Import WSDL" dialogue after entering the WSDL URL and package name the JAX-WS client generation fails with error message
Error generating from WSDL: Thrown by JAXB : A class/interface with same name is already in use. Use a class customization to resolve this conflict.
How do I specify jaxb customization in Mule IDE?
What you are covering with the black colour is key to resolve this issue. Are you sure you are not using a reserved class, or a package name already taken?
Just try with org.example.helloWorld and let us know if it still fails.
I am using the xjc ant task provided by the JAXB-RI to generate our jaxb classes and provide all the jaxb jars in with my web application's WEB-INF/lib folder. Jersey is still using the runtime provided jaxb implementation (found in rt.jar) Is there some way to use #Provider to force it to use the jaxb-ri jars?
As far as I understood the problem correctly, this small tutorial should help.