XML validation against XSD 1.1 with Xerces in Java - java

I have installed Xerces through Maven:
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jdom</groupId>
<artifactId>jdom</artifactId>
<version>2.0.2</version>
</dependency>
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<version>2.11.0</version>
</dependency>
</dependencies>
I then tried the code given in this example from the Xerces FAQ to validate a XML file against a schema in version 1.1. This is my code:
private static void validateFile(File xmlFile, File xsdFile) throws SAXException, IOException
{
// 1. Lookup a factory for the W3C XML Schema language
SchemaFactory factory = SchemaFactory.newInstance("http://www.w3.org/XML/XMLSchema/v1.1");
// 2. Compile the schema.
File schemaLocation = xsdFile;
Schema schema = factory.newSchema(schemaLocation);
// 3. Get a validator from the schema.
Validator validator = schema.newValidator();
// 4. Parse the document you want to check.
Source source = new StreamSource(xmlFile);
// 5. Check the document
try
{
validator.validate(source);
System.out.println(xmlFile.getName() + " is valid.");
}
catch (SAXException ex)
{
System.out.println(xmlFile.getName() + " is not valid because ");
System.out.println(ex.getMessage());
}
}
The code only yields this exception:
java.lang.IllegalArgumentException: No SchemaFactory that implements the schema language specified by: http://www.w3.org/XML/XMLSchema/v1.1 could be loaded
at javax.xml.validation.SchemaFactory.newInstance(SchemaFactory.java:204)
at example.xml.XSDValidator.validateFile(XSDValidator.java:65)
Seems like I failed to configure/install Xerces correctly. Please help me get this working, the XML files force me to use the schema in 1.1, I got a normal validator for 1.0 running but I have huge problems with this. I appreciate every hint!

It looks that you need Xerces2 Java 2.11.0 (XML Schema 1.1) (Beta) version, which isn't in maven repository. You can download it from Xerces website, and install it to your local maven repository:
mvn install:install-file -Dfile=xercesImpl.jar -DgroupId=xerces -DartifactId=xercesImpl -Dversion=2.11.0.beta -Dpackaging=jar
Then you will be able to include it in your Maven project dependencies:
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<version>2.11.0.beta</version>
</dependency>

I will add another answer, because for me this dependency did not work (same error as described by OP):
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<version>2.11.0</version>
</dependency>
I quess 2.11.0 should be newer than 2.11.0.beta, but it seems like xsd1.1 is not supported in that version !
Instead only the following dependency lead to a working XSD1.1 validation for me:
<dependency>
<groupId>org.opengis.cite.xerces</groupId>
<artifactId>xercesImpl-xsd11</artifactId>
<version>2.12-beta-r1667115</version>
</dependency>
( Found in this SO thread: How to validate XML against XSD 1.1 in Java? )

I think they have added version 2.11 to maven now. The following dependency in Maven works out-of-the-box:
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<version>2.11.0</version>
</dependency>

Xerces-J provides a "fully compliant XML Schema 1.1 implementation" since version 2.12.0, see release history here: https://xerces.apache.org/news.html.
Xerces2 Java 2.12.2 (XML Schema 1.1) - tar.gz [PGP] [SHA]
Just got released earlier this week.
https://xerces.apache.org/mirrors.cgi#notes

Related

Dynamic JAXB/MOXy Marshalling throws MOXy BV: Facets generation could not be configured

