Security Exception from Java stand-alone program on Linux

Hi All,
I am getting the following exception while running a Java stand-alone program on Linux.
The stand-alone program internally calls the JCE (Java Cryptography Extension) library for Encryption of data.
Does anybody have the solution for this error?
Is there any Security policy modification to be made for the same?
Exception in thread "main" java.lang.ExceptionInInitializerError
at javax.crypto.Cipher.a(Unknown Source)
at javax.crypto.Cipher.getInstance(Unknown Source)
at lncrypt.LnCryptBase.encryptImpl(LnCryptBase.java:122)
at lncrypt.LnAes.encrypt(LnAes.java:78)
at CloakingUtils.encrypt(CloakingUtils.java:69)
at AlertsMigrationSweepUtil.updateAlerts(AlertsMigrationSweepUtil.java:203)
at AlertsMigrationSweepUtil.main(AlertsMigrationSweepUtil.java:65)
Caused by: java.lang.SecurityException: Cannot set up certs for trusted CAs
at javax.crypto.e.<clinit>(Unknown Source)
... 7 more
Caused by: java.lang.SecurityException: Jurisdiction policy files are not signed by trusted signers!
at javax.crypto.e.a(Unknown Source)
at javax.crypto.e.a(Unknown Source)
at javax.crypto.e.g(Unknown Source)
at javax.crypto.f.run(Unknown Source)
at java.security.AccessController.doPrivileged1(Native Method)
at java.security.AccessController.doPrivileged(AccessController.java:351)
... 8 more
Regards,
Vilas Kulkarni

No security modification is normally required. I can't be sure but it looks to me like the jar file containing the package javax.crypto.e has not been signed by Sun. If you are writing your own provider then you would do well to look at reply #7 of http://forum.java.sun.com/thread.jspa?threadID=5222038 .

