Netbeans doesn't recognize xercesimpl - netbeans

I am trying to build a plugin for netbeans using maven and for some reason Netbeans doesn't recognize xercesimpl.jar packaged with the plugin. Here is the stacktrace I see.
java.io.IOException: SAX2 driver class org.apache.xerces.parsers.SAXParser not found
at org.apache.batik.dom.util.SAXDocumentFactory.createDocument(SAXDocumentFactory.java:353)
at org.apache.batik.dom.util.SAXDocumentFactory.createDocument(SAXDocumentFactory.java:276)
at org.apache.batik.dom.svg.SAXSVGDocumentFactory.createDocument(SAXSVGDocumentFactory.java:207)
at org.apache.batik.dom.svg.SAXSVGDocumentFactory.createSVGDocument(SAXSVGDocumentFactory.java:105)
[catch] at org.netbeans.modules.plantumlnb.SVGImagePreviewPanel.createSVGDocument(SVGImagePreviewPanel.java:59)
at org.netbeans.modules.plantumlnb.SVGImagePreviewPanel.renderSVGFile(SVGImagePreviewPanel.java:48)
at org.netbeans.modules.plantumlnb.RenderImageThread$1.run(RenderImageThread.java:56)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:733)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:694)
at java.awt.EventQueue$3.run(EventQueue.java:692)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:703)
at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:159)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
Here is the image showing that the xercesimpl.jar is indeed packaged with the nbm file.
Here is a list of all the jars that were downloaded during build process.
NBM Plugin generates manifest
Adding on module's Class-Path:
net.sourceforge.plantuml:plantuml:jar:7959
batik:batik-swing:jar:1.6-1
batik:batik-bridge:jar:1.6-1
batik:batik-gvt:jar:1.6-1
batik:batik-awt-util:jar:1.6-1
batik:batik-script:jar:1.6-1
rhino:js:jar:1.5R4.1
batik:batik-svg-dom:jar:1.6-1
batik:batik-dom:jar:1.6-1
batik:batik-xml:jar:1.6-1
xerces:xercesImpl:jar:2.5.0
batik:batik-parser:jar:1.6-1
batik:batik-css:jar:1.6-1
batik:batik-rasterizer:jar:1.6-1
batik:batik-transcoder:jar:1.6-1
fop:fop:jar:0.20.5
batik:batik-1.5-fop:jar:0.20-5
xml-apis:xml-apis:jar:1.0.b2
xalan:xalan:jar:2.4.1
avalon-framework:avalon-framework:jar:4.0
batik:batik-util:jar:1.6-1
batik:batik-gui-util:jar:1.6-1
batik:batik-ext:jar:1.6-1
xml-apis:xmlParserAPIs:jar:2.0.2
org.axsl.org.w3c.dom.svg:svg-dom-java:jar:1.1
org.axsl.org.w3c.dom.smil:smil-boston-dom-java:jar:2000-02-25
org.w3c.css:sac:jar:1.3
crimson:crimson:jar:1.1.3
I am not sure what I am missing, any help is appreciated.

My dependencies weren't right, so once I fixed them, it started recognizing. For anybody looking to include Batik in their maven based netbeans module I am including the dependencies below.
<dependency>
<groupId>batik</groupId>
<artifactId>batik-swing</artifactId>
<version>1.6-1</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>batik</groupId>
<artifactId>batik-script</artifactId>
<version>1.6-1</version>
<!-- exclude xerces as Netbeans includes it -->
<exclusions>
<exclusion>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- include xerces in test scope as unittests need it -->
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<version>2.5.0</version>
<type>jar</type>
<scope>test</scope>
</dependency>

Related

Error running cucumber in eclipse- Could not find or load main class cucumber.api.cli.Main