I am trying to follow the documentation and implement the Dynamic JAXB/Moxy marshalling. But it's not working as desired and throws the following error:
[EL Warning]: moxy: 2021-05-28 10:54:09.432--MOXy BV: Facets generation could not be configured. EclipseLink's JavaModelInputImpl was not detected, instead JavaModelInput is of class: class org.eclipse.persistence.jaxb.javamodel.xjc.XJCJavaModelInputImpl
Exception in thread "main" java.lang.NullPointerException
My XSD is in the resources folder and I am using the XSD from the documentation. After reading I am trying to create the POJO for it on the go and using the marshaling method to create the XML. Following is the code for it:
import org.eclipse.persistence.dynamic.DynamicEntity;
import org.eclipse.persistence.jaxb.dynamic.DynamicJAXBContext;
import org.eclipse.persistence.jaxb.dynamic.DynamicJAXBContextFactory;
import jakarta.xml.bind.JAXBException;
import jakarta.xml.bind.Marshaller;
public class Demo {
public static void main(String[] args) throws JAXBException {
final ClassLoader classLoader = Demo.class.getClassLoader();
final InputStream xsd = classLoader.getResourceAsStream("customer.xsd");
//final InputStream xml = classLoader.getResourceAsStream("customer.xml");
Map<String, Object> properties = new HashMap<String, Object>(1);
properties.put("eclipselink.beanvalidation.facets", true);
System.setProperty("com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.noCorrectnessCheck", "true");
final DynamicJAXBContext jaxbContext = DynamicJAXBContextFactory.createContextFromXSD(xsd, null, classLoader, properties);
DynamicEntity customer = jaxbContext.newDynamicEntity("org.JaxBDynamic.Customer");
DynamicEntity address = jaxbContext.newDynamicEntity("org.JaxBDynamic.Address");
customer.set("name", "Jane Doe");
address.set("street", "1 Any Street").set("city", "Any Town");
customer.set("address", address);
Marshaller marshaller = jaxbContext.createMarshaller();
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
marshaller.marshal(customer, System.out);
}
}
I have following dependency in pom.xml:
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<version>3.0.1</version>
</dependency>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>eclipselink</artifactId>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-xjc</artifactId>
<version>3.0.2-b01</version>
</dependency>
When I run I get following error:
[EL Warning]: moxy: 2021-05-28 10:54:09.432--MOXy BV: Facets generation could not be configured. EclipseLink's JavaModelInputImpl was not detected, instead JavaModelInput is of class: class org.eclipse.persistence.jaxb.javamodel.xjc.XJCJavaModelInputImpl
Exception in thread "main" java.lang.NullPointerException
at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.preProcessXmlAccessorType(AnnotationsProcessor.java:1628)
at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.preBuildTypeInfo(AnnotationsProcessor.java:603)
at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.processClassesAndProperties(AnnotationsProcessor.java:304)
at org.eclipse.persistence.jaxb.compiler.Generator.<init>(Generator.java:115)
at org.eclipse.persistence.jaxb.dynamic.DynamicJAXBContext$SchemaContextInput.createContextState(DynamicJAXBContext.java:350)
at org.eclipse.persistence.jaxb.JAXBContext.<init>(JAXBContext.java:206)
at org.eclipse.persistence.jaxb.dynamic.DynamicJAXBContext.<init>(DynamicJAXBContext.java:85)
at org.eclipse.persistence.jaxb.dynamic.DynamicJAXBContextFactory.createContextFromXSD(DynamicJAXBContextFactory.java:281)
at com.JaxBDynamic.Demo.main(Demo.java:25)
I am not sure what's wrong as I am following the steps as mentioned in the documentation. I could not find anything related to this issue so posting here to get some feedback.
As you wrote, you are trying to implement JAXB following documentation, but the documentation you linked is for EclipseLink version 2.5 and you are running into problems with a feature that was added in EL v2.6. The current stable release is 3.0.0, which you are running, based on your pom.xml.
Check out the newer documentation for EL. And since the link for the documentation for the feature you are running into problems with is not present on the homepage, you can find it here:
https://wiki.eclipse.org/EclipseLink/Examples/MOXy/BVinJAXB and presentation of the concepts here.
Solution
The message
"[EL Warning]: moxy: 2022-01-06 14:59:32.0--MOXy BV: Facets generation could not be configured. EclipseLink's JavaModelInputImpl was not detected, instead..."
is not responsible for the NullPointerException, Hence, it is not an issue. Apart from it use matching versions of Eclipselink moxy and jasb-xjc:
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>org.eclipse.persistence.moxy</artifactId>
<version>3.0.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-xjc</artifactId>
<version>3.0.1</version>
</dependency>
If there, remove file jaxb.properties as it is not needed in case of dynamic jaxb context.