Similar Messages

  • Error acccess secure sight from a stand alone client using mutual Auth

    Dear Forum,
    Please help me in fixing the error.
    Here is what I am doing
    I created my system cert using key tool and placed it in cacerts. Sent the CSR to the CA. Got the *.ser from CA. Imported the *.ser into cacerts truststore.
    Now created a standalone (not on the webserver) HTTP program to run on command line. I get the following error while issuing a greeting/login.
    Please help!
    ==================================================
    29392 [main] DEBUG org.apache.commons.httpclient.HttpClient - Operating system name: Windows XP
    29392 [main] DEBUG org.apache.commons.httpclient.HttpClient - Operating system architecture: x86
    29392 [main] DEBUG org.apache.commons.httpclient.HttpClient - Operating system version: 5.1
    29973 [main] DEBUG org.apache.commons.httpclient.HttpClient - SUN 1.42: SUN (DSA key/parameter generation; DSA signing; SHA-1, MD5 digests; SecureRandom; X.509 certificates; JKS keystore; PKIX CertPathValidator; PKIX CertPathBuilder; LDAP, Collection CertStores)
    29973 [main] DEBUG org.apache.commons.httpclient.HttpClient - SunJSSE 1.42: Sun JSSE provider(implements RSA Signatures, PKCS12, SunX509 key/trust factories, SSLv3, TLSv1)
    29973 [main] DEBUG org.apache.commons.httpclient.HttpClient - SunRsaSign 1.42: SUN's provider for RSA signatures
    29973 [main] DEBUG org.apache.commons.httpclient.HttpClient - SunJCE 1.42: SunJCE Provider (implements DES, Triple DES, AES, Blowfish, PBE, Diffie-Hellman, HMAC-MD5, HMAC-SHA1)
    29973 [main] DEBUG org.apache.commons.httpclient.HttpClient - SunJGSS 1.0: Sun (Kerberos v5)
    55189 [main] INFO com.verisign.epp.interfaces.EPPHttpSession - EPPHttpSession: Initializing EPPSSLImpl and HttpsURLConnection
    58063 [main] INFO com.verisign.epp.transport.client.EPPSSLImpl - EPPSSLImpl starting initialization
    332067 [main] INFO com.verisign.epp.transport.client.EPPSSLImpl - EPPSSLImpl successfully initialized
    381268 [main] DEBUG com.verisign.epp.interfaces.EPPHttpSession - login() enter
    382420 [main] DEBUG org.apache.commons.httpclient.methods.GetMethod - enter GetMethod(String)
    384903 [main] INFO com.verisign.epp.interfaces.EPPHttpSession - Connecting to server https://epp-ote.verisign-grs.com:700/nsgateway/epp/controller using HTTP GET
    411542 [main] DEBUG org.apache.commons.httpclient.HttpClient - enter HttpClient.executeMethod(HttpMethod)
    412643 [main] DEBUG org.apache.commons.httpclient.HttpClient - enter HttpClient.executeMethod(HostConfiguration,HttpMethod,HttpState)
    412673 [main] DEBUG org.apache.commons.httpclient.HttpConnection - enter HttpConnection.open()
    412823 [main] DEBUG org.apache.commons.httpclient.HttpConnection - HttpConnection.setSoTimeout(0)
    412823 [main] DEBUG org.apache.commons.httpclient.HttpMethodBase - enter HttpMethodBase.execute(HttpState, HttpConnection)
    412833 [main] DEBUG org.apache.commons.httpclient.HttpMethodBase - Execute loop try 1
    412833 [main] DEBUG org.apache.commons.httpclient.HttpMethodBase - enter HttpMethodBase.processRequest(HttpState, HttpConnection)
    412833 [main] DEBUG org.apache.commons.httpclient.HttpMethodBase - Attempt number 1 to process request
    412833 [main] DEBUG org.apache.commons.httpclient.HttpMethodBase - enter HttpMethodBase.writeRequest(HttpState, HttpConnection)
    412833 [main] DEBUG org.apache.commons.httpclient.HttpMethodBase - enter HttpMethodBase.writeRequestLine(HttpState, HttpConnection)
    412833 [main] DEBUG org.apache.commons.httpclient.HttpMethodBase - enter HttpMethodBase.generateRequestLine(HttpConnection, String, String, String, String)
    412843 [main] DEBUG httpclient.wire.header - >> "GET /nsgateway/epp/controller HTTP/1.1[\r][\n]"
    412843 [main] DEBUG org.apache.commons.httpclient.HttpConnection - enter HttpConnection.print(String)
    412843 [main] DEBUG org.apache.commons.httpclient.HttpConnection - enter HttpConnection.write(byte[])
    412843 [main] DEBUG org.apache.commons.httpclient.HttpConnection - enter HttpConnection.write(byte[], int, int)
    412843 [main] DEBUG org.apache.commons.httpclient.HttpMethodBase - enter HttpMethodBase.writeRequestHeaders(HttpState,HttpConnection)
    412843 [main] DEBUG org.apache.commons.httpclient.HttpMethodBase - enter HttpMethodBase.addRequestHeaders(HttpState, HttpConnection)
    412853 [main] DEBUG org.apache.commons.httpclient.HttpMethodBase - enter HttpMethodBase.addUserAgentRequestHeaders(HttpState, HttpConnection)
    412853 [main] DEBUG org.apache.commons.httpclient.HttpMethodBase - enter HttpMethodBase.addHostRequestHeader(HttpState, HttpConnection)
    412853 [main] DEBUG org.apache.commons.httpclient.HttpMethodBase - Adding Host request header
    412853 [main] DEBUG org.apache.commons.httpclient.HttpMethodBase - enter HttpMethodBase.addCookieRequestHeader(HttpState, HttpConnection)
    412873 [main] DEBUG org.apache.commons.httpclient.HttpState - enter HttpState.getCookies()
    412873 [main] DEBUG org.apache.commons.httpclient.cookie.CookieSpec - enter CookieSpecBase.match(String, int, String, boolean, Cookie[])
    412873 [main] DEBUG org.apache.commons.httpclient.HttpMethodBase - enter HttpMethodBase.addAuthorizationRequestHeader(HttpState, HttpConnection)
    412873 [main] DEBUG org.apache.commons.httpclient.HttpMethodBase - enter HttpMethodBase.addProxyAuthorizationRequestHeader(HttpState, HttpConnection)
    412883 [main] DEBUG org.apache.commons.httpclient.HttpMethodBase - enter HttpMethodBase.addProxyConnectionHeader(HttpState, HttpConnection)
    412883 [main] DEBUG org.apache.commons.httpclient.HttpMethodBase - enter HttpMethodBase.addContentLengthRequestHeader(HttpState, HttpConnection)
    412883 [main] DEBUG httpclient.wire.header - >> "Connection: Keep-Alive[\r][\n]"
    412883 [main] DEBUG org.apache.commons.httpclient.HttpConnection - enter HttpConnection.print(String)
    412883 [main] DEBUG org.apache.commons.httpclient.HttpConnection - enter HttpConnection.write(byte[])
    412883 [main] DEBUG org.apache.commons.httpclient.HttpConnection - enter HttpConnection.write(byte[], int, int)
    412883 [main] DEBUG httpclient.wire.header - >> "User-Agent: Jakarta Commons-HttpClient/2.0.2[\r][\n]"
    412883 [main] DEBUG org.apache.commons.httpclient.HttpConnection - enter HttpConnection.print(String)
    412883 [main] DEBUG org.apache.commons.httpclient.HttpConnection - enter HttpConnection.write(byte[])
    412883 [main] DEBUG org.apache.commons.httpclient.HttpConnection - enter HttpConnection.write(byte[], int, int)
    412883 [main] DEBUG httpclient.wire.header - >> "Host: epp-ote.verisign-grs.com:700[\r][\n]"
    412883 [main] DEBUG org.apache.commons.httpclient.HttpConnection - enter HttpConnection.print(String)
    412883 [main] DEBUG org.apache.commons.httpclient.HttpConnection - enter HttpConnection.write(byte[])
    412883 [main] DEBUG org.apache.commons.httpclient.HttpConnection - enter HttpConnection.write(byte[], int, int)
    412883 [main] DEBUG org.apache.commons.httpclient.HttpConnection - enter HttpConnection.writeLine()
    412883 [main] DEBUG org.apache.commons.httpclient.HttpConnection - enter HttpConnection.write(byte[])
    412883 [main] DEBUG org.apache.commons.httpclient.HttpConnection - enter HttpConnection.write(byte[], int, int)
    412883 [main] DEBUG org.apache.commons.httpclient.HttpConnection - enter HttpConnection.flushRequestOutputStream()
    413244 [main] DEBUG org.apache.commons.httpclient.HttpConnection - enter HttpConnection.close()
    413244 [main] DEBUG org.apache.commons.httpclient.HttpConnection - enter HttpConnection.closeSockedAndStreams()
    413244 [main] DEBUG org.apache.commons.httpclient.HttpConnection - enter HttpConnection.close()
    413244 [main] DEBUG org.apache.commons.httpclient.HttpConnection - enter HttpConnection.closeSockedAndStreams()
    413244 [main] DEBUG org.apache.commons.httpclient.HttpConnection - enter HttpConnection.close()
    413244 [main] DEBUG org.apache.commons.httpclient.HttpConnection - enter HttpConnection.closeSockedAndStreams()
    413244 [main] DEBUG org.apache.commons.httpclient.HttpConnection - enter HttpConnection.releaseConnection()
    [b][b]613923 [main] ERROR com.verisign.epp.interfaces.EPPHttpSession - Couldn't execute HTTP GET to server https://epp-ote.verisign-grs.com:700/nsgateway/epp/controller
    java.net.SocketException: Software caused connection abort: socket write error
         at java.net.SocketOutputStream.socketWrite0(Native Method)
         at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
         at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
         at com.sun.net.ssl.internal.ssl.OutputRecord.a(DashoA12275)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA12275)
         at com.sun.net.ssl.internal.ssl.SunJSSE_ax.a(DashoA12275)
         at com.sun.net.ssl.internal.ssl.SunJSSE_az.j(DashoA12275)
         at com.sun.net.ssl.internal.ssl.SunJSSE_az.a(DashoA12275)
         at com.sun.net.ssl.internal.ssl.SunJSSE_az.a(DashoA12275)
         at com.sun.net.ssl.internal.ssl.SunJSSE_ax.a(DashoA12275)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA12275)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.j(DashoA12275)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA12275)
         at com.sun.net.ssl.internal.ssl.AppOutputStream.write(DashoA12275)
         at org.apache.commons.httpclient.HttpConnection$WrappedOutputStream.write(HttpConnection.java:1360)
         at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:66)
         at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124)
         at org.apache.commons.httpclient.HttpConnection.flushRequestOutputStream(HttpConnection.java:790)
         at org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.java:2271)
         at org.apache.commons.httpclient.HttpMethodBase.processRequest(HttpMethodBase.java:2651)
         at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1087)
         at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:643)
         at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:497)
         at com.verisign.epp.interfaces.EPPHttpSession.login(EPPHttpSession.java:545)
         at com.verisign.epp.interfaces.EPPSession.initSession(EPPSession.java:805)
         at EPPHttpClient.initSession(EPPHttpClient.java:156)
         at EPPHttpClient.testSession(EPPHttpClient.java:116)
         at EPPHttpClient.main(EPPHttpClient.java:291)

    Thanks for pointing me in the right direction. I'm still having lots of trouble with this though. I modified the CartApp to take in the lookup URL as an arguement. I found different documentation online about this but I can't seem to make total sense of it. I am REALLY confused about what exaclty my lookup URL should be and if the command I'm using to run the application is correct. I am also wondering if I am supposed to configure anything on server so that the corba thing will work.
    Here is my latest try and the error that I'm getting. I really appreciate any help.
    C:\client>java -Dorg.omg.CORBA.ORBInitialHost=localhost -Dorg.omg.CORBA.ORBIniti
    alPort=3700 -classpath .;./CartAppClient.jar;./j2ee.jar;./appserv-rt.jar; CartCl
    ient corbaname:iiop:localhost:3700#SimpleCart
    CartClient running...
    initial.lookup String: corbaname:iiop:localhost:3700#SimpleCart
    Caught an unexpected exception!
    javax.naming.NameNotFoundException [Root exception is org.omg.CosNaming.NamingCo
    ntextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0]
    at com.sun.jndi.cosnaming.ExceptionMapper.mapException(ExceptionMapper.j
    ava:44)
    at com.sun.jndi.cosnaming.CNCtx.callResolve(CNCtx.java:453)
    at com.sun.jndi.cosnaming.CNCtx.lookup(CNCtx.java:492)
    at com.sun.jndi.toolkit.url.GenericURLContext.lookup(GenericURLContext.j
    ava:185)
    at javax.naming.InitialContext.lookup(InitialContext.java:347)
    at CartClient.main(CartClient.java:66)
    Caused by: org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNamin
    g/NamingContext/NotFound:1.0
    at org.omg.CosNaming.NamingContextPackage.NotFoundHelper.read(NotFoundHe
    lper.java:72)
    at org.omg.CosNaming._NamingContextStub.resolve(_NamingContextStub.java:
    251)
    at com.sun.jndi.cosnaming.CNCtx.callResolve(CNCtx.java:440)
    ... 4 more

  • Migrating stand alone programs to web based application

    Hi,
    I have a small application consisting of .class files. I created these using Swing components and it's based on Client/ server model where it accesses Oracle Database.
    I want to deploy these programs in Java App Server so that it can be accessed thru web browser.
    Please tell me how to do it.
    Thanks in advance.
    Rajeev.
    Message was edited by:
    Rajeev.Asthana

    If this was the thing, Sun, Microsoft and IBM
    wouldn't have even giving a thought of migrating
    legacy application (I'm talking about Mainframes and
    AS/400 here). If this kind of migration is possible,
    can't we migrate a java code from stand-alone
    "version" to web enabled.
    Migration is not really a term to use to for converting a stand alone application to a web application. Unless of course again you are prepared to turn it into an applet.
    The flow and control of a web application are entirely different from a stand alone app. You will not be able to reuse Swing GUI's from a web server. I don't know how to make that any clearer.
    Hopefully you have a good design for your existing application and you can relatively easily reuse your existing business logic components.

  • How to access my application on a SunOne 8.0.0_01 from a stand-alone client

    Hello,
    perhaps someone of you knows how can solve my problem accessing my J2EE-Application with EJBs, etc. from a stand-alone client.
    In the classpath of my client the appserv-rt.jar and j2ee.jar are accessible. In the sourcecode I tried to access the server with:
    Properties env = new Properties();
    env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.cosnaming.CNCtxFactory");       
    env.put(Context.PROVIDER_URL, "iiop://myserver:3700");
    Context initialContext = new InitialContext(env);
    Object objRef = initialContext.lookup("MySessionBean");With these setting I get this exception:
    java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
         java.rmi.RemoteException
         at com.sun.corba.se.internal.iiop.ShutdownUtilDelegate.mapSystemException(ShutdownUtilDelegate.java:64)
         at javax.rmi.CORBA.Util.mapSystemException(Util.java:65)
         at de.fhhn.ectsmodulclient.interfaces._ECTSModulSession_Stub.getStudiengaenge(Unknown Source)
         at de.hshn.ectsmodulclient.web.StandAloneClient.showStudiengaenge(StandAloneClient.java:68)
         at de.hshn.ectsmodulclient.web.StandAloneClient.main(StandAloneClient.java:90)
    Caused by: java.rmi.RemoteException
         at com.sun.enterprise.iiop.POAProtocolMgr.mapException(POAProtocolMgr.java:213)
         at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:797)
         at com.sun.ejb.containers.EJBObjectInvocationHandler.invoke(EJBObjectInvocationHandler.java:137)
         at $Proxy36.getStudiengaenge(Unknown Source)Can anybody tell me what the problem is and probably how I can make it work?
    Are there some "hidden" configuration-parameters on the serverside that I have to set/change?
    Thank you for your help!
    Greetings
    Gregor Ewald

    Did your stand-alone client on the remote machine encounter the same error as your tomcat attempt? Try looking in the tomcat log for a more detailed stack trace.
    I'm able to do this from tomcat 5.0 on a remote machine with JDK 1.5 and the latest version of the J2EE 1.4 SDK release (AS 8.2) for an appserver running on linux or solaris. You might want to try with those versions as well.
    --ken                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Calling secured webservice from java

    Hi Experts,
    I am trying to call a secured webservice from java.
    I got the code to call a non secured web service in java.
    What changes do i need to do in this to call a secured webservice.
    Please help me.
    Thank you
    Regards
    Gayaz
    calling unsecured webservice
    package wscall1;
    import java.io.BufferedReader;
    import java.io.ByteArrayOutputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.InputStreamReader;
    import java.io.OutputStream;
    import java.io.StringBufferInputStream;
    import java.io.StringReader;
    import java.io.StringWriter;
    import java.io.Writer;
    import java.net.HttpURLConnection;
    import java.net.MalformedURLException;
    import java.net.URL;
    import java.net.URLConnection;
    import java.security.Permission;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.ParserConfigurationException;
    import org.apache.xml.serialize.OutputFormat;
    import org.apache.xml.serialize.XMLSerializer;
    import org.w3c.css.sac.InputSource;
    import org.w3c.dom.Document;
    import org.w3c.dom.NodeList;
    import org.xml.sax.SAXException;
    public class WSCall2 {
    public WSCall2() {
    super();
    public static void main(String[] args) {
    try {
    WSCall2 ss = new WSCall2();
    System.out.println(ss.getWeather("Atlanta"));
    } catch (Exception e) {
    e.printStackTrace();
    public String getWeather(String city) throws MalformedURLException, IOException {
    //Code to make a webservice HTTP request
    String responseString = "";
    String outputString = "";
    String wsURL = "https://ewm52rdv:25100/Saws/SawsService";
    URL url = new URL(wsURL);
    URLConnection connection = url.openConnection();
    HttpURLConnection httpConn = (HttpURLConnection)connection;
    ByteArrayOutputStream bout = new ByteArrayOutputStream();
    //Permission p= httpConn.getPermission();
    String xmlInput =
    "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:ser=\"http://www.ventyx.com/ServiceSuite\">\n" +
    " <soapenv:Header>\n" +
    "     <soapenv:Security>\n" +
    " <soapenv:UsernameToken>\n" +
    " <soapenv:Username>sawsuser</soapenv:Username>\n" +
    " <soapenv:Password>sawsuser1</soapenv:Password>\n" +
    " </soapenv:UsernameToken>\n" +
    " </soapenv:Security>" + "</soapenv:Header>" + " <soapenv:Body>\n" +
    " <ser:GetUser>\n" +
    " <request><![CDATA[<?xml version=\"1.0\" encoding=\"UTF-8\"?> \n" +
                "                        <GetUser xmlns=\"http://www.ventyx.com/ServiceSuite\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n" +
                "                        <UserId>rs24363t</UserId>\n" +
                "                        </GetUser>]]>\n" +
    " </request>\n" +
    " </ser:GetUser>\n" +
    " </soapenv:Body>\n" +
    "</soapenv:Envelope>";
    byte[] buffer = new byte[xmlInput.length()];
    buffer = xmlInput.getBytes();
    bout.write(buffer);
    byte[] b = bout.toByteArray();
    String SOAPAction = "GetUser";
    // Set the appropriate HTTP parameters.
    httpConn.setRequestProperty("Content-Length", String.valueOf(b.length));
    httpConn.setRequestProperty("Content-Type", "text/xml; charset=utf-8");
    httpConn.setRequestProperty("SOAPAction", SOAPAction);
    // System.out.println( "opening service for [" + httpConn.getURL() + "]" );
    httpConn.setRequestMethod("POST");
    httpConn.setDoOutput(true);
    httpConn.setDoInput(true);
    OutputStream out = httpConn.getOutputStream();
    //Write the content of the request to the outputstream of the HTTP Connection.
    out.write(b);
    out.close();
    //Ready with sending the request.
    //Read the response.
    InputStreamReader isr = new InputStreamReader(httpConn.getInputStream());
    BufferedReader in = new BufferedReader(isr);
    //Write the SOAP message response to a String.
    while ((responseString = in.readLine()) != null) {
    outputString = outputString + responseString;
    //Parse the String output to a org.w3c.dom.Document and be able to reach every node with the org.w3c.dom API.
    Document document = parseXmlFile(outputString);
    NodeList nodeLst = document.getElementsByTagName("User");
    String weatherResult = nodeLst.item(0).getTextContent();
    System.out.println("Weather: " + weatherResult);
    //Write the SOAP message formatted to the console.
    String formattedSOAPResponse = formatXML(outputString);
    System.out.println(formattedSOAPResponse);
    return weatherResult;
    public String formatXML(String unformattedXml) {
    try {
    Document document = parseXmlFile(unformattedXml);
    OutputFormat format = new OutputFormat(document);
    format.setIndenting(true);
    format.setIndent(3);
    format.setOmitXMLDeclaration(true);
    Writer out = new StringWriter();
    XMLSerializer serializer = new XMLSerializer(out, format);
    serializer.serialize(document);
    return out.toString();
    } catch (IOException e) {
    throw new RuntimeException(e);
    private Document parseXmlFile(String in) {
    try {
    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    DocumentBuilder db = dbf.newDocumentBuilder();
    InputSource is = new InputSource(new StringReader(in));
    InputStream ins = new StringBufferInputStream(in);
    return db.parse(ins);
    } catch (ParserConfigurationException e) {
    throw new RuntimeException(e);
    } catch (SAXException e) {
    throw new RuntimeException(e);
    } catch (IOException e) {
    throw new RuntimeException(e);
    } catch (Exception e) {
    throw new RuntimeException(e);
    static {
    javax.net.ssl.HttpsURLConnection.setDefaultHostnameVerifier(new javax.net.ssl.HostnameVerifier() {
    public boolean verify(String hostname, javax.net.ssl.SSLSession sslSession) {
    if (hostname.equals("ewm52rdv")) {
    return true;
    return false;
    }

    Gayaz  wrote:
    What we are trying is we are invoking webservice by passing SOAP request and we will get soap response back.I understand what you're trying to do, the problem is with tools you're using it will take a while for you do anything a little away from the trivial... Using string concatenation and URL connection and HTTP post to call webservices is like to use a hand drill... It may work well to go through soft wood, but it will take a lot of effort against a concrete wall...
    JAX-WS and JAXB and annotations will do everything for you in a couple of lines and IMHO you will take longer to figure out how to do everything by hand than to learn those technologies... they are standard java, no need to add any additional jars...
    That's my thought, hope it helps...
    Cheers,
    Vlad

  • Adding GIF images to a stand-alone program

    To add a GIF image to an applet one can use the "getImage" function defined in the applet class.
    How do i add an image to a stand-alone program in java when one doesn't extend the Applet class ( and so one doesn't have access
    to the "getImage" procedure)
    I have just begun with Java so please reply in simple english and not in some hard-to-understand "Javian" crap!
    Thank u

    You mean a JFrame?
    import java.awt.*;
    import javax.swing.*;
    public class JFrameImage extends JFrame {
      public JFrameImage() {
          Container c    = getContentPane();
          JPanel panel = new JPanel(){
                 public void paintComponent(Graphics g)     {
    // puts an image on the whole program as background
                      ImageIcon img = new ImageIcon("myBackground.jpg");
                      g.drawImage(img.getImage(), 0, 0, null);
                      super.paintComponent(g);
            panel.setOpaque(false);
    // puts an image on the button
          ImageIcon icon = new ImageIcon("myButton.jpg");
          JButton button = new JButton(icon);
          panel.add(button);
          c.add(panel);
      public static void main(String[] args) {
        JFrameImage frame = new JFrameImage();
    // puts your own personal image on the frame itself
          Image onFrame = Toolkit.getDefaultToolkit().getImage("myIcon.gif") ;
        frame.setIconImage(onFrame);
        frame.setSize(200,200);
    // stops the thing looking sh*tty and amateurish by putting it nearer the middle
    // of the screen, instead of the default top left hand corner
        frame.setLocation(300,200);
        frame.setDefaultCloseOperation( EXIT_ON_CLOSE );
        frame.setVisible(true);
    }

  • Deploying Java stand alone application in Weblogic server

    Hi All,
    We have an java stand alone application which our client uses. Suddenly they came up with a requirement of using this application from web logic server.We have following directory structure for our application
    myapp
    - config -> contains all configuration files
    - logs -> contains log files
    - ssl -> ssl related files
    - samples ->contians stub's
    - myapp.jar
    How to deploy our standalone application in to weblogic server?.
    We tried putting whole myapp folder in WEB-INF folder , and from the servlet we are able to invoke an method in an class file( in myapp.jar say Test.getInstance()) but it couldnt find configuration files (in config folder ) and it is throwing an error. We have a class called Test in myapp.jar and when we call getInstance of the class it loads all config files - config file location is hardcoded as /config/myconfig.xml , and we are facing problem here because it couldnt find myconfig.xml.
    We also tried packaging whole myapp folder in to jar , but with that also we faced the same problem
    Please let us know are we proceeding in the right way and how to deploy our application in weblogic server.We dont prefer making changes to our code at this point of time.
    Any info on this will be very helpful to us.
    Regards,
    Suresh

    Hi René van Wijk,
    Thanks for quick reply. Link you mentioned gave a basic idea of application structure , but still i couldnt get deployment process.
    Am very much new to weblogic.Can you please let me know how to deploy our standalone application in to weblogic, with out making any changes to the code.
    Below is folder structure of my java stand alone application *( not webapplication)*
    myapp
    - config -> contains all configuration files , for ex:- myconfig.xml
    - logs -> contains log files
    - ssl -> ssl related files
    - samples ->contians stub's
    - myapp.jar
    We have logic to load configuration file (config/myconfig.xml) , in an class and we are not allowed to make any changes to this code, so we cant use Thread.currentThread().getContextClassLoader().getResource(...) .
    Regards,
    Suresh

  • Installing Java Stand alone Application on other PCs

    Dear All
    I am very new user to Java programming. I have recently finished developing basic Java Application that interacts with MySQL Database. The application does pretty standard database tranctions.
    Now i would like to install this finished appliction on other PCs as stand alone program (hope i am making myself clear here). Sort of I need to make an installation package that will install the Basic application and MySQL database on the the other PCS.
    Please desparetly help needed on this matter. I appreciate all your inputs Thank you.

    it would be much much easier if you weren't using MySQL to be honest. if you used a pure-java database such as Hypersonic, the database could just be bun dled as a bean with your application.

  • PROBLEM IN ALE/IDOCS  USING STAND-ALONE PROGRAM AND CHANGE-POINTER.

    Hi All,
      Recently i have joined a company where i have to work on ALE/IDocs , So for this i need some help, Actually i need to know the complete senerio of this, I know some configuration part but after this what i want to know is the coding part
    of it.
    IN STAND-ALONE PROGRAM..
      I NEED TO EXTEND AN IDOCS WITH ADDING FEW MMORE FEILDS, SO IN   
      THAT CASE WHAT ALL THE THINGS I HAVE TO DO..
    IN MESSAGE CONTROL ..
       I NEED TO EXTEND AN IDOCS WITH ADDING FEW MORE FEILDS, SO IN 
       THAT CASE WHAT ALL THE THINGS I HAVE TO DO..??

    Hi,
    please have a look at
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/78/217d6851ce11d189570000e829fbbd/frameset.htm
    Hope this helps.
    Regards
    Bernd

  • Stand alone program

    hi all
    plz send the code for a stand alone program for idocs
    mesg type:isu_mr_upload
    basic type:isu_mr_upload01
    process code:ismr
    reciever port:sapect
    reciver parnter no:aio
    reciver partner type:ls
    reciever type:ls
    sender port:zdump
    sender partner no:aio
    sender partner type:ls
    sender type:ls
    plz send the stand alone program.....
    its very ugent help me out..the answer will be rewarded..

    hi all
    plz send the code for a stand alone program for idocs
    mesg type:isu_mr_upload
    basic type:isu_mr_upload01
    process code:ismr
    reciever port:sapect
    reciver parnter no:aio
    reciver partner type:ls
    reciever type:ls
    sender port:zdump
    sender partner no:aio
    sender partner type:ls
    sender type:ls
    plz send the stand alone program.....
    its very ugent help me out..the answer will be rewarded..

  • Timezone Settings for Java Stand alone system

    Hi,
    I want to know the timezone settings that have been set for any Java stand alone system.
    Can anyone help me how to check the timezone settings at Java Stack?
    Incase if I want to change the timezone,which property do I need to change?
    Thank You.
    Regards,
    Sudheer.
    Moderator message - Moved to a less wrong forum
    Edited by: Rob Burbank on Jun 17, 2009 9:05 AM

    You can check it in at the end of System information page in Index.html page.

  • Muse as a stand alone program

    Hey Adobe, where I teach the university pays for CS 6 Master Suite for all the instructors. I used Muse when it was beta and looked forward to buying it when it came out because my university doesn't plan on using the program for instruction. But YOU will only let people use it if we pay for Cloud access for ALL your programs.
    Using Muse only through Cloud, instead of also selling it as a stand alone program is just plan stupid. Makes no sense to me. Rediculous to have to pay for all the services of Cloud when I only want Muse. Get it. I have the Master Suites. I don't need Cloud. I just want Muse.
    Please release Muse as a stand alone produce just like your other programs. I'd be happy to pay for it. I loved the beta version.
    Frustrated.
    Walt Calahan

    Walter Calahan wrote:
    I'd still like the option of buying the program as a stand alone.
    That definitely won't happen.
    Muse was aways going to be subscription only and I suspect Adobe's entire software delivery will go that way sooner rather than later once they've established a viable, sustainable business model.
    http://www.adobe.com/products/muse/faq.html
    Why is Adobe Muse sold only by subscription?
    Adobe Muse is sold only by subscription because it will allow the Adobe Muse team to improve the product more quickly and be more responsive to your needs. New features will be made available when they're ready, likely to be released on a quarterly basis. This will allow us to stay on top of browser and device compatibility issues and web design trends and standards, as well as allow us to respond to feature requests and market changes in a timely fashion.
    Walter Calahan wrote:
    I see the two options for pricing, but the Adobe page continues to have a "Buy" button for a totally different price then the two listed.
    Not sure what you mean. Can you elaborate?

  • Problem while calling a Webservice from a Stand alone java program

    Hello Everyone,
    I am using a java program to call a webservice as follows. For this I have generated the client proxy definition for Stand alone proxy using NWDS.
    Now when I call the method of the webservice I am getting the correct result but along with the result I am getting one error and one warning message in the output.
    The java code to call the webservice is as follows.
    public class ZMATRDESCProxyClient {
         public static void main(String[] args) throws Exception {
              Z_MATRDESC_WSDService ws = new Z_MATRDESC_WSDServiceImpl();
              Z_MATRDESC_WSD port = (Z_MATRDESC_WSD)ws.getLogicalPort("Z_MATRDESC_WSDSoapBinding",Z_MATRDESC_WSD.class);
              String res = port.zXiTestGetMatrDesc("ABCD134");
              System.out.print(res);
    The result I am getting is :
    Warning ! Protocol Implementation [com.sap.engine.services.webservices.jaxrpc.wsdl2java.features.builtin.MessageIdProtocol] could not be loaded (NoClassDefFoundError) !
    Error Message is :com/sap/guid/GUIDGeneratorFactory
    <b>Material Not Found</b> -
    > This is the output of webservice method and it is right.
    Can any one please let me know why I am getting the warning and error message and how can I fix this.
    Thanks
    Abinash

    Hi Abinash,
    I have the same problem. Have you solve that problem?
    I am using a java program to call a webservice too. And I have generated the client proxy definition for Stand alone proxy using NWDS. When I call the method of the webservice I am getting the correct result but along with the result I am getting one error and one warning message in the output.
    The java code to call the webservice is as follows.
    MIDadosPessoaisSyncService service = new MIDadosPessoaisSyncServiceImpl();
    MIDadosPessoaisSync port = service.getLogicalPort("MIDadosPessoaisSyncPort");
    port._setProperty("javax.xml.rpc.security.auth.username","xpto");
    port._setProperty("javax.xml.rpc.security.auth.password","xpto");
    String out = port.MIDadosPessoaisSync("xpto", "xpto");
    System.out.println(out);
    The result I am getting is :
    Warning ! Protocol Implementation [com.sap.engine.services.webservices.jaxrpc.wsdl2java.features.builtin.MessageIdProtocol] could not be loaded (NoClassDefFoundError) !
    Error Message is :com/sap/guid/GUIDGeneratorFactory
    <b>The result of the WS is correct!!!</b>
    The Java project does not have any warning. But the stand alone proxy project has following warnings associated with it.
    This method has a constructor name     MIDadosPessoaisSync.java     
    The import javax.xml.rpc.holders is never used     MIDadosPessoaisSyncBindingStub.java     
    The import javax.xml.rpc.encoding is never used     MIDadosPessoaisSyncBindingStub.java     
    The constructor BaseRuntimeException(ResourceAccessor, String, Throwable) is deprecated     MIDadosPessoaisSyncBindingStub.java
    It is very similar with your problem, could you help me?
    Thanks
    Gustavo Freitas

  • 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.

  • 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.

Maybe you are looking for