package com.mywork.tools.GeckoPrequal;
import com.mywork.tools.GeckoPrequal.ws.*;
import java.util.*;
import java.lang.*;
class myfirstjavaprog
{
public static void main(java.lang.String args[])
{
java.lang.String soapEndpointURL="http://SOMEPATH/main/WebService";
try {
GeckWebServiceSoapBindingStub stub = new GeckWebServiceSoapBindingStub(new java.net.URL(soapEndpointURL), new org.apache.axis.client.Service());
Geck g = stub.lockGeck(java.lang.Integer.parseInt(args[0]),args[1]);
System.out.println(g.getSolution());
java.lang.String solution = g.getSolution();
solution = solution.concat(args[2]);
System.out.println(solution);
g.setSolution(solution);
stub.saveGeck(g,args[1]);
} catch(Exception e) {
System.out.println(e.getMessage());
}
}
}
mvn clean
mvn package
setenv CLASSPATH `pwd`/target/GeckoPrequal-2.0.jar:/opt/glassfish/lib/javaee.jar:/home/tolgar/.m2/repository/axis/axis/1.4/axis-1.4.jar:/home/tolgar/.m2/repository/org/apache/axis/axis-jaxrpc/1.4/axis-jaxrpc-1.4.jar:/home/tolgar/.m2/repository/org/apache/axis/axis-saaj/1.4/axis-saaj-1.4.jar:/home/tolgar/.m2/repository/axis/axis-wsdl4j/1.5.1/axis-wsdl4j-1.5.1.jar:/home/tolgar/.m2/repository/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar:/home/tolgar/.m2/repository/commons-discovery/commons-discovery/0.2/commons-discovery-0.2.jar
java com.SOMEDOMAIN.tools.GeckoPrequal.myfirstjavaprog 333333 tolgar sometext
java com.SOMEDOMAIN.tools.GeckoPrequal.myfirstjavaprog 333333 tolgar sometext
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<mainClass>com.SOMEDOMAIN.tools.my.myfirstjavaprog</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
mvn clean
mvn package
java -jar my.jar 333333 tolgar sometext
Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/rpc/Service
Caused by: java.lang.ClassNotFoundException: javax.xml.rpc.Service
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Could not find the main class: com.SOMEDOMAIN.tools.my.myfirstjavaprog. Program will exit.
Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Created-By: Apache Maven
Built-By: tolgar
Build-Jdk: 1.6.0_20
Main-Class: com.SOMEDOMAIN.tools.my.myfirstjavaprog
Class-Path: commons-lang-2.5.jar jung-api-2.0.1.jar collections-generi
c-4.01.jar jung-graph-impl-2.0.jar jung-io-2.0.1.jar jung-algorithms-
2.0.1.jar colt-1.2.0.jar concurrent-1.3.4.jar wstx-asl-3.2.6.jar stax
-api-1.0.1.jar jung-jai-2.0.1.jar jung-visualization-2.0.1.jar json-s
imple-1.1.jar mysql-connector-java-5.1.12.jar jaxb-api-2.0.jar jsr173
_api-1.0.jar activation-1.1.jar axis-1.4.jar axis-jaxrpc-1.4.jar axis
-saaj-1.4.jar axis-wsdl4j-1.5.1.jar commons-logging-1.0.4.jar commons
-discovery-0.2.jar jaxb-impl-2.0.2.jar
Exception in thread "main" java.lang.NoClassDefFoundError: org.apache.commons.logging.LogFactory
at org.apache.axis.components.logger.LogFactory.class$(LogFactory.java:45)
at org.apache.axis.components.logger.LogFactory$1.run(LogFactory.java:45)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.axis.components.logger.LogFactory.getLogFactory(LogFactory.java:41)
at org.apache.axis.components.logger.LogFactory.<clinit>(LogFactory.java:33)
at org.apache.axis.description.OperationDesc.<clinit>(OperationDesc.java:65)
at com.mywork.tools.GeckoPrequal.ws.GeckWebServiceSoapBindingStub._initOperationDesc1(GeckWebServiceSoapBindingStub.java:29)
at com.mywork.tools.GeckoPrequal.ws.GeckWebServiceSoapBindingStub.<clinit>(GeckWebServiceSoapBindingStub.java:20)
at com.mywork.tools.GeckoPrequal.myfirstjavaprog.main(myfirstjavaprog.java:16)
<assembly>
<id>jar-with-dependencies</id>
<formats>
<format>jar</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<fileSet>
<directory>target/classes</directory>
<outputDirectory>/</outputDirectory>
</fileSet>
</fileSets>
<dependencySets>
<dependencySet>
<outputDirectory>/</outputDirectory>
<unpack>true</unpack>
<scope>runtime</scope>
</dependencySet>
</dependencySets>
</assembly>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy</id>
<phase>compile</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<!-- Artifact gets loaded from repository at build time. -->
<groupId>com.mywork.tools.GeckoPrequal</groupId>
<artifactId>GeckoPrequal</artifactId>
<version>2.0</version>
<type>jar</type>
<!-- Per artifact configuration here: -->
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
<destFileName>javaee.jar</destFileName>
</artifactItem>
<artifactItem>
<!-- Artifact gets loaded from repository at build time. -->
<groupId>com.mywork.tools.GeckoPrequal</groupId>
<artifactId>GeckoPrequal</artifactId>
<version>2.0</version>
<type>jar</type>
<!-- Per artifact configuration here: -->
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
<destFileName>axis-1.4.jar</destFileName>
</artifactItem>
<artifactItem>
<!-- Artifact gets loaded from repository at build time. -->
<groupId>com.mywork.tools.GeckoPrequal</groupId>
<artifactId>GeckoPrequal</artifactId>
<version>2.0</version>
<type>jar</type>
<!-- Per artifact configuration here: -->
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
<destFileName>axis-jaxrpc-1.4.jar</destFileName>
</artifactItem>
<artifactItem>
<!-- Artifact gets loaded from repository at build time. -->
<groupId>com.mywork.tools.GeckoPrequal</groupId>
<artifactId>GeckoPrequal</artifactId>
<version>2.0</version>
<type>jar</type>
<!-- Per artifact configuration here: -->
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
<destFileName>axis-saaj-1.4.jar</destFileName>
</artifactItem>
<artifactItem>
<!-- Artifact gets loaded from repository at build time. -->
<groupId>com.mywork.tools.GeckoPrequal</groupId>
<artifactId>GeckoPrequal</artifactId>
<version>2.0</version>
<type>jar</type>
<!-- Per artifact configuration here: -->
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
<destFileName>axis-wsdl4j-1.5.1.jar</destFileName>
</artifactItem>
<artifactItem>
<!-- Artifact gets loaded from repository at build time. -->
<groupId>com.mywork.tools.GeckoPrequal</groupId>
<artifactId>GeckoPrequal</artifactId>
<version>2.0</version>
<type>jar</type>
<!-- Per artifact configuration here: -->
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
<destFileName>commons-logging-1.0.4.jar</destFileName>
</artifactItem>
<artifactItem>
<!-- Artifact gets loaded from repository at build time. -->
<groupId>com.mywork.tools.GeckoPrequal</groupId>
<artifactId>GeckoPrequal</artifactId>
<version>2.0</version>
<type>jar</type>
<!-- Per artifact configuration here: -->
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
<destFileName>commons-discovery-0.2.jar</destFileName>
</artifactItem>
</artifactItems>
<!--
<outputDirectory>${project.build.directory}/lib</outputDirectory>
-->
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>true</overWriteSnapshots>
</configuration>
</execution>
</executions>
</plugin>
mvn clean
mvn package
Embedded error: Unable to download the artifact from any repository
Try downloading the file manually from the project website.
Then, install it using the command:
mvn install:install-file -DgroupId=com.mywork.tools.GeckoPrequal -DartifactId=GeckoPrequal -Dversion=2.0 -Dpackaging=jar -Dfile=/path/to/file
Alternatively, if you host your own repository you can deploy the file there:
mvn deploy:deploy-file -DgroupId=com.mywork.tools.GeckoPrequal -DartifactId=GeckoPrequal -Dversion=2.0 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
com.mywork.tools.GeckoPrequal:GeckoPrequal:jar:2.0
from the specified remote repositories:
central (http://repo1.maven.org/maven2),
java.net (http://download.java.net/maven/1),
jung.cvs.sourceforge.net (http://jung.cvs.sourceforge.net/viewvc/jung/jung2/)
http://maven.apache.org/shared/maven-archiver/examples/classpath.html#Make
you'll then run it with
java -jar my.jar 333333 tolgar sometext