Hi All,
My custom plugin will require consumption of web service methods to realise certain events. As a result i have a few essential jar files which i easily configure in Java.
package com.atlassian.myorg; import org.tempuri.FreewayAuthLocator; import org.tempuri.FreewayAuthSoap; import com.atlassian.confluence.core.ConfluenceActionSupport; import com.atlassian.confluence.pages.AbstractPage; import com.atlassian.confluence.pages.actions.PageAware; import com.opensymphony.xwork.Action; /** * The simplest action possible */ public class FreewayProjectAction extends ConfluenceActionSupport { @Override public String execute() throws Exception { String logonResult = ""; try { FreewayAuthLocator freewayAuth = new FreewayAuthLocator(); FreewayAuthSoap freewayAuthSoap = freewayAuth.getFreewayAuthSoap(); logonResult = freewayAuthSoap.logon("freeway.username", "Password"); System.out.println("LogonResult >> " + logonResult); } catch (javax.xml.rpc.ServiceException ex) { // TODO handle ServiceException ex.printStackTrace(); } catch (java.rmi.RemoteException ex) { // TODO handle remote exception ex.printStackTrace(); } catch (Exception ex) { // TODO handle custom exceptions here ex.printStackTrace(); } return Action.SUCCESS; } }
This is how my java class looks like .The 'FreewayAuthLocator' class are referenced from the jar files i have added via 'Configure Build Path'. And even in eclipse i am able to see the auto suggestions on the object of that class (By which i assumed that the class is available). How ever when i run this plugin using atlas-run the action trigerring this class results in a "No Class Def" found error.
Is there a compulsion to add the dependencies in pom.xml ?
Community moderators have prevented the ability to post new answers.
You must add the dependency in your pom.xml, otherwise the jar won't be bundled and you'll get a NoClassDef error.
<dependencies> ... <dependency> <groupId>XXX</groupId> <artifactId>YYY</artifactId> <version>ZZZ</version> </dependency> ... </dependencies>
If the jar is not in a maven repository, you can install it manually in your local repository using this command:
mvn install:install-file -Dfile=your-artifact-1.0.jar -DgroupId=XXX -DartifactId=YYY -Dversion=ZZZ -Dpackaging=jar
Hi Julien,
I added this dependency chunk in my pom.xml
<dependency> <groupId>freeway</groupId> <artifactId>axis</artifactId> <version>1.0</version> </dependency>
I have placed my jar file in the folder C:\jarhost\axis-1.0.jar
And i ran the command
mvn install:install-file -Dfile= "C:/jarhost/axis-1.0.jar" -DgroupId=freeway -DartifactId=axis -Dversion=1.0 -Dpackaging=jar
And this is the error i get is this
http://imageshack.us/f/580/cmdimage.png
I also stumbled upon this https://confluence.sakaiproject.org/display/DOC/Adding+JARs+to+an+Application and tried it too. But it was unable to 'download' dependencies.
What am i missing ?
Looking for your help on this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Could you try again without the space between "file=" and "C:/jarhost/axis-1.0.jar" like this:
mvn
install
:
install
-
file
-Dfile=
"C:/jarhost/axis-1.0.jar"
-DgroupId=freeway -DartifactId=axis -Dversion=1.0 -Dpackaging=jar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I followed tutorial to create applet module by following this link:
Whenever i add any external jar to the POM.xml it starts giving me error
These are lines I am adding to the pom.xml
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.9.4</version>
</dependency>
This is the error i get: It has something to do with osgi.wiring I have no clue about it
The project works fine without the jar though.
Screen Shot 2016-08-12 at 1.55.35 PM.png
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Could you try again without the space between "file=" and "C:/jarhost/axis-1.0.jar" like this:
mvn
install
:
install
-
file
-Dfile=
"C:/jarhost/axis-1.0.jar"
-DgroupId=freeway -DartifactId=axis -Dversion=1.0 -Dpackaging=jar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I followed tutorial to create applet module by following this link:
Whenever i add any external jar to the POM.xml it starts giving me error
These are lines I am adding to the pom.xml
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.9.4</version>
</dependency>
This is the error i get: It has something to do with osgi.wiring I have no clue about it.
Screen Shot 2016-08-12 at 1.55.35 PM.png
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.