Running stand alone java class using Maven

Hi I want to run my main class using Maven.Can anyone help?

SDET wrote:
Hi I want to run my main class using Maven.Can anyone help?I'm pretty sure the Maven documentation can be of great help. If not, the Maven-users mailing list is your resource of choice for Maven related questions.

Similar Messages

  • Database connection pool to stand alone java class

    Hi all,
    I would like to know the best way to use a database connection pool with a stand alone java class.
    In my web applications I usually use JDBC Data Source version 5 to connect to my database. In this case, I connect to an Oracle database. But in this scene, I've a WebSphere Application Server to provide this connection pool. But for stand alone applications, I don't know how to do because I don't have a Application server to run on.
    Can enyone help me with this beginner question?
    Best regards.

    I tried to find the pool class I created but it must be on another CD. Anyway, you can easily create a number of connections and place them on a stack (your own or java's). When you need one, pop it off. When you are finished, push it back.
    Good luck.

  • Calling a web service from a stand alone java class

    I need to invoke a web service from stand alone java class- Please let me know how to acheive this.
    Thanks

    Hi jazz123,
    There's an example in the [*Java Web Services Tutorial*|http://java.sun.com/webservices/docs/2.0/tutorial/doc/] : see Chapter 1: Building Web Services with JAX-WS - A Simple JAX-WS Client.

  • Calling a web service through SSL via a stand alone java class

    HI,
    I am trying to call a web service through SSL via a simple stand alone java client.
    I have imported the SSL certificate in my keystore by using the keytool -import command.
    Basically I want to add a user to a group on the server. Say I add a user user 1 to group group 1 using an admin userid and password. All these values are set in an xml file which I send to the server while calling the server. I pass the web service URL, the soap action name and the xml to post as the command line arguments to the java client.
    My xml file(Add.xml) that is posted looks like :
    <?xml version="1.0" encoding="UTF-8"?>
    <SOAP-ENV:Envelope
    xmlns:xsi = "http://www.w3.org/1999/XMLSchema-instance"
    xmlns:SOAP-ENC = "http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:SOAP-ENV = "http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsd = "http://www.w3.org/1999/XMLSchema"
    SOAP-ENV:encodingStyle = "http://schemas.xmlsoap.org/soap/encoding/">
    <SOAP-ENV:Body>
    <namesp1:modifyGroupOperation xmlns:namesp1 = "/services/modifyGroup/modifyGroupOp">
    <auth>
    <user>adminUser</user>
    <password>adminPassword</password>
    </auth>
    <operationType>ADD</operationType>
    <groupName>group1</groupName>
    <users>
    <userName>user1</userName>
    </users>
    </namesp1:modifyGroupOperation>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    I call the client as:
    java PostXML https://com.webservice.com/services/modifyGroup "/services/modifyGroup/modifyGroupOp" Add.xml
    I my client, I have set the following:
    System.setProperty("javax.net.ssl.keyStore", "C:\\Program Files\\Java\\jre1.5.0_12\\lib\\security\\cacerts");
    System.setProperty("javax.net.ssl.keyStorePassword", "password");
    System.setProperty("javax.net.ssl.trustStore", "C:\\Program Files\\Java\\jre1.5.0_12\\lib\\security\\cacerts");
    System.setProperty("javax.net.ssl.trustStorePassword", "password");
    But when I try to execute the java client, I get the following error:
    setting up default SSLSocketFactory
    use default SunJSSE impl class: com.sun.net.ssl.internal.ssl.SSLSocketFactoryImpl
    class com.sun.net.ssl.internal.ssl.SSLSocketFactoryImpl is loaded
    keyStore is : C:\Program Files\Java\jre1.5.0_12\lib\security\cacerts
    keyStore type is : jks
    keyStore provider is :
    init keystore
    init keymanager of type SunX509
    trustStore is: C:\Program Files\Java\jre1.5.0_12\lib\security\cacerts
    trustStore type is : jks
    trustStore provider is :
    init truststore
    adding as trusted cert:
    init context
    trigger seeding of SecureRandom
    done seeding SecureRandom
    instantiated an instance of class com.sun.net.ssl.internal.ssl.SSLSocketFactoryImpl
    main, setSoTimeout(0) called
    main, setSoTimeout(0) called
    %% No cached client session
    *** ClientHello, TLSv1
    RandomCookie: GMT: .....
    Compression Methods: { 0 }
    [write] MD5 and SHA1 hashes: len = 73
    main, WRITE: TLSv1 Handshake, length = 73
    [write] MD5 and SHA1 hashes: len = 98
    main, WRITE: SSLv2 client hello message, length = 98
    [Raw write]: length = 100
    [Raw read]: length = 5
    [Raw read]: length = 58
    main, READ: TLSv1 Handshake, length = 58
    *** ServerHello, TLSv1
    %% Created: [Session-1, SSL_RSA_WITH_RC4_128_MD5]
    ** SSL_RSA_WITH_RC4_128_MD5
    [read] MD5 and SHA1 hashes: len = 58
    [Raw read]: length = 5
    [Raw read]: length = 5530
    main, READ: TLSv1 Handshake, length = 5530
    *** Certificate chain
    chain [0] = ...
    chain [1] = ...
    chain [2] = ...
    chain [3] = ...
    main, SEND TLSv1 ALERT: fatal, description = certificate_unknown
    main, WRITE: TLSv1 Alert, length = 2
    [Raw write]: length = 7
    0000: 15 03 01 00 02 02 2E .......
    main, called closeSocket()
    main, handling exception: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
    main, called close()
    main, called closeInternal(true)
    main, called close()
    main, called closeInternal(true)
    main, called close()
    main, called closeInternal(true)
    Exception in thread "main" javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.c
    ertpath.SunCertPathBuilderException: unable to find valid certification path to requested target
    at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Unknown Source)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(Unknown Source)
    at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Unknown Source)
    at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Unknown Source)
    at com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(Unknown Source)
    at com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(Unknown Source)
    at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Unknown Source)
    at com.sun.net.ssl.internal.ssl.Handshaker.process_record(Unknown Source)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(Unknown Source)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.writeRecord(Unknown Source)
    at com.sun.net.ssl.internal.ssl.AppOutputStream.write(Unknown Source)
    at java.io.BufferedOutputStream.flushBuffer(Unknown Source)
    at java.io.BufferedOutputStream.flush(Unknown Source)
    at org.apache.commons.httpclient.methods.EntityEnclosingMethod.writeRequestBody(EntityEnclosingMethod.java:506)
    at org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.java:2110)
    at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1088)
    at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398)
    at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
    at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
    at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323)
    at PostXML.main(PostXML.java:111)
    Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find v
    alid certification path to requested target
    at sun.security.validator.PKIXValidator.doBuild(Unknown Source)
    at sun.security.validator.PKIXValidator.engineValidate(Unknown Source)
    at sun.security.validator.Validator.validate(Unknown Source)
    at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(Unknown Source)
    at com.sun.net.ssl.internal.ssl.JsseX509TrustManager.checkServerTrusted(Unknown Source)
    ... 18 more
    Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
    at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(Unknown Source)
    at java.security.cert.CertPathBuilder.build(Unknown Source)
    ... 23 more
    I do not know where I have gone wrong. Could someone point out my mistake.
    Thanks In advance!

    Hi jazz123,
    There's an example in the [*Java Web Services Tutorial*|http://java.sun.com/webservices/docs/2.0/tutorial/doc/] : see Chapter 1: Building Web Services with JAX-WS - A Simple JAX-WS Client.

  • Having Problem With "static" When Running a Stand Alone Java Class

    I have a Java class that recursively builds a 'tree' . This Java class works as I expected without problem. I am able to write out this 'tree" to the console "line by line" with proper indentation.
    The problem occurs when I try to iterate through this 'tree' in the public static void main(String[] arg) method -- Each line in the tree is an Array. And I have to declare this Array (called titleArray in my code) non-static; otherwise, I end up with picking up the very last line of my hard-coded data.
    Besides, I also have to declare the List (called recursiveTextArray in my code) non-static; otherwise, I end up with picking up the first Array that I ever build and run into endless iterations till the heap size is exhausted. Note that each element of that List is an Array object.
    Then, this non-static Array and this non-static List cannot be accessed in the public static void main(String[] arg) method.
    What should I do?
    Here is my code that works without problem (the one I do not access the 'titleArray' in the main(String[] arg) method):
    import java.util.Iterator;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Date;
    import java.awt.Color;
    import com.aspose.words.*;
    public class OplanPhase
         public static void main( String[] args)
              OplanPhase root = new OplanPhase( "", "Oplan 50XX - Phase I" );
              OplanPhase objective1 = new OplanPhase( "OO-3.1", "Destroy enemy conventional ground forces" );
              OplanPhase objective2 = new OplanPhase( "OO-3.2", "Destroy enemy conventional air forces" );          
              OplanPhase objective3 = new OplanPhase( "OO-3.3", "Destroy enemy conventional naval forces" );
              OplanPhase objective4 = new OplanPhase( "OO-3.4", "Influence opposition groups within enemy areas to support friendly forces" );
              OplanPhase effect1 = new OplanPhase( "TgtObj-3.1", "Locate, identify, and destroy key enemy C2 nodes" );
              OplanPhase effect2 = new OplanPhase( "TgtObj-3.2", "Locate, identify, and destroy key enemy C2 nodes" );          
              OplanPhase effect3 = new OplanPhase( "CFSOCC-3.2", "influence enemy opposition groups to support friendly forces campaign objectives" );
              OplanPhase effect4 = new OplanPhase( "JFMECC-3.3", "Destroy SLOC interdiction vessels" );
              OplanPhase effect5 = new OplanPhase( "CFSOCC-3.4", "Influence enemy opposition groups to support friendly forces campaign objectives" );     
              OplanPhase moe1 = new OplanPhase( "MOE-TO-3.1", "Conduct surveillance to locate and identify key enemy C2 nodes" );
              OplanPhase moe2 = new OplanPhase( "MOE-JFSOC-3.1", "Degree of cooperative effort with area opposition groups" );
              OplanPhase moe3 = new OplanPhase( "MOE-JFSOC-3.2", "Number of combined missions successfully completed with opposition groups" );
              OplanPhase moe4 = new OplanPhase( "MOE-JFSOC-3.3", "Number of combined missions successfully completed with opposition groups" );
              OplanPhase task1 = new OplanPhase( "TASK-TO-3.1", "Destroy key enemy C2 nodes" );
              OplanPhase task2 = new OplanPhase( "TASK-TO-3.2", "Conduct surveillance to locate and identify key enemy C2 nodes" );
              OplanPhase task3 = new OplanPhase( "TASK-TO-3.3", "Destroy key enemy C2 nodes" );
              OplanPhase task4 = new OplanPhase( "TASK-JFSOC-3.1", "Degree of cooperative effort with area opposition groups" );
              root.addSubLevel( objective1 );
              root.addSubLevel( objective2 );
              root.addSubLevel( objective3 );
              root.addSubLevel( objective4 );
              objective1.addSubLevel( effect1 );
              objective2.addSubLevel( effect2 );
              objective2.addSubLevel( effect3 );
              objective3.addSubLevel( effect4 );
              objective4.addSubLevel( effect5 );
              effect1.addSubLevel( moe1 );
              effect1.addSubLevel( task1 );
              effect2.addSubLevel( task2 );
              effect2.addSubLevel( task3 );
              effect3.addSubLevel( moe2 );
              effect3.addSubLevel( moe3 );
              effect5.addSubLevel( task4 );
              effect5.addSubLevel( moe4 );
              root.outputAllWithIndentation( 0 );
         private String[] titleArray = { "", "", "" };
         private int indentation = 0;
         private List<OplanPhase> subLevels = new ArrayList<OplanPhase>();
         private List recursiveTextArray = new ArrayList();
         public OplanPhase( String foo, String bar )
              titleArray[1] = foo;
              titleArray[2] = bar;
         public void addSubLevel( OplanPhase op )
              subLevels.add( op );
         public void outputAllWithIndentation( int level )
              indentation = level;
              titleArray[0] = indentString( indentation );
             System.out.println( titleArray[0] + "[" + titleArray[1] + "] " + titleArray[2] );
             recursiveTextArray.add( titleArray );
              for ( int i = 0; i < subLevels.size(); i++ )
                   ( ( OplanPhase )subLevels.get( i ) ).outputAllWithIndentation( level + 1 );
         private static String indentString( int count )
              String blank = "";
              for ( int i = 0; i < count; i++ )
                   blank = blank.concat( "   " );
              return blank;
    }And the code below gives me the static and non-static problem:
    import java.util.Iterator;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Date;
    import java.awt.Color;
    import com.aspose.words.*;
    public class OplanPhase
         public static void main( String[] args)
              OplanPhase root = new OplanPhase( "", "Oplan 50XX - Phase I" );
              OplanPhase objective1 = new OplanPhase( "OO-3.1", "Destroy enemy conventional ground forces" );
              OplanPhase objective2 = new OplanPhase( "OO-3.2", "Destroy enemy conventional air forces" );          
              OplanPhase objective3 = new OplanPhase( "OO-3.3", "Destroy enemy conventional naval forces" );
              OplanPhase objective4 = new OplanPhase( "OO-3.4", "Influence opposition groups within enemy areas to support friendly forces" );
              OplanPhase effect1 = new OplanPhase( "TgtObj-3.1", "Locate, identify, and destroy key enemy C2 nodes" );
              OplanPhase effect2 = new OplanPhase( "TgtObj-3.2", "Locate, identify, and destroy key enemy C2 nodes" );          
              OplanPhase effect3 = new OplanPhase( "CFSOCC-3.2", "influence enemy opposition groups to support friendly forces campaign objectives" );
              OplanPhase effect4 = new OplanPhase( "JFMECC-3.3", "Destroy SLOC interdiction vessels" );
              OplanPhase effect5 = new OplanPhase( "CFSOCC-3.4", "Influence enemy opposition groups to support friendly forces campaign objectives" );     
              OplanPhase moe1 = new OplanPhase( "MOE-TO-3.1", "Conduct surveillance to locate and identify key enemy C2 nodes" );
              OplanPhase moe2 = new OplanPhase( "MOE-JFSOC-3.1", "Degree of cooperative effort with area opposition groups" );
              OplanPhase moe3 = new OplanPhase( "MOE-JFSOC-3.2", "Number of combined missions successfully completed with opposition groups" );
              OplanPhase moe4 = new OplanPhase( "MOE-JFSOC-3.3", "Number of combined missions successfully completed with opposition groups" );
              OplanPhase task1 = new OplanPhase( "TASK-TO-3.1", "Destroy key enemy C2 nodes" );
              OplanPhase task2 = new OplanPhase( "TASK-TO-3.2", "Conduct surveillance to locate and identify key enemy C2 nodes" );
              OplanPhase task3 = new OplanPhase( "TASK-TO-3.3", "Destroy key enemy C2 nodes" );
              OplanPhase task4 = new OplanPhase( "TASK-JFSOC-3.1", "Degree of cooperative effort with area opposition groups" );
              root.addSubLevel( objective1 );
              root.addSubLevel( objective2 );
              root.addSubLevel( objective3 );
              root.addSubLevel( objective4 );
              objective1.addSubLevel( effect1 );
              objective2.addSubLevel( effect2 );
              objective2.addSubLevel( effect3 );
              objective3.addSubLevel( effect4 );
              objective4.addSubLevel( effect5 );
              effect1.addSubLevel( moe1 );
              effect1.addSubLevel( task1 );
              effect2.addSubLevel( task2 );
              effect2.addSubLevel( task3 );
              effect3.addSubLevel( moe2 );
              effect3.addSubLevel( moe3 );
              effect5.addSubLevel( task4 );
              effect5.addSubLevel( moe4 );
              root.outputAllWithIndentation( 0 );
              try
                  Iterator it = recursiveTextArray.iterator(); //compilation error
                  while ( it.hasNext() )
                       for ( int i=0; i<titleArray.length; i++ ) //compilation error
                            if ( i == 0 )
                                 System.out.println( titleArray[0] ); //compilation error
                            } else if ( i == 1 )
                                 System.out.println( "[" + titleArray[1] + "] " ); //compilation error                             
                            } else if ( i == 2 )
                                 System.out.println( titleArray[2] ); //compilation error
              } catch (Exception e)
                   // TODO Auto-generated catch block
                   e.printStackTrace();
         private String[] titleArray = { "", "", "" };
         private int indentation = 0;
         private List<OplanPhase> subLevels = new ArrayList<OplanPhase>();
         private List recursiveTextArray = new ArrayList();
         public OplanPhase( String foo, String bar )
              titleArray[1] = foo;
              titleArray[2] = bar;
         public void addSubLevel( OplanPhase op )
              subLevels.add( op );
         public void outputAllWithIndentation( int level )
              indentation = level;
              titleArray[0] = indentString( indentation );
             System.out.println( titleArray[0] + "[" + titleArray[1] + "] " + titleArray[2] );
             recursiveTextArray.add( titleArray );
              for ( int i = 0; i < subLevels.size(); i++ )
                   ( ( OplanPhase )subLevels.get( i ) ).outputAllWithIndentation( level + 1 );
         private static String indentString( int count )
              String blank = "";
              for ( int i = 0; i < count; i++ )
                   blank = blank.concat( "   " );
              return blank;
    }

    What should I do?If you feel you need to cross-post, you should have the courtesy to provide a
    link to the other post/s.
    http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=1&t=016129

  • Unable to connect to ECC system through stand alone JAVA program using JCO.

    Hi All,
    I want to connect to ECC system through standalone JAVA program using jco.while executing my java program it is saying that connection refused.
    I am getting the error as shown below.
    com.sap.mw.jco.JCO$Exception: (102) RFC_ERROR_COMMUNICATION: CMALLC : rc=20 > Co
    nnect from SAP gateway to RFC server failed
    Connect_PM  GWHOST=192.168.10.99, GWSERV=sapgw01, SYSNR=01
    LOCATION    SAP-Gateway on host igm501 / sapgw01
    ERROR       partner '192.168.10.99:sapgw01' not reached
    TIME        Mon Sep  1 15:00:37 2008
    RELEASE     700
    COMPONENT   NI (network interface)
    VERSION     38
    RC          -10
    MODULE      nixxi.cpp
    LINE        2821
    DETAIL      NiPConnect2
    SYSTEM CALL connect
    ERRNO       239
    ERRNO TEXT  Connection refused
    COUNTER     2
            at com.sap.mw.jco.rfc.MiddlewareRFC$Client.nativeConnect(Native Method)
            at com.sap.mw.jco.rfc.MiddlewareRFC$Client.connect(MiddlewareRFC.java:11
    25)
            at com.sap.mw.jco.JCO$Client.connect(JCO.java:3138)
            at JConnector_frmDesk.<init>(JConnector_frmDesk.java:91)
            at JConnector_frmDesk.main(JConnector_frmDesk.java:141)
    I have already configured SAPDP01,SAPGW01 in my services file in windows\system32\drivers\etc\services.
    What else i need to do to connect to ECC system through my JAVA program.Please help me in this regard.
    Regards,
    Ramana.

    Hi !
    Check this to verify that you are correctly using JCO:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/8e7daa90-0201-0010-9499-cd347ffbbf72
    Try to give in ashost="/H/saprouter/H/sap".
    Regards,
    Matias.

  • Error in obtaining token using TokenManager thru a stand-alone java appln

    I am trying to use the IS Java APIs to connect to the directory server and insert a user in the directory from a stand alone java appln.
    I get an SSOException while trying to obtain a Token object from the TokenManager (TokenManager.createSSOToken() method ).
    Following is the dump of the error:
    Exception Message: LDAP authentication failed.
    com.iplanet.sso.SSOException: LDAP authentication failed.
    at com.iplanet.sso.providers.dpro.SSOProviderImpl.createSSOToken(SSOProv
    iderImpl.java:94)
    at com.iplanet.sso.SSOTokenManager.createSSOToken(SSOTokenManager.java:2
    57)
    at SampleUserOperations.main(SampleUserOperations.java:51)
    However, the principal and password supplied in the code are correct. Following is the code that generates this error.
    public static void main(String[] args)
              int count = 0;
              SSOTokenManager Manager = null;
              SSOToken Token = null;
              AMStoreConnection AMConn = null;
              try
                   //create a token
                   Manager = SSOTokenManager.getInstance();
                   System.out.println("Got a token mgr");               
                   Token = Manager.createSSOToken(new AuthPrincipal("uid=admin,ou=administrators,ou=topologymanagement,o=netscaperoot"), "abcdefg123");          
                                  System.out.println("Got a token");
                   AMConn = new AMStoreConnection(Token);
                   System.out.println("Got a conn");
              catch (com.iplanet.sso.SSOException e)
                   count++;
                   System.out.println("COUNT = " + count + " : " + e);
    The credentials provided in the code are correct. What could be the cause of the error?
    TIA,
    siddharth.

    Tthis class is undocumented and this is the reason why you will not find any documentation. This is not the correct way for a client to authenticate to the is in v6. You need to use the JAAS API. I do not believe that the AuthPrincipal sample works in 6.
    The package for the class is com/sun/identity/authentication/internal/
    rdgs
    Steve

  • Running a plain java class in command prompt which uses third party jars

    i have to run a simple java class. its actually a process which is running in the background. Now to run this java file i have created a batch file. my problem is that this java file uses around 100 jar files. when i try to run this java file (actually .class file) it gives me no class defination found error for this java(class) file. What can be the problem. My java home is set....how to solve this problem

    i have to run a simple java class
    my problem is that this java file uses around 100 jar filesThese two statements are contradictory.
    it gives me no class defination found error for this java(class) file. What can be the problemThe class is not on the classpath.
    how to solve this problemEnsure all classes are on the classpath.
    I bet if your searched this forum (or even read the java tutorial) you'd find something .

  • Using telnet sockets and running stand alone

    Hi all,
    I'm writing a Flex application that uses sockets to
    communicate through Telnet / port 23 with AV control devices over
    the local network. The target is to run the application locally (so
    not from a web server) from a PC.
    The application works fine from my development machine.
    However when I copy the bin folder to the target machine, the
    telnet connections refuse to open. Actually, it appears that
    wherever I copy the bin folder (including to a different location
    on my machine) the connections won't open. Simple opening the html
    file from the bin folder on my machine works perfectly.
    Anyone have any idea what could be wrong or what I can do to
    fix this. Any input would be greatly appeciated.
    Mirko

    SDET wrote:
    Hi I want to run my main class using Maven.Can anyone help?I'm pretty sure the Maven documentation can be of great help. If not, the Maven-users mailing list is your resource of choice for Maven related questions.

  • Consuming dataservice as a stand alone java client, givng an exception com

    when i am trying to access data service from a stand alone java application ,it giving an exception .
    The dataservice is in remote machine.
    Exception:
    com.bea.dsp.dsmediator.client.exception.SDOMediatorException: weblogic.rjvm.PeerGoneException: ; nested exception is:
         java.io.EOFException
         at com.bea.dsp.dsmediator.client.XmlDataServiceBase.invokeFunction(XmlDataServiceBase.java:322)
         at empldetappdataservices.EmployeeDetails.getEmployeesByid(EmployeeDetails.java:84)
         at com.patni.tsg.poc.DataServiceClient.DataServiceClient.main(DataServiceClient.java:42)
    Caused by: weblogic.rjvm.PeerGoneException: ; nested exception is:
         java.io.EOFException
         at weblogic.rjvm.BasicOutboundRequest.sendReceive(BasicOutboundRequest.java:108)
         at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:290)
         at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:248)
         at com.bea.ld.Server_ydm4ie_EOImpl_815_WLStub.executeFunction(Unknown Source)
         at com.bea.dsp.dsmediator.client.XmlDataServiceBase.invokeFunction(XmlDataServiceBase.java:312)
         ... 2 more
    Caused by: java.io.EOFException
         at weblogic.rjvm.t3.T3JVMConnection.endOfStream(T3JVMConnection.java:897)
         at weblogic.socket.SocketMuxer.deliverExceptionAndCleanup(SocketMuxer.java:586)
         at weblogic.socket.SocketMuxer.deliverEndOfStream(SocketMuxer.java:536)
         at weblogic.socket.SocketMuxer.readReadySocketOnce(SocketMuxer.java:694)
         at weblogic.socket.SocketMuxer.readReadySocket(SocketMuxer.java:641)
         at weblogic.socket.JavaSocketMuxer.processSockets(JavaSocketMuxer.java:282)
         at weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:32)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)
    my class path i added all neccessary jars:
    weblogic.jar,xbean.jar,DataServices.jar,ld-server-core.jar,ld-client.jar,wlsdo.jar
    code sample:
    public static InitialContext getInitialContext() throws NamingException {
    Environment env = new Environment();
    env.setProviderUrl("t3://pc-p40892:7001");
    env.setInitialContextFactory("weblogic.jndi.WLInitialContextFactory");
    env.setSecurityPrincipal("weblogic");
    env.setSecurityCredentials("weblogic");
    return new InitialContext(env.getInitialContext().getEnvironment());
    public static void main (String args[]) {
    try {
    EmployeeDetailsDocument.EmployeeDetails edet=null;
    EmployeeDetails ds=EmployeeDetails.getInstance(getInitialContext(),"EmplDetApp");
    //The below statement generating the exception.
    EmployeeDetailsDocument[]doc =ds.getEmployeesByid("1001");
    } catch (Exception e) {
    e.printStackTrace();
    pls help me to solve this problem
    Edited by sandeepc221 at 09/19/2007 2:50 AM

    You didn't post the stack trace from the server, but I'm guessing it's complaining about the QName class. Sun changed the QName class in JDK 1.5 wreaking havoc on JDK 1.5 clients that use JDK 1.4 servers and attempt to pass a QName object from one to the other. If your client uses JDK 1.5, your sever will need to use a QName class which is compatible. The file liquiddata/lib/wls90interop.jar contains a QName class that is compatible with the one in JDK1.5. You can put it first in the classpath of your server.
    If you already have wls90interop.jar first in the classpath of your server, then, for your client, you need to either (1) use the Sun JDK 1.5; or (2) put wls90interop.jar first in the classpath of your client (if you are running JDK 1.4).
    http://e-docs.bea.com/aldsp/docs25/appdev/ejbclt.html#wp1090900
    btw - BEA Customer Support is available 24/7 - they should be able to provide you quick answers to questions like this.

  • How to call stand Alone java program from jsp

    Hello all...
    I want to use the stand alone java program in jsp page. I compiled the java program and place the class file in classes folder under web-inf. But when i try to instantiate the java class inside jsp it is not recognizing the class. Where might be the problem
    Plz help....
    Shamim

    hi , this is dheeraj.. i need to know that how to execute java code and class in jsp.. if anyone know about if bt tell me.. i just know that we can use java code by java beans in jsp.. if you know any knowledge regarding this topic please send me.....

  • Stand alone exe errors using report generation vi's

    I have a stand alone application that uses some report generation vi's. I have added the _wordsub.llb as a support file. In the main program I have told the report generations vi's where to find the _wordsub.llb so it can load the dynamic vi's as needed. The problem is when I run the stand-alone executable I get an open refernce error for one of the dynamic vi's that says that vi is not executable. But when I reconfigure the executable and include that vi as a dymaically loaded vi in addition to the _wordsub.llb, the stand alone works error free. Any suggestions?

    It really depends on what version of office you are using. Some methods have different set of parameters or even different names, labview does not adjust them accordingly, even though the code might execute but it will fail during build process. You must reselect the methods manually in order to build the executable. Most time you need to build different executables for each office version.
    -Joe

  • Can not locate Java class using JNI within C++ DLL

    I am using trying to use JNI to call a Java class from C++. The Java class uses JMS to send messages to a JMS message queue. At first I coded the C++ in a console application that created the JavaVM and used JNI to access the Java class. All worked fine. Then I called the Java class using JNI from threads and ran into the problem of the Java class not able to locate the JMS related classes. This was solved by placing the following line in the constructor of the Java class.
    Thread.currentThread().setContextClassLoader(ClassLoader.getSystemClassLoader());
    Then I moved the JNI code from a console application to a DLL in specific an extension DLL that is called by SQL Server or Oracle server. The DLL will use JNI to call the Java class and send messages to a JMS message queue.
    The problem I am having now when the DLL code is called by SQL Server the call to
    JNI_CreateJavaVM
    appears to work correctly but the call to find the Java class using
    jvmEnv->FindClass(pName)
    fails. It appears the is a class loading problem which occurs due to the fact JNI is called from a DLL. When the VM is created I pass the class path information using the statement
    -Djava.class.path=
    And as I stated before it all works when running from a console application. I am new to JNI and really need help in the form of some sample code that will solve this problem. I believe I need to somehow load the classpath information from the DLL but I can not find examples on how to do this using JNI. I have tried several ways using URLClassLoader and getSystemClassLoader from JNI and either it does not work or it crashes very badly.
    I used the following code to determine what the existing class path is and the string returns empty.
    jcls = jvmEnv->FindClass("java/lang/System");
    jmid = jvmEnv->GetStaticMethodID(jcls, "getProperty", "(Ljava/lang/String;)Ljava/lang/String;");
    jstrClassPath = jvmEnv->NewStringUTF("java.class.path");
    jstr = (jstring)jvmEnv->CallStaticObjectMethod(jcls, jmid, jstrClassPath);
    m_jstr = (jstring)jvmEnv->NewGlobalRef(jstr);
    pstr = jvmEnv->GetStringUTFChars(m_jstr, 0);
    Can anyone please help with example code that will solve this problem. Thanks in advance for any help.
    Charles�

    I have determined the problem occurs when the application/component is compiled using VC 6.0. The test application was compiled using VC 7.1 and works correctly by locating the class path information. If the test application is compiled using VC 6.0 it has the same problem.
    The jvm.dll I am using is version 1.4.2.80. Currently this is not an option to compile all the applications that use JNI using VC 7.1 so can someone please tell me how to solve this problem.

  • How to call a stand alone java application from ADF BC JSP, struts or JSF

    Hi,
    My requirement is that there are utilities or stand alone java applications that I want to call from our existing applications.
    We have two seperate applications one ADF BC Struts application we developed using JDeveloper 10.1.2 and another ADF BC JSF application we developed using JDeveloper 10.1.3.2.
    We want to integrate applications like JTwain and others to help us in scanning. The application will be placed on the same server as our application. How can I do this without loosing all the current session information.
    Please help.
    Thanks and regards,

    There are two possible solutions.
    First, if the tool or application you want to integrate, has an Java-API you can use this api and integrate the tool in your application (using one or more jars you add to the classpath).
    Second, if the tool has no java api, you can call the tool via runtime.exec(...) as a shell process. This way you open a command shell in you application and execute the tool like you do on a normal command shell.
    For tide integration and control I recommend the first approach. The second one is only for those tools which don't offer a java api.
    Timo

  • Exceptions arsing while accessing DataSource   from a stand alone java clie

    Dear all responders,
    can any one help in resolving my problem??the problem description is as follows:
    i am using sun one application server 7.0 to deploy a J2EE Apllication
    so i have created a data source using the admin page with the name
    "nodbsession".now i want to access this datasource using a stand alone java client and want to establish a connection to database.i am using the following code snippet to do so
    **code is as follows**
    Hashtable env=new Hashtable();
                   env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.cosnaming.CNCtxFactory");
                   env.put(Context.PROVIDER_URL, "iiop://localhost:3700");
                   System.out.println("creating context");
                   Context ctx =new InitialContext(env);
                                  System.out.println("created successfull");
                   DataSource ds =(DataSource)ctx.lookup("nodbsession");
    /* by using like this also it is not working
    DataSource ds =(DataSource)ctx.lookup("java:comp/env/jdbc/nodbsession");
    i am able to obtain the context succussfully but the exception is thrown for the data source look up
    the following exception is thrown
    javax.naming.NameNotFoundException. Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0
    at org.omg.CosNaming.NamingContextPackage.NotFoundHelper.read(NotFoundHelper.java:72)
    at org.omg.CosNaming._NamingContextExtStub.resolve(_NamingContextExtStub.java:402)
    at com.sun.jndi.cosnaming.CNCtx.callResolve(CNCtx.java:440)
    at com.sun.jndi.cosnaming.CNCtx.lookup(CNCtx.java:492)
    at com.sun.jndi.cosnaming.CNCtx.lookup(CNCtx.java:470)
    at javax.naming.InitialContext.lookup(InitialContext.java:347)
    at Test.<init>(Test.java:27)
    at Test.main(Test.java:47)
    please help me in resolving the above problem
    advance thanx to all those who intend to reply
    please provide me a proper resolution

    I think the appserver uses com.sun.enterprise.naming.SerialInitContextFactory on the server side to register different resources. Anything registered with SerialialInitContextFactory cannot be resolved with a CNCtxFactory.
    Can you try using SerialInitContextFactory on the client side.

Maybe you are looking for

  • Updated to usb 2.0, having issues with the zen microph

    basically, put a new usb 2.0 card thing in my computer and when i plug my zen microphoto to it i get a message saying that i need to install the drivers for it, which i can't find online and don't have the cd for anymore. My Zen Nano Plus works fine

  • JFileChooser applet doesn't work on all platforms

    We have a signed Java applet which works perfectly on Windows XP and Linux but malfunctions on Windows 7 and MacOS 10.5. The part which does not work is opening up a JFileChooser (which opens up fine) which then permits the user to browse local files

  • Due to shortend fiscal year problem in depre amounts.

    Dear All, Due to shortend fiscal year (apr07-mar08)  we are facing Depre calculation problem. 1)       There are no errors in AFAB & AW01N.  Itu2019s showing   balance 3 (jan07,feb07,mar07)months depre in AFAB u201CTo Postu201D column. 2)  User doesn

  • /etc/init.d/oracle-xe not found

    Hi, I installed oracle-xe-universal 10g on debian 4 after that manually deistalled see: http://www.oracle.com/technology/software/products/database/xe/files/install.102/b25144/toc.htm#CIHDDHJD then I installed xe again. My second installation was ok.

  • Configuration best practice

    My final deployed solution is going to consist of several PC-Fieldpoint pairs all located on the company intranet. Each PC talks to its own Fieldpoint and not any other. I have the sequences and Users.ini stored on the server. Now I'm trying to come