I'm trying to run a maven project using Oxygen.1 a release. I have the cucumber plugin installed. But when I run the default feature file, I'm getting an error Error: Could not find or load main class cucumber.api.cli.Main
Please help!
I've never used Cucumber, but I guess you need to add it as a dependency to your Maven pom.xml as described in the Cucumber JVM documentation.
The Eclipse plugin adds syntax highlighting, content assists and other IDE related convenience. But you still need to tell the JVM where to find the Cucumber classes and in a Maven project this is defined by the dependencies in pom.xml.
You may rise a feature request at the Cucumber-Eclipse issue tracker to extend the plugin to allow adding the dependency to Maven projects automatically.
Add these dependencies to the pom.xml and the issue gets resolved. I was trying with the latest versions so was facing this problem. When I changed the version then it worked for me.
<dependencies>
<!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-java -->
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-java</artifactId>
<version>2.3.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-junit -->
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-junit</artifactId>
<version>2.3.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/net.masterthought/cucumber-reporting -->
<dependency>
<groupId>net.masterthought</groupId>
<artifactId>cucumber-reporting</artifactId>
<version>3.14.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/io.cucumber/gherkin -->
<dependency>
<groupId>info.cukes</groupId>
<artifactId>gherkin</artifactId>
<version>2.12.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java -->
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.14.0</version>
</dependency>
</dependencies>

Is there a reason why the Eclipse build cannot find a Maven lib

Is there a reason why eclipse can't find this lib when it is added in Maven dependency with success.
Is there an error here ?
This is the Maven dependency:
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jackson-provider</artifactId>
<version>2.3.1.GA</version>
</dependency>
The dependency mentioned is not the correct dependency since it is not the artifact of the RESTEasy JAX RS Implementation. Therefore it neither contains org.jboss.resteasy.ClientRequest nor org.jboss.resteasy.ClientResponse.
In order to have access to the required classes, the dependency ought to be used is the following:
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxrs</artifactId>
<version>${resteasy.version}</version>
</dependency>

RESTEasy on JBoss 5 - jars needed

We are running JBoss 5.1.0 and I'm trying to get just a simple test app up and running with RESTEasy. However, I cannot figure out what I need in order to do this. Apparently new versions of JBoss have everything included, but that doesn't help me. From what I understand, I need to modify the web.xml of my app to include the bootstrap and some other things. And then I need to include some jars in the WEB-INF/lib. This is where I'm stuck.
Do I need to include any jars in the server/lib in JBoss, or are they all supposed to be in the WEB-INF/lib of my app?
What jars do I need to include? We are not using Maven. I've seen very few tutorials actually mention which jars to use, and when I download RESTEasy there 65 jars in the lib folder. I'm not including 65 jars in my HelloWorld app just to get RESTEasy to run. I can't find any documentation that tells me plainly what I need in order to get a RESTEasy app up and running on JBoss 5
Resteasy libraries are not bundled with JBOSS.5.1.0.
You should include following libraries in your WEB-INF/lib
To add to Prasobh.K's answer - if using the pom.xml in a maven project setup - then you can just add the following inside the dependencies tags:
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>jaxrs-api</artifactId>
<version>2.3.4.Final</version>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxrs</artifactId>
<version>2.3.4.Final</version>
</dependency>
<dependency>
<groupId>org.scannotation</groupId>
<artifactId>scannotation</artifactId>
<version>1.0.3</version>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxb-provider</artifactId>
<version>2.3.4.Final</version>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jackson-provider</artifactId>
<version>2.3.4.Final</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-jaxrs</artifactId>
<version>1.8.5</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>1.8.5</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-core-asl</artifactId>
<version>1.8.5</version>
</dependency>
(instead of copying the jars into the lib folder)
It may also help some doing a port from Wildfly to JBoss 5.1 that the
...\WEB-INF\web.xml should be changed to:
<?xml version="1.0" encoding="UTF-8"?>
from the wildfly version which is:
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd" >

Really painful to run GWTP in Maven

