How to insert message in OC4J JMS from standalone java client.

Hi,
I have been following available examples for creating standalone java clients to insert messages in JMS queues.
I am able to insert using java client when the SOA suite and the standalone java code are on same machine.
package producerconsumerinjava;
import javax.jms.*;
import javax.naming.*;
import java.util.Hashtable;
public class QueueProducer
public static void main(String[] args)
String queueName = "jms/demoQueue";
String queueConnectionFactoryName = "jms/QueueConnectionFactory";
Context jndiContext = null;
QueueConnectionFactory queueConnectionFactory = null;
QueueConnection queueConnection = null;
QueueSession queueSession = null;
Queue queue = null;
QueueSender queueSender = null;
TextMessage message = null;
int noMessages = 5;
* Set the environment for a connection to the OC4J instance
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, "oracle.j2ee.rmi.RMIInitialContextFactory");
env.put(Context.SECURITY_PRINCIPAL, "oc4jadmin");
env.put(Context.SECURITY_CREDENTIALS, "mypass");
env.put(Context.PROVIDER_URL,"ormi://myserver.company.com:12402"); //12402 is the rmi port
* Set the Context Object.
* Lookup the Queue Connection Factory.
* Lookup the JMS Destination.
try
jndiContext = new InitialContext(env);
queueConnectionFactory =
(QueueConnectionFactory) jndiContext.lookup(queueConnectionFactoryName);
queue = (Queue) jndiContext.lookup(queueName);
catch (NamingException e)
System.out.println("JNDI lookup failed: " + e.toString());
System.exit(1);
* Create connection.
* Create session from connection.
* Create sender.
* Create text message.
* Send messages.
* Send non text message to end text messages.
* Close connection.
try
queueConnection = queueConnectionFactory.createQueueConnection();
queueSession =
queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
queueSender = queueSession.createSender(queue);
message = queueSession.createTextMessage();
for (int i = 0; i < noMessages; i++)
message.setText("Message " + (i + 1));
System.out.println("Producing message: " + message.getText());
queueSender.send(message);
queueSender.send(queueSession.createBytesMessage());
catch (JMSException e)
System.out.println("Exception occurred: " + e.toString());
finally
if (queueConnection != null)
try
queueConnection.close();
catch (JMSException e)
System.out.println("Closing error: " + e.toString());
But when the SOA Suite is remote, I am struggling to get the settings correct
Till now, here is what I have figured out from looking at blogs/tars etc on the Net:
1. I need to use ApplicationClientInitialContextFactory instead of RMIInitialContextFactory (http://download.oracle.com/docs/cd/E14101_01/doc.1013/e13975/jndi.htm)
2. The project should have a META-INF/application-client.xml file, which may be dummy (http://www.wever.org/java/space/Oracle/JmsTar1). Question is, my code is there in a single absolutely standalone code..how I can use this application-client.xml and where it has to be placed.
Errors:
When trying to run exact same code on local server that tries to enqueue JMS on remotee serverer
Exception occurred: javax.jms.JMSException: Unable to create a connection to "xxxxxxx.yyyyyy01.dev.com/10.42.456.11:12,602" as user "null".
Any help is greatly welcome.
As an exercise, I copied this complete code on the server and then ran locally using a telnet client...it worked. So the problem is coming when accessing the server remotely.
Rgds,
Amit

1. I need to use ApplicationClientInitialContextFactory instead of RMIInitialContextFactoryNot necessarily.
2. The project should have a META-INF/application-client.xml fileThat's only necessary if going the ApplicationClientInitialContextFactory route.
There are two types of JMS client applications you can write -- a pure/plain Java app, and an "AppClient". That first is your everyday run-of-the-mill Java application, nothing special. That latter is a special, complicated beast that tries to act as a part of the whole client/server/J2EE architecture which provides you with a semi-managed environment. Either can be made to work, but if all you need is JMS access (using plain OC4J JMS factory/queue names and not JMS Connector names), then the first is easier to get working (and performs a tiny bit better as well due to being a lighter-weight solution).
I think the problem you are having might be: When you use the plain Java client solution, you do not have any type of management, and that includes user management. With no user management (and if the JMS server is not configured to allow anonymous connections) you need to include the username and password in the call to createConnection. (I think it may be that this is actually true in the AppClient case as well -- I avoid using the AppClient model as much as possible so my memory there is weaker.)
If you prefer to go the AppClient route, I would point you to a demo I wrote which had a functioning example, but Oracle seems to have removed it (and all of the 10.1.3 demos?) from OTN. :-(
Hmm, it seems to still be available on the wayback machine:
http://web.archive.org/web/20061021064014/www.oracle.com/technology/tech/java/oc4j/1013/how_to/index.html
(Just look down the page for "With OEMS JMS (In-Memory and File-Based)" -- there is an .html document with info, and there is a .zip file with source code.)
Question is, my code is there in a single absolutely standalone code..how I can use this application-client.xml and where it has to be placed.The app client in my demo had the following directory structure:
myjavaclient.class
jndi.properties
META-INF\MANIFEST.MF
META-INF\application-client.xml
META-INF\orion-application-client.xml
When you use ApplicationClientInitialContextFactory I think it just looks under .\META-INF for the .xml files.
-Jeff

Similar Messages

  • Error in oim Role creation using Role Manager Service API from Standalone Java client

    Hi,
      Facing the following error when trying to create Role using Role Manager Service API from a standalone java client .
    Tried with the solution of changing ,
    Login into the Web Logic Admin Console --> Servers --> OIM Server --> Protocols --> Modify the Maximum Message from 100000000 to 1000000000, but still the problem persists.
    Exception in thread "main" org.omg.CORBA.BAD_PARAM:   vmcid: 0x0  minor code: 0  completed: No
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at java.lang.Class.newInstance0(Unknown Source)
    at java.lang.Class.newInstance(Unknown Source)
    at com.sun.corba.se.impl.protocol.giopmsgheaders.MessageBase.getSystemException(Unknown Source)
    at com.sun.corba.se.impl.protocol.giopmsgheaders.ReplyMessage_1_2.getSystemException(Unknown Source)
    at com.sun.corba.se.impl.protocol.CorbaMessageMediatorImpl.getSystemExceptionReply(Unknown Source)
    at com.sun.corba.se.impl.protocol.CorbaClientRequestDispatcherImpl.processResponse(Unknown Source)
    at com.sun.corba.se.impl.protocol.CorbaClientRequestDispatcherImpl.marshalingComplete(Unknown Source)
    at com.sun.corba.se.impl.protocol.CorbaClientDelegateImpl.invoke(Unknown Source)
    at org.omg.CORBA.portable.ObjectImpl._invoke(Unknown Source)
    at com.sun.org.omg.SendingContext._CodeBaseStub.meta(Unknown Source)
    at com.sun.corba.se.impl.encoding.CachedCodeBase.meta(Unknown Source)
    at com.sun.corba.se.impl.io.IIOPInputStream.getOrderedDescriptions(Unknown Source)
    at com.sun.corba.se.impl.io.IIOPInputStream.inputObjectUsingFVD(Unknown Source)
    at com.sun.corba.se.impl.io.IIOPInputStream.simpleReadObject(Unknown Source)
    at com.sun.corba.se.impl.io.ValueHandlerImpl.readValueInternal(Unknown Source)
    at com.sun.corba.se.impl.io.ValueHandlerImpl.readValue(Unknown Source)
    at com.sun.corba.se.impl.encoding.CDRInputStream_1_0.read_value(Unknown Source)
    at com.sun.corba.se.impl.encoding.CDRInputStream.read_value(Unknown Source)
    at oracle.iam.identity.rolemgmt.api._RoleManager_ogut7n_RoleManagerRemoteRIntf_Stub.createx(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.invoke(RemoteBusinessIntfProxy.java:85)
    at $Proxy2.createx(Unknown Source)
    at oracle.iam.identity.rolemgmt.api.RoleManagerDelegate.create(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at Thor.API.Base.SecurityInvocationHandler$1.run(SecurityInvocationHandler.java:68)
    at weblogic.security.subject.SubjectProxy.doAs(SubjectProxy.java:64)
    at weblogic.security.subject.SubjectManager.runAs(SubjectManager.java:262)
    at weblogic.security.Security.runAs(Security.java:48)
    at Thor.API.Security.LoginHandler.weblogicLoginSession.runAs(weblogicLoginSession.java:52)
    at Thor.API.Base.SecurityInvocationHandler.invoke(SecurityInvocationHandler.java:79)
    at $Proxy3.create(Unknown Source)
    at com.idm.role.CreateRole.createRole(CreateRole.java:113)
    at com.idm.role.CreateRole.main(CreateRole.java:167)
    Thanks In Advance

    Hi , I have used OIM 11g  R2.
    Please find below the code we have used,
    package com.idm.role;
    import java.util.HashMap;
    import java.util.HashSet;
    import java.util.Hashtable;
    import java.util.Iterator;
    import java.util.Set;
    import java.util.logging.Logger;
    import javax.security.auth.login.LoginException;
    import oracle.iam.identity.exception.NoSuchRoleException;
    import oracle.iam.identity.exception.RoleAlreadyExistsException;
    import oracle.iam.identity.exception.RoleCreateException;
    import oracle.iam.identity.exception.RoleLookupException;
    import oracle.iam.identity.exception.RoleModifyException;
    import oracle.iam.identity.exception.SearchKeyNotUniqueException;
    import oracle.iam.identity.exception.ValidationFailedException;
    import oracle.iam.identity.rolemgmt.api.RoleManager;
    import oracle.iam.identity.rolemgmt.api.RoleManagerConstants;
    import oracle.iam.identity.rolemgmt.vo.Role;
    import oracle.iam.platform.OIMClient;
    import oracle.iam.platform.authz.exception.AccessDeniedException;
    public class CreateRole {
    private final static Logger LOGGER = Logger.getLogger(CreateRole.class .getName());
    OIMClient oimClient = null;
    public OIMClient connectToOIM() {
      LOGGER.info("In connectToOIM ");
      Hashtable env = new Hashtable();
      env.put(OIMClient.JAVA_NAMING_FACTORY_INITIAL,
        "weblogic.jndi.WLInitialContextFactory");
      env.put(OIMClient.JAVA_NAMING_PROVIDER_URL,
        "t3://V-hydidm1.itig.co.in:14000");
      System.setProperty("java.security.auth.login.config",
        "F:\\Projects\\IDM\\Team\\Env_setup\\OIM_Setup\\designconsole\\config\\authwl.conf");
      System.setProperty("java.security.policy",
        "F:\\Projects\\IDM\\Team\\Env_setup\\OIM_Setup\\designconsole\\config\\xl.policy");
      System.setProperty("OIM.AppServerType", "wls");
      System.setProperty("APPSERVER_TYPE", "wls");
      System.setProperty("weblogic.Name", "oim_server1");
      oimClient = new OIMClient(env);
      try {
       oimClient.login("xelsysadm", "Passw0rd".toCharArray());
      } catch (LoginException e) {
       e.printStackTrace();
      System.out.println("Connected");
      return oimClient;
    public void readRoleMetadata() {
      LOGGER.info("in readRoleMetadata ");
      RoleManager roleManagerService = oimClient
        .getService(RoleManager.class);
      try {
       Role roleVo = roleManagerService.getDetails(
         RoleManagerConstants.ROLE_DISPLAY_NAME, "API Role1", null);
       Set attributeNameSet = roleVo.getAttributeNames();
       Iterator it = attributeNameSet.iterator();
       while (it.hasNext()) {
        System.out.println("Attribute Name :: " + it.next());
       // roleVo.setAttribute("ADentitlements", "Security Admin access");
       String adEntitlements = "" + roleVo.getAttribute("ADentitlements");
       System.out.println("AD Entitlements :: " + adEntitlements);
       System.out.println("DB Entitlements :: " + ""
         + roleVo.getAttribute("DBEntitlements"));
       System.out.println("Unix Entitlements :: " + ""
         + roleVo.getAttribute("UnixWindows"));
       System.out.println("VPN :: " + "" + roleVo.getAttribute("VPN"));
      } catch (SearchKeyNotUniqueException e) {
       e.printStackTrace();
      } catch (NoSuchRoleException e) {
       e.printStackTrace();
      } catch (RoleLookupException e) {
       e.printStackTrace();
      } catch (AccessDeniedException e) {
       e.printStackTrace();
    public void createRole() {
      LOGGER.info(" in Create role ");
      RoleManager roleManagerService = oimClient
        .getService(RoleManager.class);
      HashMap<String, Object> roleCreationAttrMap = new HashMap<String, Object>();
      roleCreationAttrMap.put(RoleManagerConstants.ROLE_NAME, "API Role1");
      roleCreationAttrMap.put(RoleManagerConstants.ROLE_DESCRIPTION,
        "This Role is created using API Role1");
      roleCreationAttrMap.put(RoleManagerConstants.ROLE_DISPLAY_NAME,
        "API Role1");
      roleCreationAttrMap.put("ADentitlements", "API Role1 AD Entitlements");
      roleCreationAttrMap.put("DBEntitlements", "API Role1 DB Entitlements");
      roleCreationAttrMap.put("VPN", "No");
      roleCreationAttrMap.put("UnixWindows", "API Role1 Unix Entitlements");
      Role roleVo = new Role(roleCreationAttrMap);
      try {
       System.out.println(" Before Create role *********************************************");
       roleManagerService.create(roleVo);
       System.out.println("Role Created .. ");
      } catch (ValidationFailedException e) {
       e.printStackTrace();
      } catch (RoleAlreadyExistsException e) {
       e.printStackTrace();
      } catch (RoleCreateException e) {
       e.printStackTrace();
      } catch (AccessDeniedException e) {
       e.printStackTrace();
    public void modifyRole() {
      LOGGER.info(" in modifyRole ");
      RoleManager roleManagerService = oimClient
        .getService(RoleManager.class);
      Role roleVo;
      try {
       roleVo = roleManagerService.getDetails(
         RoleManagerConstants.ROLE_DISPLAY_NAME, "API Role1", null);
       String roleKey = roleVo.getEntityId();
       HashMap<String, Object> roleCreationAttrMap = new HashMap<String, Object>();
       roleCreationAttrMap.put("ADentitlements",
         "Updated API Role1 AD Entitlements");
       Set roleKeySet = new HashSet<String>();
       roleKeySet.add(roleKey);
       Role roleVoNew = new Role(roleCreationAttrMap);
       roleManagerService.modify(roleKeySet, roleVoNew);
       System.out.println("Role Modified ..");
      } catch (SearchKeyNotUniqueException e) {
       e.printStackTrace();
      } catch (NoSuchRoleException e) {
       e.printStackTrace();
      } catch (RoleLookupException e) {
       e.printStackTrace();
      } catch (AccessDeniedException e) {
       e.printStackTrace();
      } catch (ValidationFailedException e) {
       e.printStackTrace();
      } catch (RoleModifyException e) {
       e.printStackTrace();
    public static void main(String args[]) {
      CreateRole miscObj = new CreateRole();
      miscObj.connectToOIM();
      miscObj.createRole();
      //miscObj.readRoleMetadata();
    Thanks In Advance .

  • How do I call a JCA Adapter from a Java Client?

    I was able to call an EJB that I deployed on the OC4J server from a client that sat outside the OC4J server. I am now trying to use a similar client for the jca adapter but I keep getting errors. I'm trying to use the adapter to send XML by calling the execute method in the cciInteraction class? Can I simply create a client as I am doing, capture the adapter and call a class contained in it? What am I getting this error below?
    Mike
    Code
    package milo;
    import com.ariba.asc.jcaadapter.CCIConnection;
    import com.sun.corba.se.impl.javax.rmi.PortableRemoteObject;
    import java.util.Hashtable;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    import com.ariba.asc.jcaadapter.sample.ra.OutboundClientInteraction;
    import javax.activation.DataSource;
    import javax.annotation.Resource;
    import javax.jms.ConnectionFactory;
    public class ResourceAdapterClient {
    public static void main(String [] args) {
    try {
    Context initialContext = getInitialContext();
    javax.resource.cci.ConnectionFactory cf = (javax.resource.cci.ConnectionFactory)initialContext.lookup("eis/jca/standaloneEIS");
    } catch (Exception ex) {
    ex.printStackTrace();
    private static Context getInitialContext() throws NamingException {
    Hashtable env = new Hashtable();
    // Standalone OC4J connection details
    env.put( Context.INITIAL_CONTEXT_FACTORY, "oracle.j2ee.rmi.RMIInitialContextFactory" );
    env.put( Context.SECURITY_PRINCIPAL, "oc4jadmin" );
    env.put( Context.SECURITY_CREDENTIALS, "oc4jadmin" );
    env.put(Context.PROVIDER_URL, "ormi://ga011hds.unix.us.ups.com:12401/EAR");
    return new InitialContext( env );
    Error:
    Apr 16, 2010 4:21:12 PM oracle.j2ee.rmi.RMIMessages EXCEPTION_ORIGINATES_FROM_THE_REMOTE_SERVER
    WARNING: Exception returned by remote server: {0}
    java.lang.ExceptionInInitializerError
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Class.java:242)
         at com.evermind.io.ClassLoaderObjectInputStream.resolveClass(ClassLoaderObjectInputStream.java:58)
         at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1538)
         at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1460)
         at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1693)
         at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
         at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
         at com.evermind.server.rmi.RMIClientConnection.handleLookupResponse(RMIClientConnection.java:948)
         at com.evermind.server.rmi.RMIClientConnection.handleOrmiCommandResponse(RMIClientConnection.java:349)
         at com.evermind.server.rmi.RMIClientConnection.dispatchResponse(RMIClientConnection.java:305)
         at com.evermind.server.rmi.RMIClientConnection.processReceivedCommand(RMIClientConnection.java:287)
         at com.evermind.server.rmi.RMIConnection.handleCommand(RMIConnection.java:157)
         at com.evermind.server.rmi.RMIConnection.listenForOrmiCommands(RMIConnection.java:131)
         at com.evermind.server.rmi.RMIConnection.run(RMIConnection.java:107)
         at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:825)
         at java.lang.Thread.run(Thread.java:595)
    Caused by: java.lang.IllegalStateException: The Adapter specific implementation configuration is not initialized
         at com.ariba.asc.jcaadapter.impl.AdapterImplManager.getAdapterImplConfiguration(AdapterImplManager.java:232)
         at com.ariba.asc.connector.log.LogManager.initFactory(LogManager.java:40)
         at com.ariba.asc.connector.log.LogManager.getLogger(LogManager.java:33)
         at com.ariba.asc.jcaadapter.CCIConnectionFactory.<clinit>(CCIConnectionFactory.java:46)
         ... 17 more
    javax.naming.NamingException: Lookup error: javax.naming.NamingException [Root exception is java.lang.ExceptionInInitializerError]; nested exception is:
         javax.naming.NamingException [Root exception is java.lang.ExceptionInInitializerError] [Root exception is javax.naming.NamingException [Root exception is java.lang.ExceptionInInitializerError]]
         at com.evermind.server.rmi.RMIClientContext.lookup(RMIClientContext.java:72)
         at javax.naming.InitialContext.lookup(InitialContext.java:351)
         at milo.SessionEJBClient.main(SessionEJBClient.java:30)
    Caused by: javax.naming.NamingException [Root exception is java.lang.ExceptionInInitializerError]
         at com.evermind.server.rmi.RMICall.throwRecordedException(RMICall.java:100)
         at com.evermind.server.rmi.RMIClientConnection.waitForJndiResponse(RMIClientConnection.java:442)
         at com.evermind.server.rmi.RMIClientConnection.lookup(RMIClientConnection.java:236)
         at com.evermind.server.rmi.RMIClient.lookup(RMIClient.java:302)
         at com.evermind.server.rmi.RMIClientContext.lookup(RMIClientContext.java:59)
         ... 2 more
    Caused by: java.lang.ExceptionInInitializerError
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Class.java:242)
         at com.evermind.io.ClassLoaderObjectInputStream.resolveClass(ClassLoaderObjectInputStream.java:58)
         at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1538)
         at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1460)
         at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1693)
         at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
         at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
         at com.evermind.server.rmi.RMIClientConnection.handleLookupResponse(RMIClientConnection.java:948)
         at com.evermind.server.rmi.RMIClientConnection.handleOrmiCommandResponse(RMIClientConnection.java:349)
         at com.evermind.server.rmi.RMIClientConnection.dispatchResponse(RMIClientConnection.java:305)
         at com.evermind.server.rmi.RMIClientConnection.processReceivedCommand(RMIClientConnection.java:287)
         at com.evermind.server.rmi.RMIConnection.handleCommand(RMIConnection.java:157)
         at com.evermind.server.rmi.RMIConnection.listenForOrmiCommands(RMIConnection.java:131)
         at com.evermind.server.rmi.RMIConnection.run(RMIConnection.java:107)
         at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:825)
         at java.lang.Thread.run(Thread.java:595)
         at com.evermind.server.rmi.RMICall.warningExceptionOriginatesFromTheRemoteServer(RMICall.java:109)
         at com.evermind.server.rmi.RMICall.throwRecordedException(RMICall.java:91)
         ... 6 more
    Caused by: java.lang.IllegalStateException: The Adapter specific implementation configuration is not initialized
         at com.ariba.asc.jcaadapter.impl.AdapterImplManager.getAdapterImplConfiguration(AdapterImplManager.java:232)
         at com.ariba.asc.connector.log.LogManager.initFactory(LogManager.java:40)
         at com.ariba.asc.connector.log.LogManager.getLogger(LogManager.java:33)
         at com.ariba.asc.jcaadapter.CCIConnectionFactory.<clinit>(CCIConnectionFactory.java:46)
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Class.java:242)
         at com.evermind.io.ClassLoaderObjectInputStream.resolveClass(ClassLoaderObjectInputStream.java:58)
         at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1538)
         at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1460)
         at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1693)
         at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
         at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
         at com.evermind.server.rmi.RMIClientConnection.handleLookupResponse(RMIClientConnection.java:948)
         at com.evermind.server.rmi.RMIClientConnection.handleOrmiCommandResponse(RMIClientConnection.java:349)
         at com.evermind.server.rmi.RMIClientConnection.dispatchResponse(RMIClientConnection.java:305)
         at com.evermind.server.rmi.RMIClientConnection.processReceivedCommand(RMIClientConnection.java:287)
         at com.evermind.server.rmi.RMIConnection.handleCommand(RMIConnection.java:157)
         at com.evermind.server.rmi.RMIConnection.listenForOrmiCommands(RMIConnection.java:131)
         at com.evermind.server.rmi.RMIConnection.run(RMIConnection.java:107)
         at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:825)
         at java.lang.Thread.run(Thread.java:595)
    Process exited with exit code 0.

    Can anyone help?
    Mike

  • How to send  a request to servlet from a java client.

    I called a servlet from java client using URL object.
    I could establish a connection with server and display
    the content(like req.getservername etc.,)
    of servlet on client side(DOS prompt).
    My question is how do i send a request to servlet from the client.
    let me say, i have to send a value as 10 to servlet and do some processing
    ( like 10*2 = 20) display the output (20) on client side..
    It will be appreciated if u can mention the syntax...

    just add the query string to the url you use to create the URL object from.

  • Produce Message to AQ Queue using standalone Java client in Oracle 11g FMW

    I have a Java client that creates a TextMessage and tries to post it to AQ queue using the server context. Please find the sample code below:
    QueueSession jmsSession = null;
    QueueConnection queueConnection = null;
    try {
    Properties parm = new Properties();
    parm.setProperty("java.naming.factory.initial","weblogic.jndi.WLInitialContextFactory");
    parm.setProperty("java.naming.provider.url","t3://10.209.125.23:8001");
    parm.setProperty("java.naming.security.principal","weblogic");
    parm.setProperty("java.naming.security.credentials","weblogic1");
    Context ctx = new InitialContext(parm);
    System.out.println("Weblogic Initial Context obtained : " + ctx);
    //DataSource ds = (DataSource)ctx.lookup(datasourceJNDI);
    QueueConnectionFactory queueConnfactory = (QueueConnectionFactory)ctx.lookup(QCF) ;
    System.out.println("QueueConnectionFactory from QCF jndi lookup : " + queueConnfactory);
    queueConnection = queueConnfactory.createQueueConnection();
    System.out.println("QueueConnection obtained : " + queueConnection);
    //Make QueueSession
    jmsSession = queueConnection.createQueueSession(true, Session.AUTO_ACKNOWLEDGE);
    System.out.println("QueueSession obtained : " + jmsSession);
    //Start QueueConnection else no messages will be delivered
    queueConnection.start();
    Queue aqQueue = (Queue)ctx.lookup(QUEUE_JNDI);
    System.out.println("Queue obtained from lookup: " + aqQueue);
    QueueSender sender = ((AQjmsSession)jmsSession).createSender(aqQueue);
    System.out.println("QueueSender obtained: " + sender);
    File file = new File("C:
    Documents and Settings\\Apara\\Desktop\\EH_Mig\\development
    Resub.xml");
    XmlObject object = XmlObject.Factory.parse(file);
    String payloadString = object.toString();
    System.out.println("Message to be sent : " + payloadString);
    Message message = jmsSession.createTextMessage(payloadString);
    sender.send(message);
    jmsSession.commit();
    System.out.println("Message sent : " + message.toString());
    catch(Exception ex) {
    ex.printStackTrace();
    finally {
    if (jmsSession != null)
    jmsSession.close();
    if (queueConnection != null)
    queueConnection.stop();
    queueConnection.close();
    The code gives a runtime exception when it reaches the statement sender.send() as below :
    weblogic.rmi.extensions.RemoteRuntimeException: Unexpected Exception
    at weblogic.jdbc.rmi.internal.ConnectionImpl_weblogic_jdbc_wrapper_JTAConnection_weblogic_jdbc_wrapper_XAConnection_oracle_jdbc_driver_LogicalConnection_1032_WLStub.physicalConnectionWithin(Unknown Source)
    at weblogic.jdbc.rmi.SerialConnection_weblogic_jdbc_rmi_internal_ConnectionImpl_weblogic_jdbc_wrapper_JTAConnection_weblogic_jdbc_wrapper_XAConnection_oracle_jdbc_driver_LogicalConnection_1032_WLStub.physicalConnectionWithin(Unknown Source)
    at oracle.sql.TypeDescriptor.setPhysicalConnectionOf(TypeDescriptor.java:817)
    at oracle.sql.TypeDescriptor.<init>(TypeDescriptor.java:622)
    at oracle.sql.StructDescriptor.<init>(StructDescriptor.java:317)
    at oracle.sql.StructDescriptor.createDescriptor(StructDescriptor.java:200)
    at oracle.sql.StructDescriptor.createDescriptor(StructDescriptor.java:168)
    at oracle.sql.StructDescriptor.createDescriptor(StructDescriptor.java:137)
    at oracle.jpub.runtime.MutableStruct.toDatum(MutableStruct.java:113)
    at oracle.jms.AQjmsGenMessage_C.toDatum(AQjmsGenMessage_C.java:46)
    at oracle.jms.AQjmsProducer.jdbcEnqueue(AQjmsProducer.java:1027)
    at oracle.jms.AQjmsProducer.send(AQjmsProducer.java:747)
    at oracle.jms.AQjmsProducer.send(AQjmsProducer.java:517)
    at co.uk.morrisons.errorhospital.util.QueueTest.sendMessageUsingServerContextAndQCF(QueueTest.java:245)
    at co.uk.morrisons.errorhospital.util.QueueTest.main(QueueTest.java:293)
    Caused by: java.rmi.MarshalException: error marshalling return; nested exception is:
    java.io.NotSerializableException: oracle.jdbc.driver.T4CConnection
    at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:234)
    at weblogic.rmi.internal.BasicRemoteRef.invoke(BasicRemoteRef.java:223)
    ... 15 more
    Caused by: java.io.NotSerializableException: oracle.jdbc.driver.T4CConnection
    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1156)
    at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
    at weblogic.rjvm.MsgAbbrevOutputStream.writeObject(MsgAbbrevOutputStream.java:618)
    at weblogic.utils.io.ChunkedObjectOutputStream.writeObject(ChunkedObjectOutputStream.java:63)
    at weblogic.jdbc.rmi.internal.ConnectionImpl_weblogic_jdbc_wrapper_JTAConnection_weblogic_jdbc_wrapper_XAConnection_oracle_jdbc_driver_LogicalConnection_WLSkel.internalInvoke2(Unknown Source)
    at weblogic.jdbc.rmi.internal.ConnectionImpl_weblogic_jdbc_wrapper_JTAConnection_weblogic_jdbc_wrapper_XAConnection_oracle_jdbc_driver_LogicalConnection_WLSkel.internalInvoke1(Unknown Source)
    at weblogic.jdbc.rmi.internal.ConnectionImpl_weblogic_jdbc_wrapper_JTAConnection_weblogic_jdbc_wrapper_XAConnection_oracle_jdbc_driver_LogicalConnection_WLSkel.invoke(Unknown Source)
    at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:589)
    at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:477)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
    at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:473)
    at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    I am using a ForeignServer configuration which is targeted to a JMS Server. This a Weblogic 10.3.2 feature. Please see if you can help me to enqueue the message.
    Thanks,
    Aparajeeta

    It finally got resolved with help from Edwin Biemond and Oracle docs. I have made a blog out of it @
    http://technicknacks.blogspot.com
    Edited by: oraaps on Mar 26, 2010 5:33 PM

  • How to invoke a proxy service from a java client

    Hi all,
    how could I invoke a proxy service from a java client ?
    The proxy service type is 'any xml service' with http protocol.
    For a proxy with web service type I can export the related WSDL and generate the java client source.
    With 'any xml service' there is no associated wsdl and I'm wondering how to do that.
    Thanks
    ferp

    Hi Ferp,
    I used ClientGEN to generate client files from WSDL deployed in ALSB. You can also use Axis for client file generation.
    You need to know the WSDL URL. Generate Client files from WSDL URL.
    Sample ANT Script
    <project name="simple-web" default="mytask" basedir=".">
    <taskdef name="clientgen" classname="weblogic.wsee.tools.anttasks.ClientGenTask" classpath="C:\bea92\weblogic92\server\lib\weblogic.jar"/>
    <target name="mytask" description="Generate web service client">
              <clientgen wsdl="http://<hostname>:<port>/URL?WSDL"
         destDir="src"
         packageName="com.client.mytask"
         classpath="${java.class.path}" />
         </target>
    </project>
    Use the following JAVA Code,
    try {
         ActivationService service = new ActivationService_Impl("http://<hostname>:<port>/url?WSDL");
    client = service.getActivationServicePort();
    } catch (Exception ex) {
    // Handle Exception
    client.activateNumber();
    Let me know if you need any more information.
    Thanks,
    Suman.

  • How to integrate USSD Aggregator with JMS from Brand mobiliser

    Please help me to come out of this problem (How to integrate USSD Aggregator with JMS from Brand mobiliser)

    Dear jeevan,
    Step 1: Login into Brand mobiliser
    Step 2: Under Work space Administration configure JMS channel manager.
    Step 3: Use work space outbound channel as JMS.
    Step 4: write JMS api to process inbound and outbound queues.

  • Urgent, how to insert un Idoc (already created)  from outside of SAP

    Hi to all,
    I would like to know how to insert an Idoc (alresdy created) from outside of a SAP environnement into SAP.
    I know via the code we20 we could insert an Idoc into SAP, does someone have a file PDF to explique how to do it step by step plz?
    or could you reply it in details step by step?
    caz we are doing a project and we know almost nothing about it, but we need the information urgent.
    Tks in advance

    Hi,
    i think you have missed some of the some of the columns having NOT NULL constraint.ex:Who Columns..
    Please check the same in the table..
    Thanks
    Bharat

  • How to insert ur own documentaion text from harddisk to sapscript

    how to insert ur own documentaion text from harddisk to sapscript

    You should upload this standard text to SO10,  then you can simply include it into your sapscript.
    Regards,
    RIch Heilman

  • How to call a text FTP proxy service from a Java client ?

    Greetings,
    I've configured a text FTP proxy service which downloads files from a FTP server. It pols a directory on the FTP server and, as soon as a file respecting a given pattern apears it is downloaded. I tested the service in the test console and by putting some test files onto the FTP server. Now, I need to be able to test it from a Java client. How may I do that ? I need to write a Java client to connect to the OSB and to tell to it to use the FTP proxy in order to download a given file, from a given location and to put it in a given location on the client machine. Many thanks in advance for any help. A sample would be great !
    Kind regards,
    Nicolas

    Ok, I understand. The crucial question here is "what is a caller that you refer to?"
    Don't get me wrong, but the problem here is that you probably don't understand, what OSB is good for. OSB is an event-driven system. The event in your case is a new message in remote FTP server. You have to define what should happen when that event is fired. And that's all. You don't have to involve other client (or caller) for this case.
    You should define your FTP proxy to retrieve all relevant files from FTP server and then you should route them based on their name/content/encoding/whatever to different consumers. You can also have many proxies if you want - one for each name. It's up to you. But you don't have any "callers" in either case.

  • How do I pass an error status from my java code back to the Program Job Ser

    How do I pass an error status from my java code back to the Program Job Server?
    I have a jar program object that reports a scheduled status of "Success" even if the java code errors out.

    Exceptions thrown from the program object are ignored by the program job server.
    You need to configure the Program Object, then stream out a special string sequence to the stdout of the Program Object, to set the scheduled instance status to Failed.
    Look up SAP KBase  1201804 - How to programmatically set the status of a Program object to "Failed"
    Sincerely,
    Ted Ueda

  • Looking up EJBs from a java client

    While trying to migrate my application from standalone-oc4j
    to Oracle Application Server 10g, I ran into the following problem.
    My application has a stateless session bean. When trying to lookup the bean (from a java client), I get the following exception:
    javax.naming.NamingException: Lookup error: javax.naming.AuthenticationException
    Invalid username/password for UnifyoccEAR (ias_admin)
    My code used the username/password I used to log into web-based console (which I used to deploy the application). The lookup code follows:
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY,
    OracleJASLayer.INITIAL_CONTEXT_FACTORY);
    env.put(Context.PROVIDER_URL, "ormi://localhost:3201/UnifyoccEAR");
    env.put(Context.SECURITY_AUTHENTICATION, "simple");
    env.put(Context.SECURITY_PRINCIPAL, username);
    env.put(Context.SECURITY_CREDENTIALS, password);
    Context ctx = new InitialContext(env);
    Object obj = ctx.lookup("unify/nxj/controlCenters/occ/ControlCenterEJB");
    On a whim, I tried the old SCOTT/TIGER username/password and got the following
    exception:
    javax.naming.NoPermissionException: Not allowed to look up unify/nxj/controlCenters/occ/ControlCenterEJB,
    check the namespace-access tag setting in orion-application.xml for details
    So evidently, SCOTT/TIGER is in the security database used by the app (but isn't
    authorized) while the ias_admin user is not in the security database.
    I have the following questions:
    1. In the default configuration, is there a username/password I can use to
    lookup EJB homes in the jndi namespace of an OC4J instance? If so, what
    is it?
    2. Where is the security database? I tried looking in the web-based console
    to find how to configure security and could not figure it out. I did find
    the Security page for the application, but when I tried to add a user,
    it had no effect. Furthermore, this page did not show a user entry for
    SCOTT; hence, it doesn't seem that OC4J is actually using the information
    on this page. This is strange because the path to this page is:
    Farm > Application Server: ias_admin.lab10.sac.unify.com > OC4J: home > Application: UnifyoccEAR > Security
    I then went to the Security page for the default application and found
    that it did have a SCOTT user. So I added a new user and tried to run
    my java client. This resulted in the javax.naming.AuthenticationException
    described above (I was expected the NoPermissionException encounted when
    using SCOTT/TIGER). Next, I used the Security page for the default application
    to change the password for SCOTT and reran my java client using SCOTT/TIGER.
    This time I was expecting an AuthenticationException exception, but got the
    NoPermission exception. Therefore, it seems that OC4J isn't using this
    security data either.
    Hunting in the console (again) for the security database, I stumble accross
    the Infrasturcture page and see an Identity Management section and see that
    it is configure to use an Oracle Internet Directory server. Using
    <ORACLE_HOME>/bin/oidadmin, I connect to the directory server and look
    for the SCOTT user. I don't find it, so I believe that this can't be the
    security database either.
    3. Finally, how do I configure the OC4J instance such that it will allow
    anonymous users to lookup my EJB from a java client?
    Please help a confused and frustrated user.

    Looking at your example, it looks like you are using a J2EE client container or some properties file to specify the JNDI environment used to create the initial context (for you use the no-arg constructor to InitialContext). Since our application needs to the ability to dynamically connect to ejb's running on different Java application servers (e.g., WebLogic, WebSphere, JBoss), such an approach will not work. Instead we must do it the old-fashioned way and pass the jdni connection info to the InitialContext constructor.
    In any event, our problem isn't how to write the connection code, it is how to test it. Specifically, we can't figure out a valid username/password that will allow us to look up the home. Nor can we figure out how to configure security for the oc4j instance.

  • Invoking a secure web service from a standalone java client

    I am using stand alone java client to invoke a web service. This web service in turn invokes a jcs which is protected ( role based access ).
    I am using a proxy at the client side for web service invocation
    FileSubmission_Impl filesubmission_impl = new FileSubmission_Impl();
    FileSubmissionSoap filesubmissionsoap = filesubmission_impl.getFileSubmissionSoap();
    filesubmissionsoap.processFiles(...)
    This works if there are no security constraints on any of the resources (@common:security).
    I need to pass the username and password from the java client that will be authenticated and allowed to access the protected resources.
    Please let me know as to how this can be achieved ( passing username and password from client )

    Paula,
    I suppose you're using CFINVOKE (http://www.activsoftware.com/code_samples/code.cfm/CodeID/44/ColdFusion/Invoking_SOAP_Web_Services_with_ColdFusion_MX_CFINVOKE_Tag) or are you using a third party tool like CFX_SOAP (http://www.activsoftware.com/products/productdetail.cfm/id/1015)?
    Are you working with WebAS 6.4 or 6.2?
    It works with web services created with WebAS 6.4, but you should generate proxy classes. Check Thomas' weblog (second part of it)->https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1012. [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken]
    The WSDL generated by this method is more standard than the one generated when you just Remote enable an FM and look at the webservice browser.
    Th core of CF MX is Java and that engine is rather strict in standards.
    Eddy

  • Can't access a bpel process from a standalone java client

    Hi i am using soa suite 10.1.3 and i'm trying to invoke a bpel process from a java client
    I am using the tutorial from this page: http://www.oracle.com/technology/products/ias/bpel/pdf/orabpel-Tutorial7-InvokingBPELProcesses.pdf but i am trying to do the client in eclipse
    my class from where i want to invoke the proces looks like this:
    import java.rmi.RemoteException;
    import java.util.Map;
    import com.oracle.bpel.client.Locator;
    import com.oracle.bpel.client.ServerException;
    import com.oracle.bpel.client.dispatch.IDeliveryService;
    import com.oracle.bpel.client.NormalizedMessage;
    public class Invoke {
         public static void main (String args[])
              try {
                   Locator locator = new Locator("default", "bpel", (String)null);
                   IDeliveryService deliveryService =(IDeliveryService)locator.lookupService(IDeliveryService.SERVICE_NAME );
                   String xml =
                        "<ssn xmlns=\"http://services.otn.com\">123456789</ssn>";
                   NormalizedMessage nm = new NormalizedMessage( );
                   nm.addPart("payload", xml );
                   NormalizedMessage res =
                        deliveryService.request("CreditRatingService", "process", nm);
                        Map payload = res.getPayload();
              } catch (ServerException e) {
                   e.printStackTrace();
              } catch (RemoteException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
    The problem that i had firs was that the security.properties file could not be found in the config directory of the projects root. I think i resolved this problem by copying the context.properties file from teh rmi tutorial from the folder 102.InvokingProcesses and rename it.
    After this the error that occure was that the file ejb.properties could not be found in the same directory as the security file.
    Does anyone know how to resolve this problem or where did i miss anythink?
    I tried until now all the examples in the tutorial step by step and i couldnt manage to run one
    Thanks
    Best Regards Corneliu

    Thanks now it is working(i think)
    but i have a nother problem
    i got the folowing error:
    java.lang.Exception: Failed to create "ejb/collaxa/system/DeliveryBean" bean; exception reported is: "javax.naming.NamingException: Lookup error: javax.naming.AuthenticationException: Not authorized; nested exception is:
         javax.naming.AuthenticationException: Not authorized [Root exception is javax.naming.AuthenticationException: Not authorized]
    my context.properties file looks:
    orabpel.platform=ias_10g
    java.naming.factory.initial=com.evermind.server.rmi.RMIInitialContextFactory
    java.naming.provider.url=opmn:ormi://RO1CC29C:6003:oc4j_soa/orabpel
    java.naming.security.principal=oc4jadmin
    java.naming.security.credentials=welcome1
    I haven't change any pasword since i have instaled the SOA Suite
    is the user and password right for a default user and password?

  • Creating initial context from a java client

    I have tried to create intial context from a java client.....
    but that gives me the following exception:
    My code:TestClient.java
    import java.util.*;
    import javax.naming.*;
    public class TestClient
    public static void main(String nilesh[]) throws NamingException
    Hashtable hash = new Hashtable();
    hash.put("Context.INITIAL_CONEXT_FACTORY","com.evermind.server.rmi.RMIInitialContextFactory");
    hash.put("Context.PROVIDER_URL","ormi://localhost:23791/symularity");
    hash.put("Context.SECURITY_PRINCIPAL","admin");
    hash.put("Context.SECURITY_CREDENTIALS","admin");
    Context ctx = new InitialContext(hash);
    System.out.println("Context: "+ctx);
    The output is:
    ERROR! Shared library ioser12 could not be found.
    Exception in thread "main" javax.naming.NamingException: Error accessing repository: Cannot con
    nect to ORB
    at com.sun.enterprise.naming.EJBCtx.<init>(EJBCtx.java:51)
    at com.sun.enterprise.naming.EJBInitialContextFactory.getInitialContext(EJBInitialConte
    xtFactory.java:62)
    at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
    at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
    at javax.naming.InitialContext.init(Unknown Source)
    at javax.naming.InitialContext.<init>(Unknown Source)
    at TestClient.main(TestClient.java:14)
    is anybody able to solve my problem....
    Thanks in advance..
    NileshG

    Nilesh,
    First of all make sure that the shared library error you are getting is fixed by including the library in your classpath. Secondly, where are you running the client from? The connection factory that you use varies depending on where you are connecting from:
    1. ApplicationClientContextFactory is used when looking up remote objects from standalone application clients. This uses refs and mappings in application-client.xml.
    2. RMInitialContextFactory is used when looking up remote objects between different containers.
    3. ApplicationInitalContextFactory is used when looking up remote objects in same application. This is the default initial context factory and this uses refs/mappings in web.xml and ejb-jar.xml.
    Rob Cole
    Oracle Hello Rob cole..
    thank u for ur reply...but actualy i dont know what is application-client.xml and where i can find that file in my j2ee folder...can u give me detail explanation about that...actually i have not created any application or not deployed also without deploying any application i have created that TestClient.java class so how it will relate with application-client.xml....so i have changed the lookup code with ApplicaitonClientContextFactory...but still the same error is coming......can u give me the full explanation or solution of my problem...
    Thanks & Regards
    NileshG...

Maybe you are looking for

  • Handing over DW site files to client

    I am working on a site for a lawyer who is a veritable pain in the @$$ and was wondering if I should actually hand over the DW site files upon completion of the project (even though I will be hosting). I've read in quite a few places that doing so en

  • Can't register CS5 on windows 7

    Upgraded box to windows 7 64 bit, trying to install CS5 and license code boxes will not let me type any letters into them.  Tried pasting the license code and that did not work either.  Proceeded to install the trial version and try to enter the lice

  • Shrinking File Size

    I made this 5 minute promo video that I threw on DVD for my friend but the person he gave it to wants it in CD format also. The size of the video is 745mb and i need to shrink it down so were it can fit on a CD-R. I know how to do this but everytime

  • How do I turn off Tooltips?

    New user who just created his first form that has about a hundred fields on it. How do I turn off tooltips globally so I dont have to go into each object and delete the entry there. There must be an easy way to do it but I cant find it. I dont want t

  • Zen xtra stuck in whatever...

    i deleted some songs on my mp3 player, but not with the computer, only with the zen itself. it stucked after 3 or 4 songs, and i couldnt turn it off. i pulled the battery out of it and pressed the reset button. it went on again, but freezed again in