How do I solve this below exception I get when converting docx to pdf using Documents4j library?

I am using the below code to convert docx to pdf.
public static void main(String[] args) {
File inputdocxfile = new File(System.getProperty("user.dir") + "/src/test/resources/files/output/");
File outputpdffile = new File(System.getProperty("user.dir") + "/src/test/resources/files/output/"
+ "CustomerOutputdocx.pdf");
IConverter converter = LocalConverter.builder().baseFolder(inputdocxfile)
.workerPool(20, 25, 2, TimeUnit.SECONDS).processTimeout(5, TimeUnit.SECONDS).build();
Future<Boolean> conversion = converter.convert(inputdocxfile).as(DocumentType.MS_WORD).to(outputpdffile)
.as(DocumentType.PDF).prioritizeWith(1000).schedule();
}
and I am getting this below exception. I am using the same code as mentioned in the documents4j official website.
Exception in thread "main" java.lang.IllegalStateException: The application was started without any registered or class-path discovered converters.
at com.documents4j.conversion.ExternalConverterDiscovery.validate(ExternalConverterDiscovery.java:68)
at com.documents4j.conversion.ExternalConverterDiscovery.loadConfiguration(ExternalConverterDiscovery.java:85)
at com.documents4j.conversion.DefaultConversionManager.<init>(DefaultConversionManager.java:22)
at com.documents4j.job.LocalConverter.makeConversionManager(LocalConverter.java:74)
at com.documents4j.job.LocalConverter.<init>(LocalConverter.java:47)
at com.documents4j.job.LocalConverter$Builder.build(LocalConverter.java:162)
at com.apakgroup.docgen.converters.ConvertToPdf.main(ConvertToPdf.java:19)
Exception in thread "Shutdown hook: com.documents4j.job.LocalConverter" java.lang.NullPointerException
at com.documents4j.job.LocalConverter.shutDown(LocalConverter.java:95)
at com.documents4j.job.ConverterAdapter$ConverterShutdownHook.run(ConverterAdapter.java:125)
I had missed few dependencies and I also had to use a newer version of commons-io. I previously used commons-io 1.3 but later I came to know that Documents4J uses commons-io 1.4 or later and when commons-io version was changed it worked. And If anyone wants to know the dependencies I used to convert docx file to pdf in java. These are the ones.
<dependency>
<groupId>com.documents4j</groupId>
<artifactId>documents4j-api</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.documents4j</groupId>
<artifactId>documents4j-local</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.documents4j</groupId>
<artifactId>documents4j-transformer-msoffice-word</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.4</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>18.0</version>
</dependency>
And let me remind you. This library works only on machines which have MS Office installed in it; as the library uses the application itself to convert docx to pdf. If someone is hosting this code on a server there is also a remote converter which you can use instead of the Local converter as shown here.

BarCode is not displaying on pdf using Apache fop

We are facing one issue in barcode generation. Barcode is not showing on pdf and throwing exception
Please find below code
<fo:instream-foreign-object>
<barcode:barcode xmlns:barcode="http://barcode4j.krysalis.org/ns"
message="HELLO WORLD">
<barcode:code128>
<barcode:height>15mm</barcode:height>
</barcode:code128>
</barcode:barcode>
</fo:instream-foreign-object>
pom.xml:
<dependency>
<groupId>org.apache.xmlgraphics</groupId>
<artifactId>fop</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>net.sf.barcode4j</groupId>
<artifactId>barcode4j-fop-ext-complete</artifactId>
<version>2.0</version>
</dependency>
Error:
Image not available. URI: (instream-object). Reason: org.apache.xmlgraphics.image.loader.ImageException: The file format is not supported. No ImagePreloader found for null (No context info available).
Please help me, what is causing issue.
Thanks in Advance
Best Regards
RKG
You can find the discussion over it here
http://comments.gmane.org/gmane.text.xml.fop.user/36178
You must be using barcode4j-fop-ext-complete.jar which is missing barcode-xgc.jar files.
You can download the updated fop barcode4j jar files here :
http://sourceforge.net/projects/barcode4j/files/
I had same issue.
Upgrading version solved my problem
<dependency>
<groupId>net.sf.barcode4j</groupId>
<artifactId>barcode4j-fop-ext</artifactId>
<version>2.1</version>
</dependency>