I've been struggling all day to run GWTP with Maven, essentially I created a GWTP gwt application using the Eclipse plugin. And added a simple welcome presenter. Tried it without maven and it works well running from eclipse.
However when I convert it to a maven project (I'm using m2eclipse plugin) everything breaks. So I added the required dependencies and the gwtp dependency:
<dependency>
<groupId>com.google.gwt.inject</groupId>
<artifactId>gin</artifactId>
<version>1.5.0</version>
</dependency>
<!-- MVP component -->
<dependency>
<groupId>com.gwtplatform</groupId>
<artifactId>gwtp-all</artifactId>
<version>${gwtp.version}</version>
</dependency>
However when I try to run it I get this error:
Caused by: java.lang.RuntimeException: Deferred binding failed for 'com.google.gwt.event.shared.EventBus' (did you forget to inherit a required module?)
Any ideas why its quite hard to make GWTP with maven.
I think you might be missing the gwt-user dependency. Here is my maven pom.xml for an GWTP project:
<properties>
<gwtVersion>2.4.0</gwtVersion>
<gwtp.version>0.7</gwtp.version>
</properties>
<dependencies>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<version>${gwtVersion}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.gwtplatform</groupId>
<artifactId>gwtp-mvp-client</artifactId>
<version>${gwtp.version}</version>
<scope>provided</scope>
</dependency>
<!-- Dispatch component -->
<dependency>
<groupId>com.gwtplatform</groupId>
<artifactId>gwtp-dispatch-client</artifactId>
<version>${gwtp.version}</version>
<scope>provided</scope> <!-- Remove for GWTP 0.5.1 and earlier -->
</dependency>
<!-- Tester component -->
<dependency>
<groupId>com.gwtplatform</groupId>
<artifactId>gwtp-tester</artifactId>
<version>${gwtp.version}</version>
<scope>test</scope>
</dependency>
In case you use the newest gwtp 0.7 be aware that they switched from the depreciated classes in com.google.gwt.event.shared to com.google.web.bindery.event.shared.
See here for more details.

How to run a Ext GWT (GXT) application with Maven

I am trying to make a GXT 3.0 starting app with Maven support. I have successfully compiled and run the native GWT application with mvn gwt:compile gwt:run command
Howeven, when I added these dependecies:
<dependency>
<groupId>com.sencha.gxt</groupId>
<artifactId>gxt</artifactId>
<version>${gxt.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sencha.gxt</groupId>
<artifactId>gxt-uibinder</artifactId>
<version>${gxt.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sencha.gxt</groupId>
<artifactId>gxt-chart</artifactId>
<version>${gxt.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sencha.gxt</groupId>
<artifactId>uibinder-bridge</artifactId>
<version>2.4.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
and added this in the gwt.xml (module) file:
<inherits name="com.sencha.gxt.ui.GXT" />
I am getting this error (running the same mvn command as above):
GWT module com.sencha.gxt.ui.GXT not found
And looking from the Java build path of the project in the Maven Dependencies, I can see that the GXT jars have not been downloaded.
Full pom.xml here.
If you want the snapshot, make sure you have the repository tags for it as well, for wherever you are getting that build from. Otherwise use the latest release, 3.0.0-beta3.
If you are building your own local copies, or deploying to an internal repo, then 3.0.0-SNAPSHOT should work - make sure the jar can be found in your repo, and that you aren't running as offline.
Use these dependencies:
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<version>2.5.0</version>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-servlet</artifactId>
<version>2.5.0</version>
</dependency>
<dependency>
<groupId>com.sencha.gxt</groupId>
<artifactId>gxt</artifactId>
<version>3.0.1</version>
</dependency>
GXT does not require uibinder-bridge anymore according to Sencha forum.
All GXT uibinder features were incorporated into GWT 2.5.0 release.
GXT 3.0.1 is on maven central
<dependency>
<groupId>com.sencha.gxt</groupId>
<artifactId>gxt</artifactId>
<version>3.0.1</version>
</dependency>