Call Client Java Proxy from Server Java Proxy

Hi Gurus!!
I'm trying to call a Client Java Proxy from a Server Java Proxy.
Is possible to do this? I think must be possible.
I have called this Client Java Proxy from another application, and run ok.
I have tried to call it following the Guide to call Java Client Proxies:
                es.navantia.xi.mm.dispositivosRobotizadosKasto.MIRobotOut_PortTypeHome queryOutHome = null;
                es.navantia.xi.mm.dispositivosRobotizadosKasto.MIRobotOut_PortTypeRemote queryOutRemote = null;                     
                try {
                     //      Get naming context
                     Properties p = new Properties();
                     p.put(
                          Context.INITIAL_CONTEXT_FACTORY,
                          "com.sap.engine.services.jndi.InitialContextFactoryImpl");
                     p.put(Context.PROVIDER_URL, "myurl:50104");
                     p.put(Context.SECURITY_PRINCIPAL, "MMIGUEZ");
                     p.put(Context.SECURITY_CREDENTIALS, mypasswrod);
                     Context ctx = new InitialContext(p);
                     Object ref = ctx.lookup("RobotOut");
                     //      Look up jndi name of proxy bean
                    try {
                     queryOutHome =
                          (MIRobotOut_PortTypeHome) PortableRemoteObject.narrow(
                               ref,
                               MIRobotOut_PortTypeHome.class);
                    } catch (Exception e) {
                         throw new RuntimeException(e + "1");
                     //        Get Remote interface
                     queryOutRemote = queryOutHome.create();
                } catch (Exception e) {
                    throw new RuntimeException(e + "2");
but I get this error
"com.sap.aii.af.ra.ms.api.DeliveryException: Error invoking method mIRobotIn of proxy bean $Proxy351: es.navantia.xi.mm.dispositivosRobotizadosKasto.MIRobotOut_PortTypeHome: com.sap.aii.proxy.xiruntime.core.XmlInboundException: Error invoking method mIRobotIn of proxy bean $Proxy351: es.navantia.xi.mm.dispositivosRobotizadosKasto.MIRobotOut_PortTypeHome"
es.navantia.xi.mm.dispositivosRobotizadosKasto.MIRobotOut_PortTypeHome is the corresponding PortTypeHome to the Client Java Proxy.
I have tried to call too calling directly from the server Java Proxy to the method correcponding to the Client Java Proxy. The error I get is:
"com.sap.aii.af.ra.ms.api.DeliveryException: Error invoking method mIRobotIn of proxy bean $Proxy351: es/navantia/xi/mm/dispositivosRobotizadosKasto/DTRobot_Type: com.sap.aii.proxy.xiruntime.core.XmlInboundException: Error invoking method mIRobotIn of proxy bean $Proxy351: es/navantia/xi/mm/dispositivosRobotizadosKasto/DTRobot_Type"
Tha call to the client is:
es.navantia.xi.mm.dispositivosRobotizadosKasto.MIRobotOut_PortType clase = null;
es.navantia.xi.mm.dispositivosRobotizadosKasto.DTRobot_Type client_req = null;
es.navantia.xi.mm.dispositivosRobotizadosKasto.DTRobotResponse_Type client_res = null;
client_res = clase.mIRobotOut(client_req);
Please, any help will be useful.
Thanks and regards,
Manuel Míguez.

Hi,
Now I get another error message:
com.sap.aii.af.ra.ms.api.DeliveryException: Error invoking method mIRobotIn of proxy bean $Proxy351: es/navantia/xi/mm/dispositivosRobotizadosKasto/MITextoOut_PortTypeRemote: com.sap.aii.proxy.xiruntime.core.XmlInboundException: Error invoking method mIRobotIn of proxy bean $Proxy351: es/navantia/xi/mm/dispositivosRobotizadosKasto/MITextoOut_PortTypeRemote
Now, my source is:
  MITextoOut_PortTypeHome queryOutHome = null;
  MITextoOut_PortTypeRemote queryOutRemote = null;
  try {
//     Get naming context
Context ctx = new InitialContext();
//     Look up the EJB name in the environment
Object ref = ctx.lookup("java:comp/env/ejb/TextoOut");
// Object ref = ctx.lookup("java:comp/env/ejb/MITextoOut_PortTypeBean");
//     Cast to Home interface
     queryOutHome = (MITextoOut_PortTypeHome)
PortableRemoteObject.narrow(ref,
MITextoOut_PortTypeHome.class);
//     Get Remote interface
queryOutRemote = queryOutHome.create();
} catch (Exception e) {
System.out.println("RemoteException occurred: "+e.getMessage());
e.printStackTrace();
//return;
try {
      queryOutRemote.$messageSpecifier();
} catch (RemoteException e2) {
      // TODO Auto-generated catch block
      e2.printStackTrace();
DTTexto_Type Texto_type = new DTTexto_Type();
Texto_type.setTexto(req_texto);
DTTextoResponse_Type Texto_response = new DTTextoResponse_Type();
try {
     Texto_response = queryOutRemote.mITextoOut(Texto_type);
} catch (SystemFaultException e1) {
      // TODO Auto-generated catch block
      e1.printStackTrace();
} catch (ApplicationFaultException e1) {
      // TODO Auto-generated catch block
      e1.printStackTrace();
} catch (RemoteException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
I have tryed removing queryOutRemote.$messageSpecifier() and I get the error:
com.sap.aii.af.ra.ms.api.DeliveryException: Error invoking method mIRobotIn of proxy bean $Proxy351: es/navantia/xi/mm/dispositivosRobotizadosKasto/DTTexto_Type: com.sap.aii.proxy.xiruntime.core.XmlInboundException: Error invoking method mIRobotIn of proxy bean $Proxy351: es/navantia/xi/mm/dispositivosRobotizadosKasto/DTTexto_Type
Somebody knows what could be the cause of these errors?
Thanks and regards,
Manuel.

Similar Messages

  • [OSB] Calling a secured proxy from another secured proxy

    Hi,
    I would like to call a secured proxy from another secured proxy. However, the call fails.
    I'm making a call from a Java stand alone Web Service client. The client uses policy "oracle/wss11_message_protection_client_policy".
    The call is made to a proxy secured with a "oracle/wss11_x509_token_with_message_protection_service_policy". The secured proxy routes to a non secured proxy, which does not process WSS Security Header. The non-secured proxy then routes to a non-secured business service. The call is a success.
    Then I add a policy to the second proxy, say "oracle/log_policy". Also I set the value of "Process WS-Security Header" to yes. The call fails.
    I'm getting
    java.lang.NullPointerException
         at oracle.wsm.agent.handler.WSMEngineInvoker.createWsmMessageContextFromInvokerContext(WSMEngineInvoker.java:733)
    in the osb logs.
    I have tried adding an empty WSS Security Header in the Soa headers before calling the second proxy. It didn't change anything.
    Do you have any ideas?
    I have also came up with a super simplified sitution when this error comes up. This happens when I'm calling a pass through proxy (no policy, process WSS security header set to no). Then when this proxy calls a secured proxy with "oracle/log_policy", the call results in this error. Why??
    Here is the OSB output when the problem occurs:
    ####<2011-11-21 13:00:46 CET> <Info> <OSB Kernel> <myLaptop> <osb_server1> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <0add29b7d176a5e4:5215cc49:133c5a81e20:-7ff4-0000000000000cb7> <1321876846831> <BEA-398077> <
    [OSB Tracing] Entering proxy MyProject/ProxyServices/MyFirstProxyService with message context:
    [MessageContextImpl  body="<soapenv:Body xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"/>"
    operation="null"
    attachments="<con:attachments xmlns:con="http://www.bea.com/wli/sb/context"/>"
    outbound="null"
    fault="null"
    inbound="<con:endpoint name="ProxyService$MyProject$ProxyServices$MyFirstProxyService" xmlns:con="http://www.bea.com/wli/sb/context">
      <con:service/>
      <con:transport/>
      <con:security/>
    </con:endpoint>"
    header="<soapenv:Header xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"/>"
    ]>
    ####<2011-11-21 13:00:46 CET> <Info> <OSB Kernel> <myLaptop> <osb_server1> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <0add29b7d176a5e4:5215cc49:133c5a81e20:-7ff4-0000000000000cb7> <1321876846832> <BEA-398200> <
    [OSB Tracing] Inbound request was received.
    Service Ref = MyProject/ProxyServices/MyFirstProxyService
    URI = /MyProject/ProxyServices/MyFirstProxyService
    Message ID = 3657493765399211266-5215cc49.133c5a81e20.-7f81
    Request metadata =
    <xml-fragment>
    <tran:headers xsi:type="http:HttpRequestHeaders" xmlns:http="http://www.bea.com/wli/sb/transports/http" xmlns:tran="http://www.bea.com/wli/sb/transports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <http:Accept>text/xml, multipart/related, text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2</http:Accept>
    <http:Connection>keep-alive</http:Connection>
    <http:Content-Length>7614</http:Content-Length>
    <http:Content-Type>text/xml;charset="utf-8"</http:Content-Type>
    <http:Host>myLaptop:8011</http:Host>
    <http:SOAPAction>"execute"</http:SOAPAction>
    <http:User-Agent>Oracle JAX-WS 2.1.5</http:User-Agent>
    </tran:headers>
    <tran:encoding xmlns:tran="http://www.bea.com/wli/sb/transports">utf-8</tran:encoding>
    <http:client-host xmlns:http="http://www.bea.com/wli/sb/transports/http">myLaptop</http:client-host>
    <http:client-address xmlns:http="http://www.bea.com/wli/sb/transports/http">192.168.148.155</http:client-address>
    <http:http-method xmlns:http="http://www.bea.com/wli/sb/transports/http">POST</http:http-method>
    </xml-fragment>
    Payload =
    <?xml version='1.0' encoding='UTF-8'?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"><S:Header><wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" S:mustUnderstand="1"><wsu:Timestamp xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="Timestamp-Tt0jQKXTNFAd6lUGgmYuPA22"><wsu:Created>2011-11-21T12:00:46Z</wsu:Created><wsu:Expires>2011-11-21T20:00:46Z</wsu:Expires></wsu:Timestamp><wsse:BinarySecurityToken xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v1" wsu:Id="BST-q10SkWxeoYTKKaeyCSmomA22">MIICpDCCAYwCAQcwDQYJKoZIhvcNAQEEBQAwdDELMAkGA1UEBhMCUEwxFDASBgNVBAgTC01hem93aWVja2llMQ8wDQYDVQQHEwZXYXJzYXcxETAPBgNVBAoTCGluNG1hdGVzMQswCQYDVQQDEwJDQTEeMBwGCSqGSIb3DQEJARYPY2FAaW40bWF0ZXMuY29tMB4XDTExMTExODEyMzgyN1oXDTEyMTExNzEyMzgyN1owQDELMAkGA1UEBhMCUEwxDzANBgNVBAcTBldhcnNhdzERMA8GA1UEChMISW40bWF0ZXMxDTALBgNVBAMTBGFwcGEwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAJdFSnlREuzVIQKvmzcD6YCgzvvshHXGG6MQJtM8HvkYUcwEP7xIn1TYfD/A6J6+lIpxa7SBqQ2PO/Y4OCSeOJDbhm2bkwLWPWlcy1CCxfQcup/ylrkWVO5EYT+5dg+LxBcHAzh4trzICvy8Qxw81AsEVsy0O6un6qanx8/gcNWXAgMBAAEwDQYJKoZIhvcNAQEEBQADggEBADqMZWnIeOPhycUE4S5zaFp50cYMR/0wb89k0iOTD/k3Fmy4SHqpvmx3AJQ1vBrlP6z7TyycOTA7yVUXDfy6xdLWg26W+5SdQNCv/vf1OIS2cwIXrxcUgrOs4TNmdubzSqO6WCQCngUz+oGQbAqRr/gmiYukT7oW7DmsXKMdsd9vI9gHSqpy3kGrqvTOO3MYkS50xdS59aKoMA9OYKbBp3sjCGJT7h5pytTARH6BfPuKNR+r6bUZ6sq3BScY7umjVO3egkDGqAD/PFI5UCSi3qic2cfHQn1+nnME7AJ2zqEGTKD5ASevZE95ndkFVqZt6YFNQ9SHf6Jx4jNC5FSFCaI=</wsse:BinarySecurityToken><xenc:EncryptedKey xmlns:xenc="http://www.w3.org/2001/04/xmlenc#" Id="EK-N74ve0QpUQxEpFgJc9YR0A22"><xenc:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p"><dsig:DigestMethod xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/></xenc:EncryptionMethod><dsig:KeyInfo xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"><wsse:SecurityTokenReference xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"><wsse:KeyIdentifier xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary" ValueType="http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#ThumbprintSHA1">rbWc2O0Y7yBBsPYkcHOgqxuF3t4=</wsse:KeyIdentifier></wsse:SecurityTokenReference></dsig:KeyInfo><xenc:CipherData><xenc:CipherValue>RGltJV8OQehqBg9EDaae0SO1lH1zBrlrn3/JwSljOPzwwFum9zCzFsu8Gpz05Q9R+Yaz2QXMDpghYuDvcomqDmkANYBrmIQHKKyWCCu8xvGF78jcwEp+RS+e3oy9suejGwUViYGlU4zkIRpGba6xjdkAQsRkX1mWRYMQvrfs/cM=</xenc:CipherValue></xenc:CipherData><xenc:ReferenceList><xenc:DataReference URI="#_igoSptS7UdOzwe4gYy18qg22"/></xenc:ReferenceList></xenc:EncryptedKey><dsig:Signature xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"><dsig:SignedInfo><dsig:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/><dsig:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/><dsig:Reference URI="#BST-q10SkWxeoYTKKaeyCSmomA22"><dsig:Transforms><dsig:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/></dsig:Transforms><dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><dsig:DigestValue>GBpMSv85l75tSIZDG9WiKp3rHvM=</dsig:DigestValue></dsig:Reference><dsig:Reference URI="#XSIG-eKzAOdtEBafB7pzBx01wMw22"><dsig:Transforms><dsig:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/></dsig:Transforms><dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><dsig:DigestValue>mEMP/yHb3k474vnbgn3IBvhJqZM=</dsig:DigestValue></dsig:Reference></dsig:SignedInfo><dsig:SignatureValue>ELM50yvmDvJzIH/jpId3LSae1cCtboFau5I4Z8Cws+vZU6JD994hRnaWIFqxxK5vVVIUVu9mKg9+p/QJp8g7SMvhOYBIqRsHKY/2vKGZ36BrcUSXOofDNwV7l9QUzWw0dyV51N/pHX7+PTF9whPgZh48SXdpmU6MV0UkPCXAixA=</dsig:SignatureValue><dsig:KeyInfo xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" Id="KeyInfo-SLUCjT2uaAlI9n0spmTgnw22"><wsse:SecurityTokenReference xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"><wsse:Reference xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" URI="#BST-q10SkWxeoYTKKaeyCSmomA22" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v1"/></wsse:SecurityTokenReference></dsig:KeyInfo></dsig:Signature><dsig:Signature xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" Id="XSIG-eKzAOdtEBafB7pzBx01wMw22"><dsig:SignedInfo><dsig:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/><dsig:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#hmac-sha1"/><dsig:Reference URI="#Timestamp-Tt0jQKXTNFAd6lUGgmYuPA22"><dsig:Transforms><dsig:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/></dsig:Transforms><dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><dsig:DigestValue>AliE9el9Dmmw3U5W69/zn6QVZEo=</dsig:DigestValue></dsig:Reference><dsig:Reference URI="#Body-ogLysWiLTgk5UjAaaIhIvg22"><dsig:Transforms><dsig:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/></dsig:Transforms><dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><dsig:DigestValue>wJaIENiwWQg/B2MW6Q0xdLAzCRM=</dsig:DigestValue></dsig:Reference></dsig:SignedInfo><dsig:SignatureValue>4k1bNpdK7AaAk296wzFi63dRgwA=</dsig:SignatureValue><dsig:KeyInfo xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"><wsse:SecurityTokenReference xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"><wsse:Reference xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" URI="#EK-N74ve0QpUQxEpFgJc9YR0A22" ValueType="http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#EncryptedKey"/></wsse:SecurityTokenReference></dsig:KeyInfo></dsig:Signature></wsse:Security></S:Header><S:Body xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="Body-ogLysWiLTgk5UjAaaIhIvg22"><xenc:EncryptedData xmlns:xenc="http://www.w3.org/2001/04/xmlenc#" Id="_igoSptS7UdOzwe4gYy18qg22" Type="http://www.w3.org/2001/04/xmlenc#Content"><xenc:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes128-cbc"/><dsig:KeyInfo xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"><wsse:SecurityTokenReference xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"><wsse:Reference xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" URI="#EK-N74ve0QpUQxEpFgJc9YR0A22" ValueType="http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#EncryptedKey"/></wsse:SecurityTokenReference></dsig:KeyInfo><xenc:CipherData><xenc:CipherValue>vcPRlrky4U7GunHF3pYWFCGrEofmAecajIXIT1+YgBdIJTb8gt7g0GMZyBXGqu29WY+rQajArCajet+pTUeKkUHA3qi9oRmL8wEJkFM858fAyejzxeBWDPBI9C1sjcf+OKGAP4jr3nQzSfzl58d8IhH2uT0uUHD3h/i1pcQuSI/sXAgBb+YblR4+SwQJ6LLBHMTyuymEngoY4KVyI3UYMqePQQQjmD0dXt87Ld1xAOXgWhWRTrnoc48Nq85HQf0qWLyrdXIq9MvXeKc0CDmbLMdKUFWaGdTdNaTNH2iBM5ZEtk4qO4hbJFVU3zczKUhyYa+JzBFi0NCMHKnKCpF2TQ==</xenc:CipherValue></xenc:CipherData></xenc:EncryptedData></S:Body></S:Envelope>
    >
    ####<2011-11-21 13:00:46 CET> <Debug> <AlsbSecurityWss> <myLaptop> <osb_server1> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <0add29b7d176a5e4:5215cc49:133c5a81e20:-7ff4-0000000000000cb7> <1321876846832> <BEA-000000> <WssHandlerImpl.doInboundRequest>
    ####<2011-11-21 13:00:46 CET> <Debug> <AlsbSecurityWss> <myLaptop> <osb_server1> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <0add29b7d176a5e4:5215cc49:133c5a81e20:-7ff4-0000000000000cb7> <1321876846833> <BEA-000000> <WsmInboundHandler.processRequest>
    ####<2011-11-21 13:00:46 CET> <Debug> <AlsbSecurityWss> <myLaptop> <osb_server1> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <0add29b7d176a5e4:5215cc49:133c5a81e20:-7ff4-0000000000000cb7> <1321876846833> <BEA-000000> <Got SOAP Message Factory from the Provider: oracle.j2ee.ws.saaj.soap.MessageFactoryImpl@1a99544>
    ####<2011-11-21 13:00:46 CET> <Debug> <AlsbSecurityWss> <myLaptop> <osb_server1> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <0add29b7d176a5e4:5215cc49:133c5a81e20:-7ff4-0000000000000cb7> <1321876846834> <BEA-000000> <WsmInboundHandler.processRequest()->WSMMessageContext[oracle.integration.platform.request.processed.headers]=[]>
    ####<2011-11-21 13:00:46 CET> <Debug> <AlsbSecurityWss> <myLaptop> <osb_server1> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <0add29b7d176a5e4:5215cc49:133c5a81e20:-7ff4-0000000000000cb7> <1321876846834> <BEA-000000> <WsmInboundHandler.processRequest()->WSMMessageContext[com.bea.contextelement.alsb.router.inbound.request.metadata.http.client-host]=myLaptop>
    ####<2011-11-21 13:00:46 CET> <Debug> <AlsbSecurityWss> <myLaptop> <osb_server1> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <0add29b7d176a5e4:5215cc49:133c5a81e20:-7ff4-0000000000000cb7> <1321876846834> <BEA-000000> <WsmInboundHandler.processRequest()->WSMMessageContext[com.bea.contextelement.alsb.router.inbound.request.MessageId]=3657493765399211266-5215cc49.133c5a81e20.-7f81>
    ####<2011-11-21 13:00:46 CET> <Debug> <AlsbSecurityWss> <myLaptop> <osb_server1> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <0add29b7d176a5e4:5215cc49:133c5a81e20:-7ff4-0000000000000cb7> <1321876846834> <BEA-000000> <WsmInboundHandler.processRequest()->WSMMessageContext[com.bea.contextelement.alsb.router.inbound.request.CharacterEncoding]=utf-8>
    ####<2011-11-21 13:00:46 CET> <Debug> <AlsbSecurityWss> <myLaptop> <osb_server1> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <0add29b7d176a5e4:5215cc49:133c5a81e20:-7ff4-0000000000000cb7> <1321876846834> <BEA-000000> <WsmInboundHandler.processRequest()->WSMMessageContext[com.bea.contextelement.alsb.router.inbound.TransportProvider]=http>
    ####<2011-11-21 13:00:46 CET> <Debug> <AlsbSecurityWss> <myLaptop> <osb_server1> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <0add29b7d176a5e4:5215cc49:133c5a81e20:-7ff4-0000000000000cb7> <1321876846834> <BEA-000000> <WsmInboundHandler.processRequest()->WSMMessageContext[com.bea.contextelement.alsb.router.ServiceVersion]=-8022206267159469084>
    ####<2011-11-21 13:00:46 CET> <Debug> <AlsbSecurityWss> <myLaptop> <osb_server1> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <0add29b7d176a5e4:5215cc49:133c5a81e20:-7ff4-0000000000000cb7> <1321876846835> <BEA-000000> <WsmInboundHandler.processRequest()->WSMMessageContext[com.bea.contextelement.alsb.router.inbound.request.headers.http.Content-Type]=text/xml;charset="utf-8">
    ####<2011-11-21 13:00:46 CET> <Debug> <AlsbSecurityWss> <myLaptop> <osb_server1> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <0add29b7d176a5e4:5215cc49:133c5a81e20:-7ff4-0000000000000cb7> <1321876846835> <BEA-000000> <WsmInboundHandler.processRequest()->WSMMessageContext[com.bea.contextelement.alsb.router.ServiceUri]=/MyProject/ProxyServices/MyFirstProxyService>
    ####<2011-11-21 13:00:46 CET> <Debug> <AlsbSecurityWss> <myLaptop> <osb_server1> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <0add29b7d176a5e4:5215cc49:133c5a81e20:-7ff4-0000000000000cb7> <1321876846835> <BEA-000000> <WsmInboundHandler.processRequest()->WSMMessageContext[com.bea.contextelement.alsb.router.inbound.request.metadata.http.client-address]=192.168.148.155>
    ####<2011-11-21 13:00:46 CET> <Debug> <AlsbSecurityWss> <myLaptop> <osb_server1> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <0add29b7d176a5e4:5215cc49:133c5a81e20:-7ff4-0000000000000cb7> <1321876846835> <BEA-000000> <WsmInboundHandler.processRequest()->WSMMessageContext[com.bea.contextelement.alsb.router.ProxyService]=MyProject/ProxyServices/MyFirstProxyService>
    ####<2011-11-21 13:00:46 CET> <Debug> <AlsbSecurityWss> <myLaptop> <osb_server1> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <0add29b7d176a5e4:5215cc49:133c5a81e20:-7ff4-0000000000000cb7> <1321876846835> <BEA-000000> <WsmInboundHandler.processRequest()->WSMMessageContext[com.bea.contextelement.alsb.router.inbound.request.headers.http.SOAPAction]="execute">
    ####<2011-11-21 13:00:46 CET> <Debug> <AlsbSecurityWss> <myLaptop> <osb_server1> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <0add29b7d176a5e4:5215cc49:133c5a81e20:-7ff4-0000000000000cb7> <1321876846835> <BEA-000000> <WsmInboundHandler.processRequest()->WSMMessageContext[com.bea.contextelement.alsb.router.inbound.MessagePattern]=SYNCHRONOUS>
    ####<2011-11-21 13:00:46 CET> <Debug> <AlsbSecurityWss> <myLaptop> <osb_server1> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <0add29b7d176a5e4:5215cc49:133c5a81e20:-7ff4-0000000000000cb7> <1321876846835> <BEA-000000> <WsmInboundHandler.processRequest()->WSMMessageContext[com.bea.contextelement.wli.Message]=org.apache.xmlbeans.impl.store.Saver$InputStreamSaver@211082>
    ####<2011-11-21 13:00:46 CET> <Debug> <AlsbSecurityWss> <myLaptop> <osb_server1> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <0add29b7d176a5e4:5215cc49:133c5a81e20:-7ff4-0000000000000cb7> <1321876846835> <BEA-000000> <WsmInboundHandler.processRequest()->WSMMessageContext[com.bea.contextelement.alsb.router.inbound.IsTransactional]=false>
    ####<2011-11-21 13:00:46 CET> <Debug> <AlsbSecurityWss> <myLaptop> <osb_server1> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <0add29b7d176a5e4:5215cc49:133c5a81e20:-7ff4-0000000000000cb7> <1321876846835> <BEA-000000> <invoking WSM Engine's handleRequest()...>
    ####<2011-11-21 13:00:46 CET> <Debug> <AlsbSecurityWss> <myLaptop> <osb_server1> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <0add29b7d176a5e4:5215cc49:133c5a81e20:-7ff4-0000000000000cb7> <1321876846856> <BEA-000000> <storing the new message in the router message context>
    ####<2011-11-21 13:00:46 CET> <Debug> <AlsbSecurityWss> <myLaptop> <osb_server1> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <0add29b7d176a5e4:5215cc49:133c5a81e20:-7ff4-0000000000000cb7> <1321876846856> <BEA-000000> <getting subject out of WSSecurityContext>
    ####<2011-11-21 13:00:46 CET> <Debug> <AlsbSecurityWss> <myLaptop> <osb_server1> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <0add29b7d176a5e4:5215cc49:133c5a81e20:-7ff4-0000000000000cb7> <1321876846856> <BEA-000000> <doing message-level access control (wss-active-intermediary: true; has-custom-message-level-authentication: false)>
    ####<2011-11-21 13:00:46 CET> <Debug> <AlsbSecurityWss> <myLaptop> <osb_server1> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <0add29b7d176a5e4:5215cc49:133c5a81e20:-7ff4-0000000000000cb7> <1321876846857> <BEA-000000> <calling isAccessAllowed; resource: 'type=<alsb-proxy-service>, path=MyProject/ProxyServices, proxy=MyFirstProxyService, action=wss-invoke, operation=execute', Subject: 1
         Principal = class weblogic.security.principal.WLSUserImpl("myPrincipal")
    >
    ####<2011-11-21 13:00:46 CET> <Info> <OSB Security> <myLaptop> <osb_server1> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <0add29b7d176a5e4:5215cc49:133c5a81e20:-7ff4-0000000000000cb7> <1321876846857> <BEA-387027> <Message-level access control policy grants access to proxy "MyProject/ProxyServices/MyFirstProxyService", operation "execute", message-id: 3657493765399211266-5215cc49.133c5a81e20.-7f81, subject: Subject: 1
         Principal = class weblogic.security.principal.WLSUserImpl("myPrincipal")
    .>
    ####<2011-11-21 13:00:46 CET> <Info> <OSB Kernel> <myLaptop> <osb_server1> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <0add29b7d176a5e4:5215cc49:133c5a81e20:-7ff4-0000000000000cb7> <1321876846858> <BEA-398078> <
    [OSB Tracing] Entering route node RouteToMySecondProxyService with message context:
    [MessageContextImpl  body="<S:Body wsu:Id="Body-ogLysWiLTgk5UjAaaIhIvg22" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
      <processRequest xmlns="http://www.in4mates.com/targetNamespace"/>
    </S:Body>"
    operation="execute"
    messageID="3657493765399211266-5215cc49.133c5a81e20.-7f81"
    attachments="<con:attachments xmlns:con="http://www.bea.com/wli/sb/context"/>"
    outbound="null"
    fault="null"
    inbound="<con:endpoint name="ProxyService$MyProject$ProxyServices$MyFirstProxyService" xmlns:con="http://www.bea.com/wli/sb/context">
      <con:service>
        <con:operation>execute</con:operation>
      </con:service>
      <con:transport>
        <con:uri>/MyProject/ProxyServices/MyFirstProxyService</con:uri>
        <con:mode>request-response</con:mode>
        <con:qualityOfService>best-effort</con:qualityOfService>
        <con:request xsi:type="http:HttpRequestMetaData" xmlns:http="http://www.bea.com/wli/sb/transports/http" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
          <tran:headers xsi:type="http:HttpRequestHeaders" xmlns:tran="http://www.bea.com/wli/sb/transports">
            <http:Accept>text/xml, multipart/related, text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2</http:Accept>
            <http:Connection>keep-alive</http:Connection>
            <http:Content-Length>7614</http:Content-Length>
            <http:Content-Type>text/xml;charset="utf-8"</http:Content-Type>
            <http:Host>myLaptop:8011</http:Host>
            <http:SOAPAction>"execute"</http:SOAPAction>
            <http:User-Agent>Oracle JAX-WS 2.1.5</http:User-Agent>
          </tran:headers>
          <tran:encoding xmlns:tran="http://www.bea.com/wli/sb/transports">utf-8</tran:encoding>
          <http:client-host>myLaptop</http:client-host>
          <http:client-address>192.168.148.155</http:client-address>
          <http:http-method>POST</http:http-method>
        </con:request>
        <con:response xsi:type="http:HttpResponseMetaData" xmlns:http="http://www.bea.com/wli/sb/transports/http" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
          <tran:headers xsi:type="http:HttpResponseHeaders" xmlns:tran="http://www.bea.com/wli/sb/transports">
            <http:Content-Type>text/xml</http:Content-Type>
          </tran:headers>
          <tran:response-code xmlns:tran="http://www.bea.com/wli/sb/transports">0</tran:response-code>
        </con:response>
      </con:transport>
      <con:security>
        <con:transportClient>
          <con:username>&lt;anonymous></con:username>
        </con:transportClient>
        <con:messageLevelClient>
          <con:username>myPrincipal</con:username>
        </con:messageLevelClient>
      </con:security>
    </con:endpoint>"
    header="<S:Header xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"/>"
    ]>
    Edited by: user13604541 on Nov 21, 2011 4:27 AM

    This is the rest of log:
    ####<2011-11-21 13:00:46 CET> <Info> <OSB Kernel> <myLaptop> <osb_server1> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <0add29b7d176a5e4:5215cc49:133c5a81e20:-7ff4-0000000000000cb7> <1321876846860> <BEA-398072> <
    [OSB Tracing] Routing to MyProject/ProxyServices/MySecondProxyService with message context:
    $body = <S:Body wsu:Id="Body-ogLysWiLTgk5UjAaaIhIvg22" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
    <processRequest xmlns="http://www.in4mates.com/targetNamespace"/>
    </S:Body>
    $header = <S:Header xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"/>
    $attachments = <con:attachments xmlns:con="http://www.bea.com/wli/sb/context"/>
    >
    ####<2011-11-21 13:00:46 CET> <Debug> <AlsbSecurityWss> <myLaptop> <osb_server1> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <0add29b7d176a5e4:5215cc49:133c5a81e20:-7ff4-0000000000000cb7> <1321876846860> <BEA-000000> <WssHandlerImpl.doOutboundRequest>
    ####<2011-11-21 13:00:46 CET> <Debug> <AlsbSecurityWss> <myLaptop> <osb_server1> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <0add29b7d176a5e4:5215cc49:133c5a81e20:-7ff4-0000000000000cb7> <1321876846860> <BEA-000000> <WsmOutboundHandler.processRequest>
    ####<2011-11-21 13:00:46 CET> <Debug> <AlsbSecurityWss> <myLaptop> <osb_server1> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <0add29b7d176a5e4:5215cc49:133c5a81e20:-7ff4-0000000000000cb7> <1321876846860> <BEA-000000> <target operation: execute>
    ####<2011-11-21 13:00:46 CET> <Debug> <AlsbSecurityWss> <myLaptop> <osb_server1> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <0add29b7d176a5e4:5215cc49:133c5a81e20:-7ff4-0000000000000cb7> <1321876846860> <BEA-000000> <Got SOAP Message Factory from the Provider: oracle.j2ee.ws.saaj.soap.MessageFactoryImpl@1a99544>
    ####<2011-11-21 13:00:46 CET> <Debug> <AlsbSecurityWss> <myLaptop> <osb_server1> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <0add29b7d176a5e4:5215cc49:133c5a81e20:-7ff4-0000000000000cb7> <1321876846860> <BEA-000000> <invoking WSM Engine's Client Agent.>
    ####<2011-11-21 13:00:46 CET> <Debug> <AlsbSecurityWss> <myLaptop> <osb_server1> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <0add29b7d176a5e4:5215cc49:133c5a81e20:-7ff4-0000000000000cb7> <1321876846861> <BEA-000000> <invoking WSM Engine's handleRequest()>
    ####<2011-11-21 13:00:46 CET> <Debug> <AlsbSecurityWss> <myLaptop> <osb_server1> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <0add29b7d176a5e4:5215cc49:133c5a81e20:-7ff4-0000000000000cb7> <1321876846861> <BEA-000000> <unexpected exception
    java.lang.NullPointerException
         at oracle.wsm.agent.handler.WSMEngineInvoker.createWsmMessageContextFromInvokerContext(WSMEngineInvoker.java:733)
         at oracle.wsm.agent.handler.WSMEngineInvoker.handleRequest(WSMEngineInvoker.java:359)
         at com.bea.wli.sb.security.wss.wsm.WsmOutboundHandler$1.run(WsmOutboundHandler.java:141)
         at com.bea.wli.sb.security.wss.wsm.WsmOutboundHandler$1.run(WsmOutboundHandler.java:139)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
         at com.bea.wli.sb.security.WLSSecurityContextService.runAs(WLSSecurityContextService.java:55)
         at com.bea.wli.sb.security.wss.wsm.WsmOutboundHandler.processRequest(WsmOutboundHandler.java:138)
         at com.bea.wli.sb.security.wss.WssHandlerImpl.doOutboundRequest(WssHandlerImpl.java:992)
         at com.bea.wli.sb.context.BindingLayerImpl.createTransportSender(BindingLayerImpl.java:532)
         at com.bea.wli.sb.pipeline.PipelineContextImpl.doDispatch(PipelineContextImpl.java:521)
         at com.bea.wli.sb.pipeline.PipelineContextImpl.dispatch(PipelineContextImpl.java:501)
         at stages.routing.runtime.RouteRuntimeStep.processMessage(RouteRuntimeStep.java:128)
         at com.bea.wli.sb.pipeline.debug.DebuggerRuntimeStep.processMessage(DebuggerRuntimeStep.java:74)
         at com.bea.wli.sb.stages.StageMetadataImpl$WrapperRuntimeStep.processMessage(StageMetadataImpl.java:346)
         at com.bea.wli.sb.pipeline.RouteNode.doRequest(RouteNode.java:106)
         at com.bea.wli.sb.pipeline.Node.processMessage(Node.java:67)
         at com.bea.wli.sb.pipeline.PipelineContextImpl.execute(PipelineContextImpl.java:922)
         at com.bea.wli.sb.pipeline.Router.processMessage(Router.java:214)
         at com.bea.wli.sb.pipeline.MessageProcessor.processRequest(MessageProcessor.java:99)
         at com.bea.wli.sb.pipeline.RouterManager$1.run(RouterManager.java:593)
         at com.bea.wli.sb.pipeline.RouterManager$1.run(RouterManager.java:591)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
         at com.bea.wli.sb.security.WLSSecurityContextService.runAs(WLSSecurityContextService.java:55)
         at com.bea.wli.sb.pipeline.RouterManager.processMessage(RouterManager.java:590)
         at com.bea.wli.sb.transports.TransportManagerImpl.receiveMessage(TransportManagerImpl.java:375)
         at com.bea.wli.sb.transports.http.generic.RequestHelperBase$1.run(RequestHelperBase.java:154)
         at com.bea.wli.sb.transports.http.generic.RequestHelperBase$1.run(RequestHelperBase.java:152)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
         at com.bea.wli.sb.transports.http.generic.RequestHelperBase.securedInvoke(RequestHelperBase.java:151)
         at com.bea.wli.sb.transports.http.generic.RequestHelperBase.service(RequestHelperBase.java:107)
         at com.bea.wli.sb.transports.http.wls.HttpTransportServlet.service(HttpTransportServlet.java:127)
         at weblogic.servlet.FutureResponseServlet.service(FutureResponseServlet.java:24)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:183)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.doIt(WebAppServletContext.java:3686)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3650)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2268)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2174)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1446)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    >
    ####<2011-11-21 13:00:46 CET> <Error> <OSB Security> <myLaptop> <osb_server1> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <0add29b7d176a5e4:5215cc49:133c5a81e20:-7ff4-0000000000000cb7> <1321876846861> <BEA-387024> <An error ocurred during web service security outbound request processing [error-code: InternalError, message-id: 3657493765399211266-5215cc49.133c5a81e20.-7f81, proxy: MyProject/ProxyServices/MyFirstProxyService, target: MyProject/ProxyServices/MySecondProxyService, operation: execute]
    --- Error message:
    java.lang.NullPointerException
         at oracle.wsm.agent.handler.WSMEngineInvoker.createWsmMessageContextFromInvokerContext(WSMEngineInvoker.java:733)
         at oracle.wsm.agent.handler.WSMEngineInvoker.handleRequest(WSMEngineInvoker.java:359)
         at com.bea.wli.sb.security.wss.wsm.WsmOutboundHandler$1.run(WsmOutboundHandler.java:141)
         at com.bea.wli.sb.security.wss.wsm.WsmOutboundHandler$1.run(WsmOutboundHandler.java:139)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
         at com.bea.wli.sb.security.WLSSecurityContextService.runAs(WLSSecurityContextService.java:55)
         at com.bea.wli.sb.security.wss.wsm.WsmOutboundHandler.processRequest(WsmOutboundHandler.java:138)
         at com.bea.wli.sb.security.wss.WssHandlerImpl.doOutboundRequest(WssHandlerImpl.java:992)
         at com.bea.wli.sb.context.BindingLayerImpl.createTransportSender(BindingLayerImpl.java:532)
         at com.bea.wli.sb.pipeline.PipelineContextImpl.doDispatch(PipelineContextImpl.java:521)
         at com.bea.wli.sb.pipeline.PipelineContextImpl.dispatch(PipelineContextImpl.java:501)
         at stages.routing.runtime.RouteRuntimeStep.processMessage(RouteRuntimeStep.java:128)
         at com.bea.wli.sb.pipeline.debug.DebuggerRuntimeStep.processMessage(DebuggerRuntimeStep.java:74)
         at com.bea.wli.sb.stages.StageMetadataImpl$WrapperRuntimeStep.processMessage(StageMetadataImpl.java:346)
         at com.bea.wli.sb.pipeline.RouteNode.doRequest(RouteNode.java:106)
         at com.bea.wli.sb.pipeline.Node.processMessage(Node.java:67)
         at com.bea.wli.sb.pipeline.PipelineContextImpl.execute(PipelineContextImpl.java:922)
         at com.bea.wli.sb.pipeline.Router.processMessage(Router.java:214)
         at com.bea.wli.sb.pipeline.MessageProcessor.processRequest(MessageProcessor.java:99)
         at com.bea.wli.sb.pipeline.RouterManager$1.run(RouterManager.java:593)
         at com.bea.wli.sb.pipeline.RouterManager$1.run(RouterManager.java:591)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
         at com.bea.wli.sb.security.WLSSecurityContextService.runAs(WLSSecurityContextService.java:55)
         at com.bea.wli.sb.pipeline.RouterManager.processMessage(RouterManager.java:590)
         at com.bea.wli.sb.transports.TransportManagerImpl.receiveMessage(TransportManagerImpl.java:375)
         at com.bea.wli.sb.transports.http.generic.RequestHelperBase$1.run(RequestHelperBase.java:154)
         at com.bea.wli.sb.transports.http.generic.RequestHelperBase$1.run(RequestHelperBase.java:152)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
         at com.bea.wli.sb.transports.http.generic.RequestHelperBase.securedInvoke(RequestHelperBase.java:151)
         at com.bea.wli.sb.transports.http.generic.RequestHelperBase.service(RequestHelperBase.java:107)
         at com.bea.wli.sb.transports.http.wls.HttpTransportServlet.service(HttpTransportServlet.java:127)
         at weblogic.servlet.FutureResponseServlet.service(FutureResponseServlet.java:24)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:183)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.doIt(WebAppServletContext.java:3686)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3650)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2268)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2174)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1446)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    >
    ####<2011-11-21 13:00:46 CET> <Info> <OSB Kernel> <myLaptop> <osb_server1> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <0add29b7d176a5e4:5215cc49:133c5a81e20:-7ff4-0000000000000cb7> <1321876846871> <BEA-398102> <
    [OSB Tracing] Exiting route node with fault:
    <con:fault xmlns:con="http://www.bea.com/wli/sb/context">
    <con:errorCode>BEA-386400</con:errorCode>
    <con:reason>General outbound web service security error</con:reason>
    <con:location>
    <con:node>RouteToMySecondProxyService</con:node>
    <con:path>request-pipeline</con:path>
    </con:location>
    </con:fault>>
    ####<2011-11-21 13:00:46 CET> <Info> <OSB Kernel> <myLaptop> <osb_server1> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <0add29b7d176a5e4:5215cc49:133c5a81e20:-7ff4-0000000000000cb7> <1321876846873> <BEA-398074> <
    [OSB Tracing] The following variables are added:
    $outbound = <con:endpoint name="ProxyService$MyProject$ProxyServices$MySecondProxyService" xmlns:con="http://www.bea.com/wli/sb/context">
    <con:service>
    <con:operation>execute</con:operation>
    </con:service>
    <con:transport>
    <con:mode>request-response</con:mode>
    <con:qualityOfService>best-effort</con:qualityOfService>
    <con:request xsi:type="http:HttpRequestMetaData" xmlns:http="http://www.bea.com/wli/sb/transports/http" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <tran:headers xsi:type="http:HttpRequestHeaders" xmlns:tran="http://www.bea.com/wli/sb/transports">
    <http:Content-Type>text/xml</http:Content-Type>
    <http:SOAPAction>"execute"</http:SOAPAction>
    </tran:headers>
    </con:request>
    </con:transport>
    <con:security>
    <con:doOutboundWss>true</con:doOutboundWss>
    </con:security>
    </con:endpoint>
    >
    ####<2011-11-21 13:00:46 CET> <Info> <OSB Kernel> <myLaptop> <osb_server1> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <0add29b7d176a5e4:5215cc49:133c5a81e20:-7ff4-0000000000000cb7> <1321876846874> <BEA-398076> <
    [OSB Tracing] The following variables are changed:
    $inbound = <con:endpoint name="ProxyService$MyProject$ProxyServices$MyFirstProxyService" xmlns:con="http://www.bea.com/wli/sb/context">
    <con:service>
    <con:operation>execute</con:operation>
    </con:service>
    <con:transport>
    <con:uri>/MyProject/ProxyServices/MyFirstProxyService</con:uri>
    <con:mode>request-response</con:mode>
    <con:qualityOfService>best-effort</con:qualityOfService>
    <con:request xsi:type="http:HttpRequestMetaData" xmlns:http="http://www.bea.com/wli/sb/transports/http" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <tran:headers xsi:type="http:HttpRequestHeaders" xmlns:tran="http://www.bea.com/wli/sb/transports">
    <http:Accept>text/xml, multipart/related, text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2</http:Accept>
    <http:Connection>keep-alive</http:Connection>
    <http:Content-Length>7614</http:Content-Length>
    <http:Content-Type>text/xml;charset="utf-8"</http:Content-Type>
    <http:Host>myLaptop:8011</http:Host>
    <http:SOAPAction>"execute"</http:SOAPAction>
    <http:User-Agent>Oracle JAX-WS 2.1.5</http:User-Agent>
    </tran:headers>
    <tran:encoding xmlns:tran="http://www.bea.com/wli/sb/transports">utf-8</tran:encoding>
    <http:client-host>myLaptop</http:client-host>
    <http:client-address>192.168.148.155</http:client-address>
    <http:http-method>POST</http:http-method>
    </con:request>
    <con:response xsi:type="http:HttpResponseMetaData" xmlns:http="http://www.bea.com/wli/sb/transports/http" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <tran:headers xsi:type="http:HttpResponseHeaders" xmlns:tran="http://www.bea.com/wli/sb/transports">
    <http:Content-Type>text/xml</http:Content-Type>
    </tran:headers>
    <tran:response-code xmlns:tran="http://www.bea.com/wli/sb/transports">0</tran:response-code>
    </con:response>
    </con:transport>
    <con:security>
    <con:transportClient>
    <con:username>&lt;anonymous></con:username>
    </con:transportClient>
    <con:messageLevelClient>
    <con:username>myPrincipal</con:username>
    </con:messageLevelClient>
    </con:security>
    </con:endpoint>
    >
    ####<2011-11-21 13:00:46 CET> <Info> <OSB Kernel> <myLaptop> <osb_server1> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <0add29b7d176a5e4:5215cc49:133c5a81e20:-7ff4-0000000000000cb7> <1321876846874> <BEA-398104> <
    [OSB Tracing] Exiting pipeline pair>
    ####<2011-11-21 13:00:46 CET> <Info> <OSB Kernel> <myLaptop> <osb_server1> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <0add29b7d176a5e4:5215cc49:133c5a81e20:-7ff4-0000000000000cb8> <1321876846879> <BEA-398096> <
    [OSB Tracing] Exiting MyProject/ProxyServices/MyFirstProxyService>
    ####<2011-11-21 13:00:46 CET> <Info> <OSB Kernel> <myLaptop> <osb_server1> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <0add29b7d176a5e4:5215cc49:133c5a81e20:-7ff4-0000000000000cb8> <1321876846881> <BEA-398201> <
    [OSB Tracing] Inbound response was sent.
    Service Ref = MyProject/ProxyServices/MyFirstProxyService
    URI = /MyProject/ProxyServices/MyFirstProxyService
    Message ID = 3657493765399211266-5215cc49.133c5a81e20.-7f81
    Response metadata =
    <xml-fragment>
    <tran:headers xsi:type="http:HttpResponseHeaders" xmlns:http="http://www.bea.com/wli/sb/transports/http" xmlns:tran="http://www.bea.com/wli/sb/transports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <http:Content-Type>text/xml; charset=utf-8</http:Content-Type>
    </tran:headers>
    <tran:response-code xmlns:tran="http://www.bea.com/wli/sb/transports">1</tran:response-code>
    <tran:encoding xmlns:tran="http://www.bea.com/wli/sb/transports">utf-8</tran:encoding>
    </xml-fragment>
    Payload =
    <?xml version="1.0" encoding="UTF-8"?>
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><soapenv:Fault><faultcode>soapenv:Server</faultcode><faultstring>BEA-386400: General outbound web service security error</faultstring><detail><con:fault xmlns:con="http://www.bea.com/wli/sb/context"><con:errorCode>BEA-386400</con:errorCode><con:reason>General outbound web service security error</con:reason><con:location><con:node>RouteToMySecondProxyService</con:node><con:path>request-pipeline</con:path></con:location></con:fault></detail></soapenv:Fault></soapenv:Body></soapenv:Envelope>
    >

  • Problems calling external Web Service from a Java Stored Procedure

    I'm using a sample code that I found here about calling external web services from a Java Store Procedure ( Credit Agency Web Service http://www.oracle.com/technology/sample_code/tech/java/jsp/samples/wsclient/Readme.html ) but when I run it ,send this error. I dont know what can I do or what is missing. Please help me. Thanks.
    Error: Premature EOF encountered [java.io.EOFException] [SOAPException: faultCode=SOAP-ENV:IOException; msg=Premature EOF encountered; targetException=java.io.EOFException: Premature EOF encountered] at org.apache.soap.SOAPException.(SOAPException.java:77) at oracle.soap.transport.http.OracleSOAPHTTPConnection.send(OracleSOAPHTTPConnection.java:765) at org.apache.soap.rpc.Call.invoke(Call.java:261) at oracle.otnsamples.wsclient.CreditAgencyServiceStub.authorizeCustomer(CreditAgencyServiceStub.java:84) at Products.jspService(Products.jsp:120) at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:139) at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:349) at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:509) at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:413) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:795) at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330) at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:794) at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:270) at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112) at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192) at java.lang.Thread.run(Thread.java:534)

    I'm also facing problem in running the example on the page http://www.oracle.com/technology/sample_code/tech/java/jsp/samples/wsclient/Readme.html
    I've Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 and Oracle Application Server 10g (10.1.3). When I executed the following command,
    loadjava -thin -user sys/password@localhost:1521:oradb -resolve -synonym -verbose -grant public %OC4J_HOME%/webservices/lib/soap.jar %OC4J_HOME%/lib/dms.jar %OC4J_HOME%/jlib/javax-ssl-1_1.jar %ORACLE_HOME%/lib/servlet.jar %OC4J_HOME%/j2ee/home/lib/mail.jar
    ... mentioned in step 3 under the "Configuring the Application" section on the above link, the process terminates with the following error
    The following operations failed
    class oracle/net/www/protocol/https/Handler: resolution
    class oracle/net/www/protocol/https/HttpsURLConnection: resolution
    class oracle/soap/client/ProviderManagerClient: resolution
    class oracle/soap/client/ServiceManagerClient: resolution
    class oracle/soap/providers/JavaProvider: resolution
    class oracle/soap/providers/ejbprov/EntityEJBProvider: resolution
    class oracle/soap/providers/ejbprov/StatefulEJBProvider: resolution
    class oracle/soap/providers/ejbprov/StatelessEJBProvider: resolution
    class oracle/soap/providers/sp/SpProvider: resolution
    class oracle/soap/server/http/SOAPServlet: resolution
    class oracle/soap/transport/http/OracleSOAPHTTPConnection$1: resolution
    class oracle/soap/transport/http/OracleSOAPHTTPConnection: resolution
    class org/apache/soap/messaging/Message: resolution
    class org/apache/soap/rpc/Call: resolution
    class org/apache/soap/rpc/RPCMessage: resolution
    class org/apache/soap/rpc/Response: resolution
    class javax/net/DefaultServerSocketFactory: creation (createFailed)
    class javax/net/DefaultSocketFactory: creation (createFailed)
    class javax/net/ServerSocketFactory: creation (createFailed)
    class javax/net/SocketFactory: creation (createFailed)
    class javax/net/ssl/DefaultSSLServerSocketFactory: creation (createFailed)
    class javax/net/ssl/DefaultSSLSocketFactory: creation (createFailed)
    class javax/net/ssl/HandshakeCompletedEvent: creation (createFailed)
    class javax/net/ssl/HandshakeCompletedListener: creation (createFailed)
    class javax/net/ssl/SSLException: creation (createFailed)
    class javax/net/ssl/SSLHandshakeException: creation (createFailed)
    class javax/net/ssl/SSLKeyException: creation (createFailed)
    class javax/net/ssl/SSLPeerUnverifiedException: creation (createFailed)
    class javax/net/ssl/SSLProtocolException: creation (createFailed)
    class javax/net/ssl/SSLServerSocket: creation (createFailed)
    class javax/net/ssl/SSLServerSocketFactory: creation (createFailed)
    class javax/net/ssl/SSLSession: creation (createFailed)
    class javax/net/ssl/SSLSessionBindingEvent: creation (createFailed)
    class javax/net/ssl/SSLSessionBindingListener: creation (createFailed)
    class javax/net/ssl/SSLSessionContext: creation (createFailed)
    class javax/net/ssl/SSLSocket: creation (createFailed)
    class javax/net/ssl/SSLSocketFactory: creation (createFailed)
    class javax/security/cert/Certificate: creation (createFailed)
    class javax/security/cert/CertificateEncodingException: creation (createFailed)
    class javax/security/cert/CertificateException: creation (createFailed)
    class javax/security/cert/CertificateExpiredException: creation (createFailed)
    class javax/security/cert/CertificateNotYetValidException: creation (createFailed)
    class javax/security/cert/CertificateParsingException: creation (createFailed)
    class javax/security/cert/X509Certificate: creation (createFailed)
    exiting : Failures occurred during processing
    I've checked the path to all the jar files.
    I tried to run the command again with system/password instead sys/password but then I got the following stacktrace:
    The following operations failed
    class oracle/net/www/protocol/https/Handler: resolution
    class oracle/net/www/protocol/https/HttpsURLConnection: resolution
    class oracle/soap/client/ProviderManagerClient: resolution
    class oracle/soap/client/ServiceManagerClient: resolution
    class oracle/soap/providers/JavaProvider: resolution
    class oracle/soap/providers/ejbprov/EntityEJBProvider: resolution
    class oracle/soap/providers/ejbprov/StatefulEJBProvider: resolution
    class oracle/soap/providers/ejbprov/StatelessEJBProvider: resolution
    class oracle/soap/providers/sp/SpProvider: resolution
    class oracle/soap/server/http/SOAPServlet: resolution
    class oracle/soap/transport/http/OracleSOAPHTTPConnection$1: resolution
    class oracle/soap/transport/http/OracleSOAPHTTPConnection: resolution
    class org/apache/soap/messaging/Message: resolution
    class org/apache/soap/rpc/Call: resolution
    class org/apache/soap/rpc/RPCMessage: resolution
    class org/apache/soap/rpc/Response: resolution
    exiting : Failures occurred during processing
    Thanks in advance for any useful help.
    -

  • How to call a shell script from a java code

    Hello can any one suggest me how to call a shell script from a java program that takes three parameters.
    i have a shell script (msp_restore_gui) when i run this script in the command line in a RHEL5 ,SUSE10 and Debian machine it works fine .I even tested to call it from a java program and it also worked fine but when i used the same in a J2ee application where the user when clicks the restore button in a webserver this inturn sends the request to a java file named BackupManager.java where i call the shell script.But here it fails.Waiting for your suggestions.If you want i can put the code also here

    yes the script is in /usr/local/mss/tools/backup and the script (msp_restore_gui) is as follows
    #!/bin/sh
    TIMESTAMP=`date +%d_%b_%y-%H-%M`
    touch /var/backups/mss/mss_restore_"$TIMESTAMP".log
    LOGFILE="/var/backups/mss/mss_restore_"$TIMESTAMP".log"
    ### Explode tgz file
    cd /
    # Checks to be done:
    # root login
    # assume he passes the parameter as msp_backup_<timestamp>
    # check for the existence of the .tz and fileList.txt
    # Checking for the root login and if not logged on as root
    # permission will be denied to execute this script
    logmsg(){
    echo "`date`: $*" >> $LOGFILE 2>&1
    echo "$*"
    #usage of this script
    while [ $#  -ne 0 ]
    do
    case $1 in
    -n)
    shift
    ARCHIVE_NAME=`find / \( -name "$1.tz" -o -name "$1.tgz" \) 2>/dev/null`
    FILE_NAME=`find / -name $1_filesList.txt 2>/dev/null`
    if [ x$ARCHIVE_NAME = x -a y$FILE_NAME = y ]
    then
    logmsg "ERROR: Files not found, Restore cannot proceed"
    usage
    else
    tar tvzf $ARCHIVE_NAME > /dev/null 2>&1
    if [ $? -ne 0 ]
    then
    echo "ERROR: The tar file $ARCHIVE_NAME is not proper. Restore cannot proceed"
    exit 1
    else
              echo "Backedup files are present, proceeding with restore......" >> $LOGFILE 2>&1
    fi
    fi
    usage
    SKIP_CLEANUP=1
    STATUS=1
    exit
    esac
    shift
    done
    rm -rf ./newfile
    curr_ver_file="/usr/local/mss/etc/version"
    /usr/local/mss/tools/backup/check_version $curr_ver_file $FILE_NAME
    ret_code=$?
    echo "Exit value of check_version is $ret_code"
    if [ "$ret_code" != 0 ]
    then
    logmsg "MSP Version not matching. Exiting from restore now...."
    errormsg=`cat /usr/local/mss/temp/ver_err_mesg`
    logmsg $errormsg
    rm -f /usr/local/mss/temp/ver_err_mesg
    exit 1
    else
    echo "Version check is successful"
    fi
    #### ShutDown MSS########
    /etc/init.d/mss stop
    sleep 2
    ### Shutdown semm
    /etc/init.d/semm stop
    sleep 2
    rm -rf `grep -v "MSP Version:" $FILE_NAME`
    logmsg "MSP restore in progress......"
    tar mxvfz $ARCHIVE_NAME >> $LOGFILE
    sleep 5
    ### Call mysql restore script
    /usr/local/mss/bin/mysql_alldb_restore.sh >> $LOGFILE 2>&1
    if [ $? -ne 0 ]; then
    logmsg "Database restore Failed. Cannot proceed further"
    exit 1 ;
    else
    logmsg "Database restore Succeeded."
    fi
    ### Remove DB Dump Files
    rm -f /var/lib/mysql-dumps/*
    ### Trigger cleanup of airprism database tables
    #touch /usr/local/mss/airprism/server/config/reinitdb
    ### Trigger re-import of software packages
    touch /usr/local/mss/swdepot/reimport
    ### Remove log files under the "apps" directory
    find /usr/local/mss/apps -name '*.log*' | xargs rm -f
    find /usr/local/mss/logs -follow -name '*[._]log*' | xargs rm -f
    if [ $? -ne 0 ]; then
    logmsg "MSP restore Failed. Cannot proceed further"
    exit 1 ;
    else
    logmsg "MSP restore Succeeded."
    fi
    # reinstall_patch is touched so that patches are re-installed after restoring of MSP.
    touch /usr/local/mss/patch/bin/reinstall_patch
    ##### Start MSS
    logmsg "restarting MSP server "
    /etc/init.d/mss start
    sleep 5
    ### Start semm
    /etc/init.d/semm start
    sleep 5
    logmsg "MSP server is now restarted"
    my jsp page backup.jsp is as follows
    <%@taglib uri="portlet.tld" prefix="uif" %>
    <%@taglib uri="msp-console.tld" prefix="msp" %>
    <uif:defineObjects/>
    <%@page import="javax.portlet.*" %>
    <%@ page import="java.util.Date" %>
    <%@ page import="java.util.Vector" %>
    <%@ page import="java.text.DateFormat" %>
    <%@ page import="com.symbol.mss.console.admin.backup.BackupManager" %>
    <%@ page import="com.symbol.mss.console.admin.system.SystemInfoPortlet" %>
    <%
         String STYLE_NAME = request.getParameter("style");
         if (STYLE_NAME == null) STYLE_NAME = STYLE_DEFAULT;
         final String ua = request.getHeader("User-Agent");
         BackupManager helper = null;
         PortletSession portletSession = renderRequest.getPortletSession();
         helper = (BackupManager)portletSession.getAttribute("helper");
         if (helper == null) {
              //System.err.println("Created new BackupManager");
              helper = new BackupManager();
              portletSession.setAttribute("helper", helper);
         final BackupManager backupManager = helper;
         String action = "";
         final String backupName = renderRequest.getParameter("backupName");
         String completePath = backupManager.getBackupDir() + backupName + backupManager.getBackupFileExt();
         if (backupName != null) {
              action = "backup";
         if(backupManager.backup(backupName)) {
              SystemInfoPortlet.beginRestartMSP();
              } else {
                   action = "backuperror";          
         final String cmd = renderRequest.getParameter("submitButton");
    final String selectedBackup = renderRequest.getParameter("selectedBackup");
    int tarFileStatus =0;
    String backupTarFile ="";
    String backupFileList ="";
         if ("Restore".equals(cmd)) {
    if (selectedBackup != null) {
         tarFileStatus = backupManager.verifyTarFile(selectedBackup);
         //backupTarFile = backupManager.getRestoreFile(Integer.parseInt(selectedBackup));
         //backupFileList = backupTarFile.substring(0, backupTarFile.lastIndexOf(backupManager.getBackupFileExt()))+"_filesList.txt";
                   if (tarFileStatus == 0){
         action = "restore";
         backupManager.restore(selectedBackup);
                        SystemInfoPortlet.beginRestartMSP();
              } else {
                   action = "error";
    } else if ("Remove".equals(cmd)) {
    backupManager.remove(Integer.parseInt(selectedBackup));
         DateFormat dateFormat = DateFormat.getDateInstance(DateFormat.SHORT);
         PortletURL restoreURL = renderResponse.createActionURL();
    %>
    <%@ include file="/jsp/core/constants.jspf" %>
    <% if (action.length() > 0) {
         if ("backup".equals(action))
    %>
         <p>The MSP Appliance has been shut down in order to create the <%=backupName %> backup file,
              and will automatically restart as soon as the file has been created.
              To continue your work, please log out of the MSP Console, wait for the appliance
              to restart, and then log back in. The amount of time you'll have to wait for the
              MSP Appliance to come back online depends on the amount of information you have
              stored in the MSP Database.</p>
         <p>The full pathname for the backup file is: <%=completePath %></p>     
    <%     }
         else if ("restore".equals(action))
    %>
         <p>The MSP Appliance has been shut down in order to restore from the <%=backupTarFile%> backup file,
              and will automatically restart as soon as the restore is complete.
              To continue your work, please log out of the MSP Console, wait for the appliance
              to restart, and then log back in. The amount of time you'll have to wait for the
              MSP Appliance to come back online depends on the amount of information you have
              stored in the MSP Database.</p>     
    <%     } else if ("backuperror".equals(action)) { %>
              <p><img src="images/dialogue/error_16.gif" class="icon" alt="Notify" /> Errors occurred while taking back up of MSP. Please see the backup service log file for more details.
              </P>
    <%     } else if ("error".equals(action)) {
              if (tarFileStatus == 4) { %>
                   <p><img src="images/dialogue/error_16.gif" class="icon" alt="Notify" /> The backup file <%=backupTarFile%> contains errors. This backup can't be restored. Please restore a valid back up.
                   </P>
              <%} else if (tarFileStatus == 3) { %>
                   <p><img src="images/dialogue/error_16.gif" class="icon" alt="Notify" /> The backup file list <%=backupFileList %> is missing. This file is required to restoring backup. Please get the backup file list and proceed with restoring backup.</p>
              <%} else if (tarFileStatus == 2) { %>
                   <p> <img src="images/dialogue/error_16.gif" class="icon" alt="Notify" /> The backup file <%=backupTarFile%> contains errors and the backup file list <%=backupFileList%> is missing. This backup can't be restored. </p>
              <%} %>
    <%     }
    } else { %>
    <p><strong>Note</strong>: Both backup and restore will shut down MSP temporarily. MSP will be unable to collect data from devices, send notifications, or provide MSP Console access during this time. When the backup or restore operation is complete, MSP will come back online automatically.</p>
    <h3>Backup</h3>
    <form action="<%= restoreURL.toString() %>" method="post">
    <p>Please provide a name for your backup. MSP will provide the date automatically in the list of backups.</p>
    <p><label for="<uif:namespace />backupName">Name</label> <input type="text" name="<uif:namespace />backupName" id="<uif:namespace />backupName" size="20" maxlength="256" /> <input type="submit" name="<uif:namespace />submitButton" value="Back up now" onclick="return <uif:namespace/>validateName()"/></p>
    </form>
    <h3>Restore</h3>
    <p>This will restore all databases (device assets, collected device data, software packages, policies, etc.) to their state as of the time the backup was made. Changes since then <em>except for backups</em> will be destroyed.</p>
    <%
    Vector restoreList = helper.getRestoreEntries();
    Vector restoreDates = helper.getRestoreDates();
    Vector restoreVersions = helper.getRestoreVersions();
    Vector filesStatus = helper.getBackupFilesStatus();
    %>
    <% if (restoreList.size() == 0) { %>
    <p>There are no backups currently available.</p>
    <% } else { %>
    <form action="<%= restoreURL.toString() %>" method="post">
    <table class="input-radios" id="<uif:namespace />existingBackups">
    <thead>
    <tr>
    <th></th>
    <th>Name</th>
    <th>Date</th>
    <th>MSP Version</th>
    <th>Remarks </th>
    </tr>
    </thead>
    <tfoot>
    <tr>
    <td colspan="4" class="actionsOnSelected">
    <input type="submit" name="<uif:namespace />submitButton" value="Restore" onclick="return confirm('This action requires MSP and all related services to be shut down. Console will be unavailable if the request is submitted. The server will restart automatically once restore has been completed.');" />
    <input type="submit" name="<uif:namespace />submitButton" value="Remove" onclick="return confirm('This action will remove the backup archive. You will no longer be able to restore this backup. Continue?');" />
    </td>
    </tr>
    </tfoot>
    <tbody><%-- First one (most recent) is checked by default. Every other row has class="portlet-section-alternate". Note that each ID must be unique and must match the value of the "for" attribute on the corresponding "label" element. --%>
    <%
    for (int i = 0; i < restoreList.size(); i++) {
    %>
    <tr <%= (i % 2 == 1) ? " class=\"portlet-section-alternate\"" : "" %>>
    <td><input type="radio" name="<uif:namespace />selectedBackup" value="<%= i %>" id="<uif:namespace />selectedBackup-<%= i %>" <%= (i == 0) ? "checked=\"checked\"" : "" %> /></td>
    <td><label for="<uif:namespace />selectedBackup-<%= i %>"><%= restoreList.elementAt(i) %></label></td>
    <td><%= dateFormat.format((Date)restoreDates.elementAt(i)) %></td>
    <td><%= restoreVersions.elementAt(i) %></td>
    <td><%= filesStatus.elementAt(i) %></td>
    </tr>
    <%
    %>
    </tbody>
    </table>
    </form>
    <% } %>
    <% } %>
    <script type="text/javascript">
    <!--//--><![CDATA[//><!--
    function <uif:namespace/>validateName() {
    var name =document.getElementById("<uif:namespace />backupName");
    var msg= "<msp:i18n key="BackupMsg"/>";
    var str=name.value;
    var re = /^[A-Za-z0-9_]+$/;
    if (!str.match(re)) {
         alert(msg);
         name.focus();
         return false;
         } else {
    return confirm('This action requires MSP and all related services to be shutdown. Console will be unavailable if the request is submitted. The server will restart automatically once backup has been completed.');
    //--><!]]>
    </script>
    and my BackupManager.java is as follows where the code in bold and italic is called the restore()
    //============================================================================
    // Symbol Technologies P R O P R I E T A R Y S O U R C E C O D E
    // C O N F I D E N T I A L
    // Copyright (c) 2003 Symbol Technologies. All Rights Reserved.
    // All information contained herein is the property of Symbol Technologies,
    // or its Licensors, and are protected copyrights and trade secrets, and may
    // be covered by U.S. patents. Any reproduction or dissemination of any
    // portion of this document, of the software, or other works derived from it
    // is strictly forbidden unless prior written permission is obtained from
    // Symbol Technologies.
    //============================================================================
    package com.symbol.mss.sdf.services.backup;
    import java.io.*;
    import java.sql.Time;
    import java.text.DateFormat;
    import java.util.logging.FileHandler;
    import java.util.logging.Formatter;
    import java.util.logging.LogRecord;
    import java.lang.Process;
    import java.util.*;
    import org.apache.avalon.framework.configuration.Configurable;
    import org.apache.avalon.framework.configuration.Configuration;
    import org.apache.avalon.framework.configuration.ConfigurationException;
    import org.apache.avalon.framework.logger.LogEnabled;
    import org.apache.avalon.framework.logger.Logger;
    import com.symbol.mss.sdf.admin.AdministratorService;
    import com.symbol.mss.sdf.backup.*;
    import com.symbol.mss.sdf.data.*;
    * @author nramaiah
    * Service to perform scheduled backups of the system state.
    public class BackupManager implements BackupService, DataHandler,
    LogEnabled, Configurable {
    // MSS Home Path
    private static String mssHome = System.getProperty("phoenix.home", File.separator + "usr" +
    File.separator + "local" +
    File.separator + "mss" +
    File.separator);
    // Backup related definitions
    private static final String BACKUP_LIST_FILE_NAME = "conf" + File.separator + "files_to_backup.txt";
    private static final String BACKED_UP_LIST_FILE_NAME_SUFFIX = "_filesList.txt";
    private static final String BACKUP_LOCATION = File.separator + "var" + File.separator + "lib" +
    File.separator + "mss-backups" + File.separator;
    private static final String BACKUP_PARTITION = File.separator + "var" + File.separator + "lib";
    private static final String VERIFY_BACKUP = File.separator + "usr" + File.separator + "local" +
                                                           File.separator + "mss" + File.separator+"tools"+
                                                           File.separator+"backup"+File.separator+"verifyBackup.sh";
    // DB backup/restore related definitions
    private static final String DB_DUMP_LOCATION = File.separator + "var" + File.separator +
    "lib" + File.separator +
    "mysql-dumps" + File.separator;
    private static final String DB_BACKUP_SCRIPT = "bin" + File.separator + "mysql_alldb_backup.sh";
    private static final String DB_RESTORE_SCRIPT = "bin" + File.separator + "mysql_alldb_restore.sh";
    // Private variables
    private AdministratorService m_admin = null;
    private Logger m_logger = null;
    private String backupLocation = null;
    private String backupListFileName = null;
    private String backupPartition = null;
    private int backupPartitionLimit = 90;
    private String dbDumpLocation = null;
    private String dbBackupScript = null;
    private String dbRestoreScript = null;
    private List servicesBackupList = null;
    private String tarFileExtension =".tgz";
    private String errFileExtension =".err";
    private int exitValue=0;
    * Default Constructor
    public BackupManager() {
    servicesBackupList = new ArrayList();
    * Set the administrator service implementation. Link established by Broker service.
    * @param admin reference to an implementation of AdministratorService
    public void setAdministrator(AdministratorService admin) {
    m_admin = admin;
    * Set the job publisher service implementation. Link established by Broker service.
    * @param jobPublisher reference to an implementation of JobPublisherService
    public void setJobPublisher(DataChannel jobPublisher) {
    jobPublisher.subscribe(this);
    * Gets the backup manager object.
    * @return backup manager object
    public BackupService getBackupService() {
    return this;
    * Service lifecycle method.
    * @param logger logger object to be used by the service
    public void enableLogging(Logger logger) {
    m_logger = logger;
    * Service lifecycle method.
    * @param configuration service configuration object
    public void configure(Configuration configuration) throws ConfigurationException {
    // Verify MSS Home path
    if (!mssHome.endsWith(File.separator))
    mssHome += File.separator;
    // Get the location where the backup file needs to be placed
    backupLocation = configuration.getChild("BackupLocation").getValue(BACKUP_LOCATION);
    // Verify backup directory path
    if (!backupLocation.startsWith(File.separator))
    backupLocation = mssHome + backupLocation;
    if (!backupLocation.endsWith(File.separator))
    backupLocation += File.separator;
    // Get the file listing the files/directories to be backed up
    backupListFileName = configuration.getChild("FilesList").getValue(BACKUP_LIST_FILE_NAME);
    // Verify backup list file name path
    if (!backupListFileName.startsWith(File.separator))
    backupListFileName = mssHome + backupListFileName;
    // Get the partition where the backups are kept
    backupPartition = configuration.getChild("BackupPartition").getValue(BACKUP_PARTITION);
    // Verify backup partition path
    if (!backupPartition.startsWith(File.separator))
    backupPartition = File.separator + backupPartition;
    if (backupPartition.endsWith(File.separator))
    backupPartition = backupPartition.substring(0, (backupPartition.length()-1));
    // Get the limit on the amount of free space on the backup partition
    backupPartitionLimit = configuration.getChild("BackupPartitionLimit").getValueAsInteger(backupPartitionLimit);
    // Get the location where the DB dump files will be placed
    dbDumpLocation = configuration.getChild("DBDumpLocation").getValue(DB_DUMP_LOCATION);
    // Verify DB dump directory path
    if (!dbDumpLocation.startsWith(File.separator))
    dbDumpLocation = mssHome + dbDumpLocation;
    if (!dbDumpLocation.endsWith(File.separator))
    dbDumpLocation += File.separator;
    // Get the name of DB dump backup script
    dbBackupScript = configuration.getChild("DBBackupScript").getValue(DB_BACKUP_SCRIPT);
    // Verify backup script path
    if (!dbBackupScript.startsWith(File.separator))
    dbBackupScript = mssHome + dbBackupScript;
    // Get the name of DB dump restore script
    dbRestoreScript = configuration.getChild("DBRestoreScript").getValue(DB_RESTORE_SCRIPT);
    // Verify restore script path
    if (!dbRestoreScript.startsWith(File.separator))
    dbRestoreScript = mssHome + dbRestoreScript;
    * Individual services can supply a list of files/directories to be backed up.
    * These are files apart from the files specified in conf/files_to_backup.txt and
    * will be backed up as well.
    * @param files list of files/directories
    public void filesToBackup(List files) {
    synchronized(this) {
    if (files != null) {
    if (files.size() > 0) {
    // Add the list contents to the current backup list
    for (int i=0; i<files.size(); i++) {
    String tStr = (String)files.get(i);
    // Check for absolute or relative path
    if (tStr.startsWith(File.separator))
    servicesBackupList.add(tStr);
    else
    servicesBackupList.add(mssHome + tStr);
    else
    m_logger.info("Empty list of filenames. Nothing added.");
    else
    m_logger.info("Null list of filenames. Nothing added.");
    * Individual services can supply a list of files/directories to be backed up.
    * Specified files will be added to the file defining the list of files to be backed up.
    * @param files list of files/directories
    private void persistFilesToBackup(List files) {
    synchronized(this) {
    if (files != null) {
    if (files.size() > 0) {
    // Add the list of files provided to the end of file
    try {
    File file = new File(backupListFileName);
    if ((file == null) || (!file.exists()))
    file.createNewFile();
    // Seek to the end of the file
    RandomAccessFile rFile = new RandomAccessFile(file, "rw");
    if (rFile != null) {
    rFile.seek(rFile.length());
    // Write the list contents to the file
    for (int i=0; i<files.size(); i++) {
    String tStr = (String)files.get(i);
    // Check for absolute or relative path
    if (tStr.startsWith(File.separator))
    rFile.writeBytes(tStr + "\n");
    else
    rFile.writeBytes(mssHome + tStr + "\n");
    else
    m_logger.error("Error opening file " + backupListFileName);
    rFile.close();
    catch (Exception ex) {
    ex.printStackTrace();
    m_logger.error("Error adding entries to file " + backupListFileName, ex);
    else
    m_logger.info("Empty list of filenames. Nothing added.");
    else
    m_logger.info("Null list of filenames. Nothing added.");
    * Command to be run during the backup process. Individual services can
    * provide shell commands that will be executed before backing up the files.
    * @param command shell command to be executed
    private void runCommand(String command) {
    * Creates a shell script at the specified location that will backup the
    * files listed in the List passed in.
    * @param scriptFileName location where the script needs to be created
    * @param backupFileName name for the tar file being created
    * @param backupList list of files to be backed up
    private void createBackupScript(String scriptFileName, String backupFileName, ArrayList backupList) throws Exception {
    // Create a new StringBuffer to build the contents to be written to the script file
    StringBuffer buffer = new StringBuffer();
    // Add the initial comment in the start script
    buffer.append("#!/bin/sh\n" + "set -x\n\n");
    // Check if the partition has enough space
    buffer.append("### Check if the partition has enough space\n" +
    // "diskUsed=`df -k | grep \"" + backupPartition + "\" | awk '{print $5}' | cut -d\"%\" -f1`\n" +
                   " diskUsed=`df -k \"" + backupPartition + "\" | awk '{print $5}' | cut -d\"%\" -f1 | grep -v Use`\n" +     
    "echo \"Partition " + backupPartition + " is $diskUsed% used.\"\n" +
    "if [ \"$diskUsed\" -lt \"" + backupPartitionLimit + "\" ]\nthen\n" +
    " echo \"Starting backup...\"\n\n");
    // Shutdown semmd
    buffer.append(" ### Shutdown semm\n" + " /etc/init.d/semm stop\n" +
    " sleep 2\n\n");
    // MSP Limited release and earlier builds stop mysql DB and backup the
    // /var/lib/mysql directory as it is. Starting MSP 1.0 GA release, mysql
    // dump script will be integrated which will create sql scripts to
    // restore the database.
    // Check if mysql dump creation script exists
    File mysqlDumpScript = new File(dbBackupScript);
    if (mysqlDumpScript.exists()) {
    // MSP 1.0 GA and later releases
    // Run the script that will generate sql scripts that would re-create the DB as it is
    buffer.append(" ### Call mysql dump script\n" +
    " " + dbBackupScript + "\n\n");
    else {
    // MSP Limited release
    // Add command to shutdown mysql
    buffer.append(" ### Shutdown mysql\n" + " /etc/init.d/mysql stop\n\n");
    // Change to root directory and create the tgz file
    buffer.append(" ### Create tgz file\n" + " cd /\n");
    // Build up the tar file name from the current date and time
    String fileName = null;
    if ((backupFileName != null) && (backupFileName.length() > 0))
    fileName = backupFileName;
    else {
    // File name not provided by user, build one using the timestamp
    Calendar cal = Calendar.getInstance();
    Date date = cal.getTime();
    fileName = "MSS-"
    + DateFormat.getDateInstance().format(date).replaceAll(" ", "").replaceAll(",", "")+ "-"
    + (new Time(cal.getTimeInMillis())).toString().replaceAll(":", "").substring(0,4);
    String tarFileName = fileName + ".tgz";
    // Get the current MSP Version
    String mspVersion = getMSPVersion();
    // Gather all the files to be backed up. Add them to the tar command and
    // also dump them into the file maintaining the list of files being backed up
    String listStr = "";
    for (int i=0; i<backupList.size(); i++)
    listStr += (String)backupList.get(i) + "\n";
    // Dump the current MSP version and the list of files being backed up into a manifest file
    String listFileName = fileName + BACKED_UP_LIST_FILE_NAME_SUFFIX;
    RandomAccessFile file = new RandomAccessFile(backupLocation + listFileName, "rw");
    m_logger.info("List of files/directories being backed up:\n" + listStr);
    file.writeBytes("### MSP Version: " + mspVersion + " ###\n");
    file.writeBytes(listStr);
    file.close();
    // Add the tar command to the script
    buffer.append(" echo \"Creating " + backupLocation + tarFileName + "...\"\n" +
    " tar cvhfz " + backupLocation + tarFileName + " `grep -v \"MSP Version:\" " +
    backupLocation + listFileName + "`\n\n");
    // Check if free space on the backup partition has reduced below the limit
    // If enough space left, backup is retained, "mss" is made the owner of the files,
    // "backup" is made the group the files belong to,
    // permissions changed to be "0660" and
    // backup action declared a success
    // Else, backup files are deleted and declared a failure
    buffer.append(" ### Check if the partition has enough space left\n" +
    //" diskLeft=`df -k | grep \"" + backupPartition + "\" | awk '{print $5}' | cut -d\"%\" -f1`\n" +
    " diskLeft=`df -k \"" + backupPartition + "\" | awk '{print $5}' | cut -d\"%\" -f1 | grep -v Use`\n" +
    " echo \"Partition " + backupPartition + " is $diskLeft% used.\"\n" +
    " if [ \"$diskLeft\" -gt \"" + backupPartitionLimit + "\" ]\n" +
    " then\n" +
    " ### Failure\n" +
    " echo \"Partition " + backupPartition + " does not have enough space.\"\n" +
    " echo \"Backup " + backupLocation + tarFileName + " will be removed.\"\n" +
    " rm -f " + backupLocation + fileName + "*\n" +
    " echo \"Backup Failed.\"\n" +
    " else\n" +
                        " tar tvzf " + backupLocation + tarFileName + " > /dev/null 2>&1\n" +
    " if [ ! -s " + backupLocation + tarFileName + " -o $? -ne 0 ] \n" +
                        " then\n" +
                        " echo \"MSP Backup operation is not successful. The tar file " + backupLocation + tarFileName + " contains errors.\"\n" +
                        " echo \"Please take the backup again\"\n" +
                        "     touch "+backupLocation+fileName+".err\n" +
    " else \n" +
    " ### Success\n" +
    " ### Change the owner, group and permissions for the backup files\n" +
    " chown mss " + backupLocation + fileName + "*\n" +
    " chgrp backup " + backupLocation + fileName + "*\n" +
    " chmod 0660 " + backupLocation + fileName + "*\n" +
    " echo \"Backup Completed.\"\n" +
    " fi\n" +
    " fi\n\n");
    // MSP Limited release and earlier builds re-start mysql. Starting
    // MSP 1.0 GA release, mysql is not stopped and so re-start is not
    // needed. sql scripts created by the dump script get packed into
    // the tar file and so are deleted.
    // Check if mysql dump creation script exists
    if (mysqlDumpScript.exists()) {
    // MSP 1.0 GA and later releases
    // Remove DB dump files
    buffer.append(" ### Remove DB Dump Files\n" + " rm -f " + dbDumpLocation + "*\n\n");
    else {
    // MSP Limited release
    // Start mysql
    buffer.append(" ### Start mysql\n" + " /etc/init

  • How can i call a jasper report from a java Application

    Hi,
    i am chiranjit , currently i working in a web based ERP project, in this project as a report building tool we are using JasperReport wih eclipse plugin . in eclipse report's are generating very well but i am unable to call that report from a java application because i have no idea about the How to call a Jasper Report from a Java Application . so please send me the necessary class names, jar files names and programe code as early as possible.
    Chiranjit

    Ahh, kind of a duplicate thread:
    http://forums.java.sun.com/thread.jspa?threadID=631642
    @OP. You could have clarified your original post and the relationship of your question to java. You did not need a new thread.
    � {�                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How can i call a VB6 project from my java application using JNI

    hi
    can anyone tell me the procedure of calling a VB6 project from any java application using JNI
    if anyone does know then tell me the detail procedure of doing that. I know that i have to create a dll of that VB6 project then to call it from the java application.
    if anyone know that procedure of creating dll file of an existing VB6 project please reply
    please if anyone know then let me know

    Ahh, kind of a duplicate thread:
    http://forums.java.sun.com/thread.jspa?threadID=631642
    @OP. You could have clarified your original post and the relationship of your question to java. You did not need a new thread.
    � {�                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to call a Java class from another java class ??

    Hi ..... can somebody plz tell me
    How to call a Java Class from another Java Class assuming both in the same Package??
    I want to call the entire Java Class  (not any specific method only........I want all the functionalities of that class)
    Please provide me some slotuions!!
    Waiting for some fast replies!!
    Regards
    Smita Mohanty

    Hi Smita,
    you just need to create an object of that class,thats it. Then you will be able to execute each and every method.
    e.g.
    you have developed A.java and B.java, both are in same package.
    in implementaion of B.java
    class B
                A obj = new A();
                 //to access A's methods
                 A.method();
                // to access A's variable
                //either
               A.variable= value.
               //or
               A.setvariable() or A.getvariable()

  • How to call a .jar file from a java bean?

    any body knows how to call a .jar file from a java bean?

    Crosspost!
    http://forum.java.sun.com/thread.jspa?messageID=4349619

  • Cannot call ANY stored functions from my Java program

    My problem is that I cannot call ANY stored procedure from my Java
    program. Here is the code for one of my stored procedures which runs
    very well in PL/SQL:
    PL/SQL code:
    CREATE OR REPLACE PACKAGE types AS
    TYPE cursorType IS REF CURSOR;
    END;
    CREATE OR REPLACE FUNCTION list_recs (id IN NUMBER)
    RETURN types.cursorType IS tracks_cursor types.cursorType;
    BEGIN
    OPEN tracks_cursor FOR
    SELECT * FROM accounts1
    WHERE id = row_number;
    RETURN tracks_cursor;
    END;
    variable c refcursor
    exec :c := list_recs(11)
    SQL> print c
    COLUMN1 A1 ROW_NUMBER
    rec_11 jacob 11
    rec_12 jacob 11
    rec_13 jacob 11
    rec_14 jacob 11
    rec_15 jacob 11
    Here is my Java code:
    import java.sql.*;
    import java.io.*;
    import oracle.jdbc.driver.*;
    class list_recs
    public static void main(String args[]) throws SQLException,
    IOException
    String query;
    CallableStatement cstmt = null;
    ResultSet cursor;
    // input parameters for the stored function
    String user_name = "jacob";
    // user name and password
    String user = "jnikom";
    String pass = "jnikom";
    DriverManager.registerDriver(new oracle.jdbc.OracleDriver());
    try { Class.forName ("oracle.jdbc.driver.OracleDriver"); }
    catch (ClassNotFoundException e)
    { System.out.println("Could not load driver"); }
    Connection conn =
    DriverManager.getConnection (
    "jdbc:oracle:thin:@10.52.0.25:1521:bosdev",user,pass);
    try
    String sql = "{ ? = call list_recs(?) }";
    cstmt = conn.prepareCall(sql);
    // Use OracleTypes.CURSOR as the OUT parameter type
    cstmt.registerOutParameter(1, OracleTypes.CURSOR);
    String id = "11";
    cstmt.setInt(2, Integer.parseInt(id));
    // Execute the function and get the return object from the call
    cstmt.executeQuery();
    ResultSet rset = (ResultSet) cstmt.getObject(1);
    while (rset.next())
    System.out.print(rset.getString(1) + " ");
    System.out.print(rset.getString(2) + " ");
    System.out.println(rset.getString(3) + " ");
    catch (SQLException e)
    System.out.println("Could not call stored function");
    e.printStackTrace();
    return;
    finally
    cstmt.close();
    conn.close();
    System.out.println("Stored function was called");
    Here is how I run it, using Win2K and Oracle9 on Solaris:
    C:\Jacob\Work\Java\Test\Vaultus\Oracle9i\FunctionReturnsResultset>java
    list_recs
    Could not call stored function
    java.sql.SQLException: ORA-00600: internal error code, arguments:
    [ttcgcshnd-1], [0], [], [], [], [], [], []
    at
    oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
    at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
    at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:543)
    at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1405)
    at oracle.jdbc.ttc7.TTC7Protocol.fetch(TTC7Protocol.java:889)
    at
    oracle.jdbc.driver.OracleStatement.<init>(OracleStatement.java:490)
    at
    oracle.jdbc.driver.OracleStatement.getCursorValue(OracleStatement.java:2661)
    at
    oracle.jdbc.driver.OracleStatement.getObjectValue(OracleStatement.java:4189)
    at
    oracle.jdbc.driver.OracleStatement.getObjectValue(OracleStatement.java:4123)
    at
    oracle.jdbc.driver.OracleCallableStatement.getObject(OracleCallableStatement.java:541)
    at list_recs.main(list_recs.java:42)
    C:\Jacob\Work\Java\Test\Vaultus\Oracle9i\FunctionReturnsResultset>
    Any help is greatly appreciated,
    Jacob Nikom

    Thank you for your suggestion.
    I tried it, but got the same result. I think the difference in the syntax is due to the Oracle versus SQL92 standard
    conformance. Your statament is the Oracle version and mine is the SQL92. I think both statements are acceptable
    by the Oracle.
    Regards,
    Jacob Nikom

  • HELP!!! Problem of Calling external Web Service from a Java Stored Procedur

    1.I read the topic on http://www.oracle.com/technology/sample_code/tech/java/jsp/samples/wsclient/Readme.html about Calling external Web Service from a Java Stored Procedur.
    2.After I import .jar to Oracle what is required by the topic,som error occued.
    Like: ORA-29521: javax/activation/ActivationDataFlavor class not found,
    ORA-29545: badly formed class.
    3.These is not enough .jar required on the topic? What can I do for ORA-29545: badly formed class?
    Thany you!

    Try this
    Re: HELP! Loading Java Classes into Oracle ERROR

  • How to call j2me emulator instance from a java program?

    hi,
    how to call j2me emulator instance from a java program?
    i tried public void startApp(){
    try{
    platformRequest("tel:+5550000");
    }catch(Exception e){
    e.printStackTrace();
    from a j2me midlet itself,
    but it gave illegal access exception.
    do i need any hardware phone connected to my pc?
    please help.

    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html
    import java.util.*;
    public class OpenExplorer{
    public static void main(String args[]){
         new OpenExplorer();
    public OpenExplorer(){
         try{
         String command = "explorer C:";
         // or String command = "cmd /c explorer C:";
         Runtime runtime = Runtime.getRuntime();
         Process process = runtime.exec(command);
         int exitVal = process.waitFor();
         System.out.println("Exit Value: " + exitVal);
         } catch(Exception e){
         e.printStackTrace();
    }

  • Need example of client requesting information from server

    I have a thick-client application that also acts as a server for remote clients.
    I have it set up so that they send messages to each other. The server can initiate action on the client and the client can initiate action on the server. All of my communication is essentially asynchronous.
    Now I want to start adding more transactional synchronous interactions, for instance:
    - User initiates action on client
    - Client gets data from server
    - Client uses that information to perform further action
    Is there a good example or tutorial for someone who hasn't done that before?

    If you want to keep it a J2SE app im not sure you can use JMS to do it, but would have to use RMI or just plain network programming, with lots of thread control.
    Anyhow if you would like to do it the easy way run a J2EE server, find a small one, but one that supports JMS (think one of the minimal installs of jboss might be good). Make a topic called messageExchange or somethign. Connect server/client to the topic. Can use MVC or something as a messagelistener. You can even persist the topic (DurableTopic) to log events to a database.
    This is a little job that requires little planning compared to setting up a thread hieracy with sockets flying all around. And easier than rmi.
    I have really never tought of using JMS in outside of an J2EE container, but there might be some plugins or api's that support this for J2SE.
    Thomas

  • Launching a java application from another java application

    Hi,
    I'm facing an interesting challenge :-)
    Inside a Java application, I want to start another java application.
    Possible solutions in my list :
    1. Using jakarta commons launcher.
    2. Runtime.exec (make the code platform dependent).
    3. Starting the main method of the other app by create a new Thread inside the current app
    4. I know people did this by calling an ant target from the java application but I don't have
    any sample code, I appreciate any sample code for it.
    Thanks,
    Ali Salehi

    That is an iteresting challenge :)Don't be mean; he's polite, done some investigation and taken the trouble to be clear. The question, presumably, is "has anyone got a different solution or a preference as to which of these is the best?"
    In which case, my advice would be to say that invoking main in a separate thread is fundamentally different from Runtime.exec() because the former would run in the same JVM. Is this what you want? If one app has the other on its classpath then do they need to be separate apps? Could they be modules of a single app?

  • How to start java.exe from a java program in windows ?

    Hi,
    I did like to know, if its possible to run java.exe from a java program on windows ? The java.exe should be visible from checking the processes that are currently running using the Task Manager on windows.

    Runtime.getRuntime().exec("java Sample");

  • Trying to compile a .java file from another .java file

    Hello,
    I'm trying to compile a .java file from another .java file using Runtime.exec...
    String c[]=new String[3];
    c[0]="cmd.exe"; c[1]="/c" ; c[2]="javac Hello.java";
    Process p=Runtime.exec(c);
    If anyone can help me in atleast getting the command prompt when Runtime.exec("cmd.exe") is executed...that would be great...I tried out notepad.exe, calc, explorer instead of cmd.exe...all the commands display their respective windows..except cmd.exe...the command prompt doesnt appear...
    Please help me ASAP....
    Thanks for your help in advance...
    Regards.
    AKhila.

    try this. ur code will be compliled and will get .class file. but console won't appear. is it a must for u?
    public class Exec{
         public static void main(String a[]) throws Exception{
              String c[]=new String[3];
              c[0]="cmd.exe"; c[1]="/c" ; c[2]="javac Hello.java";
              Process p=Runtime.getRuntime().exec(c);
              // or Runtime.getRuntime().exec("javac Hello.java");

Maybe you are looking for