Getting java.lang.NoClassDefFoundError: org/bouncycastle/asn1/DEREncodable during PDF Encryption [duplicate]

I'm trying to use iText Java.
When you run the example "how to sign" the following error occurs:
Caused by: java.lang.ClassNotFoundException: org.bouncycastle.tsp.TimeStampTokenInfo
According "Getting Started with iText - How to sign a PDF using iText", I have to use the BouncyCastle.
I downloaded the file: bcprov-jdk15on-147.jar from BouncyCastle download page.
And added to the project: Java Build Path/Libraries/Add External JARs...
I added the following line:
Security.addProvider(new BouncyCastleProvider());
When you run the example the same error occurs.
So I downloaded another file: bcpkix-jdk15on-147.jar entitled "PKIX/CMS/EAC/PKCS/OCSP/TSP/OPENSSL"
And added to the project: Java Build Path/Libraries/Add External JARs...
Now I have two Jars.
When you run the example the following error occurs:
Caused by: java.lang.ClassNotFoundException: org.bouncycastle.asn1.DEREncodable
I tried downloading the file "bcprov-ext-jdk15on-147.jar" but did not solve the problem.
I am using iText 5.2.1 and eclipse on Windows 7 64 bits.
iText marks bouncycastle dependencies as optional. If you require them, you need to add the dependencies in your own pom file.
To find out which dependency to include in your project, open the itextpdf pom.xml file of the version you are using (for example 5.3.2, here) and search for the 2 bouncycastle dependencies.
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<version>1.47</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcmail-jdk15on</artifactId>
<version>1.47</version>
<optional>true</optional>
</dependency>
Copy them into your pom file and remove the optional option.
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>itextpdf</artifactId>
<version>5.3.2</version>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<version>1.47</version>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcmail-jdk15on</artifactId>
<version>1.47</version>
</dependency>
BouncyCastle libs are undergoing heavy API changes that broke the compatibility with other libs like iText.
Either
use a previous version of BouncyCastle libs. Old versions can be found here. However, you'll have to find the right version of iText that was compatible with this particular version of BC.
make your own build of iText (the SVN trunk has been fixed). iText can be build with Maven (there's a short readme file at the root of the SVN). Please note that it's at your own risk, there may be bugs in trunk.
wait for the next version of iText. From my experience, iText releases come every couple of months, sometime more often, sometimes less. I'm not an iText committer though, so I can't give you any ETA.
More information can be found in this thread
With itextpdf version 5.5.4 org.bouncycastle dependencies are marked as <optional>true</optional>. This means you MUST include those dependencies in your own pom, or you can run into classnotfound exceptions.
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>itextpdf</artifactId>
<version>5.5.4</version>
</dependency>
<!-- Bouncycastle dependencies necessary as they are optional = true
in itextpdf ... but they're not-so-optional in reality -->
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<version>1.49</version>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk15on</artifactId>
<version>1.49</version>
</dependency>
from version of bcprov-jdk15on-147, class of DEREncodable is no longer exist under the path of org.bouncycastle.asn1. You can use version before 146 (including 146) to resolve this question.
It's strange that the jars available at bouncycastle.org don't seem to contain this class. Perhaps, you may want to use one from the locations listed in this page (link).
i have the same problem, but a fix it when i download the libreria and update those files on /WEBINF/LIB
Luckily, the dependency jars are being delivered along with the iText now.
Please check the repository link below and download extrajars.zip file
http://sourceforge.net/projects/itext/files/
For jruby-ers with the same failure, I updated to jruby-complete-9.1.13.0.jar from jruby-complete-1.6.6.jar and the problem seemed to resolve...FWIW...

What's the minimum classpath for an Axis2 client?

I want to build an Axis2 client (I'm only accessing a remote web service, I'm not implementing one!) with Maven2 and I don't want to add 21MB of JARs to my project. What do I have to put in my pom.xml to compile the code when I've converted the WSDL with ADB?
The minimum jars for the client are:
activation-1.1.jar
axiom-api-1.2.8.jar
axiom-impl-1.2.8.jar
axis2-adb-1.5.1.jar
axis2-kernel-1.5.1.jar
axis2-transport-http-1.5.1.jar
axis2-transport-local-1.5.1.jar
commons-codec-1.3.jar
commons-httpclient-3.1.jar
commons-logging-1.1.1.jar
httpcore-4.0.jar
mail-1.4.jar
neethi-2.0.4.jar
wsdl4j-1.6.2.jar
XmlSchema-1.4.3.jar
STAX jars below are not part of Axis2 1.5.1 release and will be needed if your JDK version is less than 6:
stax-1.2.0.jar
stax-api-1.0.1.jar
(Note: This response was provided by Aaron Digulla himself. What follows is the exact text of his own answer.)
In maven2, the minimum dependency set to make an ADB client work ("ADB" as in the way you created the Java classes from the WSDL) is this:
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-kernel</artifactId>
<version>1.4.1</version>
</dependency>
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-adb</artifactId>
<version>1.4.1</version>
</dependency>
Hmmm... it seems I can't flag that as the correct answer. Can someone please copy this so I can flag his post?
Had to add the transports, too
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-adb</artifactId>
<version>1.5.4</version>
</dependency>
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-transport-local</artifactId>
<version>1.5.4</version>
</dependency>
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-transport-http</artifactId>
<version>1.5.4</version>
</dependency>
Minimal dependency for a working client in summary
axiom-api-1.2.14.jar
axiom-impl-1.2.14.jar
axis2-adb-1.6.3.jar
axis2-kernel-1.6.3.jar
axis2-transport-http-1.6.3.jar
axis2-transport-local-1.6.3.jar
commons-codec-1.3.jar
commons-httpclient-3.1.jar
commons-logging-1.1.1.jar
httpcore-4.0.jar
mail-1.4.jar
neethi-3.0.2.jar
wsdl4j-1.6.2.jar
XmlSchema-1.4.7.jar
Listed below the minimal dependencies with details
client stub uses the ServiceClient Class generated with %AXIS2_HOME%\bin\WSDL2Java tool against a given WSDL (for generating you would need all axis jars on classpath, achieved most easily by setting AXIS_HOME)
Classes required by Client stub at COMPILE time
axiom-api-1.2.14.jar -- required at compilation time by client stub for org.apache.axiom.om.OMElement, org.apache.axiom.soap.SOAPEnvelope, org.apache.axiom.soap.SOAPFactory, org.apache.axiom.om.OMNamespace
axis2-adb-1.6.3.jar -- required at compilation time by client stub for org.apache.axis2.databinding.ADBException
axis2-kernel-1.6.3.jar -- required at compilation time by client stub for org.apache.axis2.AxisFault Class
Classes required for successful invocation of Client stub at RUN time
axiom-impl-1.2.14.jar (without this org.apache.axiom.om.OMException: No meta factory found for feature 'default'; this usually means that axiom-impl.jar is not in the classpath)
axis2-transport-http-1.6.3.jar (without this org.apache.axis2.deployment.DeploymentException: org.apache.axis2.transport.http.CommonsHTTPTransportSender)
axis2-transport-local-1.6.3.jar (without this org.apache.axis2.deployment.DeploymentException: org.apache.axis2.transport.local.LocalTransportSender)
commons-codec-1.3.jar (without this java.lang.NoClassDefFoundError: org/apache/commons/codec/DecoderException)
commons-httpclient-3.1.jar (without this org.apache.axis2.deployment.DeploymentException: org/apache/commons/httpclient/HttpException)
commons-logging-1.1.1.jar (without this java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory)
httpcore-4.0.jar (without this java.lang.NoClassDefFoundError: org/apache/http/HttpResponseFactory)
mail-1.4.jar (without this java.lang.NoClassDefFoundError: javax/mail/internet/ParseException)
neethi-3.0.2.jar (without this java.lang.NoClassDefFoundError: org/apache/neethi/PolicyComponent)
wsdl4j-1.6.2.jar (without this java.lang.NoClassDefFoundError: javax/wsdl/WSDLException)
XmlSchema-1.4.7.jar (without this java.lang.ClassNotFoundException: org/apache/ws/commons/schema/XmlSchema)
org.apache.axis2.AxisFault: Connection refused: connect -> ERROR ONLY if the web service is not up or accessible for some other reason
Note the exact version(s), however behavior would be generic enough subject to packaging changes across version, hence, mentionined the FQCNs above-
Axis Version - 1.6.3
Tomcat Version - Apache Tomcat/7.0.64
Servlet version - 3.0
java.runtime.version - 1.7.0_79-b15
Axis2 version 1.6.2 wouldn't work for me without axis2-xmlbeans (though this may have something to do with the fact that I'm also using the axis2-wsdl2code-maven-plugin plugin and xmlbeans as my data binding framework). I have the following POM:
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-kernel</artifactId>
<version>1.6.2</version>
</dependency>
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-adb</artifactId>
<version>1.6.2</version>
</dependency>
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-transport-http</artifactId>
<version>1.6.2</version>
</dependency>
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-transport-local</artifactId>
<version>1.6.2</version>
</dependency>
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-xmlbeans</artifactId>
<version>1.6.2</version>
</dependency>
If your client is running on Java 6, consider using JAX-WS for consuming the WS. JAX-WS uses the JAXB standard for binding and you don't need a single extra jar for the client.
Actually, you only need the axis-abd dependency since the axis2-kernel is a sub-dependency of axis-abd.
Therefore you can sum it up with:
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-adb</artifactId>
<version>1.5.1</version>
</dependency>
In Axis2 version 1.5.1 the maven modules appear to have been restructured.
My Groovy scripts (Using ADB binding) have the following dependencies:
#Grapes([
#Grab(group='org.apache.axis2', module='axis2-kernel', version='1.5.1'),
#Grab(group='org.apache.axis2', module='axis2-adb', version='1.5.1'),
#Grab(group='org.apache.axis2', module='axis2-transport-local', version='1.5.1'),
#Grab(group='org.apache.axis2', module='axis2-transport-http', version='1.5.1'),
])
There's a logic to these. I could use an alternative binding framework when generating my stub or could use an alternative transport protocol to HTTP.
Example code in this answer
For those using Gradle, here I exclude unnecessary libraries:
dependencies {
ext.compileEx = { lib, exModules, exGroups ->
compile (lib) {
exModules.each { exclude module : "$it" }
exGroups.each { exclude group: "$it" }
}
}
List axisExModules = [ 'axiom-compat', 'jaxen', 'apache-mime4j-core' ]
List axisExGroups = [ 'javax.servlet', 'commons-fileupload', 'org.apache.woden',
'javax.ws.rs', 'org.apache.geronimo.specs', 'org.codehaus.woodstox' ]
compileEx ('org.apache.axis2:axis2-adb:1.6.3', axisExModules, axisExGroups)
compileEx ('org.apache.axis2:axis2-transport-local:1.6.3', axisExModules, axisExGroups)
compileEx ('org.apache.axis2:axis2-transport-http:1.6.3', axisExModules, axisExGroups)
}
Here is my original post in the Gradle forums.

Categories

Resources