How to Non-ACC Client connect Sun App Server 8 with SSL

I have create a Rich Client(Non-ACC) that connect to Sun App Server 8 with IIOP(8001) and is working fine. However, when I try to connect to same server with using SSL (8002) and throw exception during lookup a Bean as below.
Please help!!
Server Configuration
================
IIOP Port(s): 8001, 8002, 8003
All listener ports are enabled
Client Coding
===========
env.put(javax.naming.Context.PROVIDER_URL, "iiop://"+url);
env.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY,"com.sun.appserv.naming.S1ASCtxFactory");
System.setProperty("javax.net.ssl.keyStoreType", "jks");
System.setProperty("javax.net.ssl.keyStore", "D:\\Sun\\AppServer\\domains\\adsr\\config\\keystore.jks");
System.setProperty("javax.net.ssl.keyStorePassword", "password");
System.setProperty("javax.net.ssl.trustStore", "D:\\Sun\\AppServer\\domains\\adsr\\config\\cacerts.jks");
System.setProperty("javax.net.ssl.trustStorePassword", "password");
System.setProperty("com.sun.CORBA.connection.ORBSocketFactory", "com.sun.enterprise.iiop.IIOPSSLSocketFactory");
ic = new InitialContext(env);
Object objref = ic.lookup("ejb20/statelessSession/EntControllerHome");
Exception
========
[java] Mar 18, 2005 4:43:59 PM com.sun.corba.ee.spi.logging.LogWrapperBasedoLog
[java] INFO: "IOP00710299: (INTERNAL) Successfully created IIOP listener on the specified host/port: all interfaces/4645"
[java] Mar 18, 2005 4:44:00 PM com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl readFully
[java] WARNING: "IOP00410215: (COMM_FAILURE) Read of full message failed :
bytes requested = 12 bytes read = 7 max wait time = 300 total time spent waiting = 364"
[java] org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 215 completed: No
[java] at com.sun.corba.ee.impl.logging.ORBUtilSystemException.transportReadTimeoutExceeded(ORBUtilSystemException.java:2629)
[java] at com.sun.corba.ee.impl.logging.ORBUtilSystemException.transportReadTimeoutExceeded(ORBUtilSystemException.java:2655)
[java] at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.readFully(SocketOrChannelConnectionImpl.java:676)
[java] at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.read(SocketOrChannelConnectionImpl.java:545)
[java] at com.sun.corba.ee.impl.protocol.giopmsgheaders.MessageBase.readGIOPHeader(MessageBase.java:119)
[java] at com.sun.corba.ee.impl.transport.CorbaContactInfoBase.createMessageMediator(CorbaContactInfoBase.java:153)
[java] at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.readBits(SocketOrChannelConnectionImpl.java:325)
[java] at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.handleEvent(SocketOrChannelConnectionImpl.java:1175)
[java] at com.sun.corba.ee.impl.transport.SelectorImpl.run(SelectorImpl.java:275)
[java] javax.naming.CommunicationException: Can't find SerialContextProvider [Root exception is org.omg.CORBA.COMM_FAILURE:   vmcid: SUN  minor code: 208 c
ompleted: Maybe]
[java] at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.java:133)
[java] at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:290)
[java] at javax.naming.InitialContext.lookup(InitialContext.java:347)
[java] at com.shkco.jaf.test.JAFLogonTest.connect(JAFLogonTest.java:110)
[java] at com.shkco.jaf.test.JAFLogonTest.setUp(JAFLogonTest.java:134)
[java] at junit.framework.TestCase.runBare(TestCase.java:125)
[java] at junit.framework.TestResult$1.protect(TestResult.java:106)
[java] at junit.framework.TestResult.runProtected(TestResult.java:124)

I don't think tomcat supports the ejb-ref portion of web.xml. If you're using ejbs your best bet is to use a web container within a J2EE implementation.
--ken                                                                                                                                                                                                                                                                                                                                           

Similar Messages

  • How to make the client connect to the server at the command prompt?

    I found this code on IBM's website, it was a training session on servers and clients using java.
    The code compiles fine and the server seems to start up properly when I use java Server 5000. I think whats happening is the server is running and listening for a connection on port 5000.
    When I try to run the client I get the following error.
    Exception in thread "main" java.lang.NoSuchMethodError: main
    I see a start() method but no main. As far as I know, applications should all have main, it seems as if the person who wrote this kinda confused applets with application. Not that I would really know what happened.
    If you have time, could you tell me if there's an easy fix for this? I would love to have this client/server working if it isn't too much trouble. As I have looked all over the net for a free client/server applet that will actually let me see the java code and none of the free ones do allow getting to their source.
    Most of them allow you to customize them somewhat but also have built in advertising that can't be removed.
    This is the closest I have come to finding one that lets me look under the hood. But alas it doesn't work out of the box and I don't know what to do to fix it.
    Heres the code: Server:
    import java.io.*;
    import java.net.*;
    import java.util.*;
    public class Server
      // The ServerSocket we'll use for accepting new connections
      private ServerSocket ss;
      // A mapping from sockets to DataOutputStreams.  This will
      // help us avoid having to create a DataOutputStream each time
      // we want to write to a stream.
      private Hashtable outputStreams = new Hashtable();
      // Constructor and while-accept loop all in one.
      public Server( int port ) throws IOException {
        // All we have to do is listen
        listen( port );
      private void listen( int port ) throws IOException {
        // Create the ServerSocket
        ss = new ServerSocket( port );
        // Tell the world we're ready to go
        System.out.println( "Listening on "+ss );
        // Keep accepting connections forever
        while (true) {
          // Grab the next incoming connection
          Socket s = ss.accept();
          // Tell the world we've got it
          System.out.println( "Connection from "+s );
          // Create a DataOutputStream for writing data to the
          // other side
          DataOutputStream dout = new DataOutputStream( s.getOutputStream() );
          // Save this stream so we don't need to make it again
          outputStreams.put( s, dout );
          // Create a new thread for this connection, and then forget
          // about it
          new ServerThread( this, s );
      // Get an enumeration of all the OutputStreams, one for each client
      // connected to us
      Enumeration getOutputStreams() {
        return outputStreams.elements();
      // Send a message to all clients (utility routine)
      void sendToAll( String message ) {
        // We synchronize on this because another thread might be
        // calling removeConnection() and this would screw us up
        // as we tried to walk through the list
        synchronized( outputStreams ) {
          // For each client ...
          for (Enumeration e = getOutputStreams(); e.hasMoreElements(); ) {
            // ... get the output stream ...
            DataOutputStream dout = (DataOutputStream)e.nextElement();
            // ... and send the message
            try {
              dout.writeUTF( message );
            } catch( IOException ie ) { System.out.println( ie ); }
      // Remove a socket, and it's corresponding output stream, from our
      // list.  This is usually called by a connection thread that has
      // discovered that the connectin to the client is dead.
      void removeConnection( Socket s ) {
        // Synchronize so we don't mess up sendToAll() while it walks
        // down the list of all output streamsa
        synchronized( outputStreams ) {
          // Tell the world
          System.out.println( "Removing connection to "+s );
          // Remove it from our hashtable/list
          outputStreams.remove( s );
          // Make sure it's closed
          try {
            s.close();
          } catch( IOException ie ) {
            System.out.println( "Error closing "+s );
            ie.printStackTrace();
      // Main routine
      // Usage: java Server <port>
      static public void main( String args[] ) throws Exception {
        // Get the port # from the command line
        int port = Integer.parseInt( args[0] );
        // Create a Server object, which will automatically begin
        // accepting connections.
        new Server( port );
    }CLIENT:
    import java.io.*;
    import java.net.*;
    public class ServerThread extends Thread
      // The Server that spawned us
      private Server server;
      // The Socket connected to our client
      private Socket socket;
      // Constructor.
      public ServerThread( Server server, Socket socket ) {
        // Save the parameters
        this.server = server;
        this.socket = socket;
        // Start up the thread
        start();
      // This runs in a separate thread when start() is called in the
      // constructor.
      public void run() {
        try {
          // Create a DataInputStream for communication; the client
          // is using a DataOutputStream to write to us
          DataInputStream din = new DataInputStream( socket.getInputStream() );
          // Over and over, forever ...
          while (true) {
            // ... read the next message ...
            String message = din.readUTF();
            // ... tell the world ...
            System.out.println( "Sending "+message );
            // ... and have the server send it to all clients
            server.sendToAll( message );
        } catch( EOFException ie ) {
          // This doesn't need an error message
        } catch( IOException ie ) {
          // This does; tell the world!
          ie.printStackTrace();
        } finally {
          // The connection is closed for one reason or another,
          // so have the server dealing with it
          server.removeConnection( socket );
    }Thanks for your time.

    CLIENT:
    import java.applet.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import java.net.*;
    public class Client extends Panel implements Runnable
      // Components for the visual display of the chat windows
      private TextField tf = new TextField();
      private TextArea ta = new TextArea();
      // The socket connecting us to the server
      private Socket socket;
      // The streams we communicate to the server; these come
      // from the socket
      private DataOutputStream dout;
      private DataInputStream din;
      // Constructor
      public Client( String host, int port ) {
        // Set up the screen
        setLayout( new BorderLayout() );
        add( "North", tf );
        add( "Center", ta );
        // We want to receive messages when someone types a line
        // and hits return, using an anonymous class as
        // a callback
        tf.addActionListener( new ActionListener() {
          public void actionPerformed( ActionEvent e ) {
            processMessage( e.getActionCommand() );
        // Connect to the server
        try {
          // Initiate the connection
          socket = new Socket( host, port );
          // We got a connection!  Tell the world
          System.out.println( "connected to "+socket );
          // Let's grab the streams and create DataInput/Output streams
          // from them
          din = new DataInputStream( socket.getInputStream() );
          dout = new DataOutputStream( socket.getOutputStream() );
          // Start a background thread for receiving messages
          new Thread( this ).start();
        } catch( IOException ie ) { System.out.println( ie ); }
      // Gets called when the user types something
      private void processMessage( String message ) {
        try {
          // Send it to the server
          dout.writeUTF( message );
          // Clear out text input field
          tf.setText( "" );
        } catch( IOException ie ) { System.out.println( ie ); }
      // Background thread runs this: show messages from other window
      public void run() {
        try {
          // Receive messages one-by-one, forever
          while (true) {
            // Get the next message
            String message = din.readUTF();
            // Print it to our text window
            ta.append( message+"\n" );
        } catch( IOException ie ) { System.out.println( ie ); }
    import java.applet.*;
    import java.awt.*;
    import java.io.*;
    import java.net.*;
    public class ClientApplet extends Applet
      public void init() {
        String host = getParameter( "192.168.1.47" );
        int port = Integer.parseInt( getParameter( "5000" ) );
        setLayout( new BorderLayout() );
        add( "Center", new Client( host, port ) );
    }Sorry about that. Now when I run an html file with this applet I just get the x in the corner.
    Thanks for looking.

  • Iplanet connect exception when usig non acc client

    I am trying to connect a non acc client to my appserver. I have everything set up according to the sample program provided by sun. When i execute the client it "hangs" at the contect initialization line (Context initial = new InitialContext(env).
    when I check the log for the appserver it has the following error:
    com.iplanet.ias.cis.connection.ConnectException: com.iplanet.ias.cis.channel.tcp.TCPNativeException: -5973:EndPoint.JNI_getValidAddressNative: PR_GetHostByAddr() Failed
    at com.iplanet.ias.cis.connection.Connection.<init>(Connection.java:205)
    at com.iplanet.ias.cis.connection.ServerConnection.accept(ServerConnection.java:251)
    at com.sun.corba.ee.internal.iiop.ListenerThread.run(ListenerThread.java:77)
    Caused by: com.iplanet.ias.cis.channel.tcp.TCPNativeException: -5973:EndPoint.JNI_getValidAddressNative: PR_GetHostByAddr() Failed
    at com.iplanet.ias.cis.connection.EndPoint.getValidAddressNative(Native Method)
    at com.iplanet.ias.cis.connection.EndPoint.getValidAddress(EndPoint.java:239)
    at com.iplanet.ias.cis.connection.EndPoint.<init>(EndPoint.java:101)
    at com.iplanet.ias.cis.connection.EndPoint.getEndPoint(EndPoint.java:73)
    at com.iplanet.ias.cis.connection.EndPoint.getEndPoint(EndPoint.java:78)
    at com.iplanet.ias.cis.channel.tcp.TCPChannel.getLocalEndPoint(TCPChannel.java:68)
    at com.iplanet.ias.cis.connection.Connection.<init>(Connection.java:202)
    ... 2 more
    any idea what I am doing wrong?

    Were you ever able to resolve this problem? If so, please let me know how at [email protected]
    thanks
    suneet

  • How to track IP's of clients connecting to DB server through Apps Server

    My Application server address is like http://192.220.0.75:7779/forms90/f90servlet form=TEST.fmx&userid=@abc
    I can connect to Apps server from any computer using explorer with this address .
    for auditing when I connect to db server through Apps server then my audit table detect only server IP- 192.220.0.75 each time but when I connect by oracle DS or toad then my audit table detect each computers defferent IP address.
    how can I detect different users and IP addresses connecting to database server using apps server instead of apps server IP?

    You can try to use WebCache event_log, this one will show your clients IP or you can uncomment UseWebCacheIP ON in httpd.conf file, so you ensure that the access_log show the ip of the user and not of the server.
    Greetings.

  • Connecting to EJ bean in Sun App Server 8

    I am working my way through the j2eetutorial14, and have successfully built the Converter app. However, I need to run the stand-alone client, connecting to the bean, in a server-independent way. So, as part of my exercise, I copied the client code in Eclipse, and made the following changes to the code:
    from the original example:
    Context initial = new InitialContext();
    Context myEnv = (Context) initial.lookup("java:comp/env");
    Object objref = myEnv.lookup("ejb/SimpleConverter");
    ConverterHome home = (ConverterHome) PortableRemoteObject.narrow(objref, ConverterHome.class);to this:
    Properties properties = new Properties();
    properties.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.cosnaming.CNCtxFactory");
    properties.put(Context.PROVIDER_URL, "corbaloc:iiop:localhost:3700");
    Context initial = new InitialContext(properties);
    Object objref = initial.lookup("ConverterBean");
    ConverterHome home = (ConverterHome) PortableRemoteObject.narrow(objref, ConverterHome.class);Now I am getting this exception in the narrow() method:
    java.lang.ClassCastException
         at com.sun.corba.se.internal.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:293)
         at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:134)
         at ConverterClient.main(ConverterClient.java:27)When I run the client from the script:
    appclient -client ConverterAppClient.jarit works as expected. I am obviously missing something in my Eclipse runtime environment, but the manual was of no help so far. (But j2ee.jar library from C:\Sun\AppServer\lib is in the classpath.)
    If anyone successfully connected to the Sun App Server 8 EJB from a stand-alone client and can share their wisdom, I will appreciate it.
    On a more general note, what are the pitfalls to watch for when writing, packaging and distributing an EJB app (bean and stand-alone client) in a server-independent way? Any pointers?
    Thanks for any help.
    Alex.

    Did you have the EJB client JAR in your classpath? Yes, and I spent all day searching the Forums for the clues. I found the answer, and was going to post it here. The client JAR was missing the RMI stubs. The process of generating the stubs is quite cumbersome - at least, the one that I discovered. It involves deploying the EAR first, then going to the Admin Console and manually setting a number of options, then collecting the sought-for JAR from the Sun App Server's applications directory. The generated file will contain the stubs, and also the Home and Remote interface files, as well as the bean class (something that the client will never need). So, I may have to write a script to strip off the needless baggage from the client JAR.
    I have been working with JBoss and its plugin for Eclipse for some time now, and grew spoiled by the ease of deployment there, including the fact that the JBoss/Eclipse combo took care of the RMI stubs and many other things that Sun's server exposes to the developer.
    Anyway, here is my cookbook that I made as I was working through the process of generating the stubs:
    ====================================
    Creating a stand-alone Client:
    The stand-alone client need RMI stubs to communicate with the EJ bean on the server side. To create the stubs:
    1. Start the Admin Console web page (Start > All Programs > Sun Microsystems > Application Server PE > Admin Console). In the left-hand frame select: Applications > Enterprise Applications.
    2 In the right-hand frame, press Deploy button.
    3 Select file to upoad (navigate to the application EAR). Press Next.
    4. Set Application Name field (it should be preset), and check the Generate: RMIStubs checkbox. If this procedure was done before, check the Redeploy box to force generation of the file.
    5. Press OK button.
    The JAR file with stubs will be placed into C:\Sun\AppServer\domains\domain1\applications\j2ee-apps directory.
    The stubs have format _name_Stub.class and _nameHome_Stub.class (e.g. for Converter app the files are ConverterStub.class and ConverterHomeStub.class). These files must be extracted and placed into the client's classpath. Alternatively, the entire JAR file can be made part of the client's classpath.
    ====================================
    Thank you for the quick reply.
    Alex.

  • Client reconnect after SUN App server 8.0 shutdown.

    Hi,
    I have a client which connects to app.server. When app.server is shutdown , client waits for appl. server to come up. Once app.server comes up i again need to reconnect.
    When i do this i am getting following error. Aby inputs on this.
    javax.naming.CommunicationException: serial context communication ex [Root exception is java.rmi.NoSuchObjectException: CORBA OBJECT_NOT_EXIST 1398079690 No; nested exception is:
         org.omg.CORBA.OBJECT_NOT_EXIST: ----------BEGIN server-side stack trace----------
    org.omg.CORBA.OBJECT_NOT_EXIST:   vmcid: SUN  minor code: 202  completed: No
         at com.sun.corba.ee.impl.logging.ORBUtilSystemException.badServerId(ORBUtilSystemException.java:7317)
         at com.sun.corba.ee.impl.logging.ORBUtilSystemException.badServerId(ORBUtilSystemException.java:7339)
         at com.sun.corba.ee.impl.orb.ORBImpl.handleBadServerId(ORBImpl.java:1396)
         at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.checkServerId(CorbaServerRequestDispatcherImpl.java:399)
         at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:167)
         at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1653)
         at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:1513)
         at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleInput(CorbaMessageMediatorImpl.java:895)
         at com.sun.corba.ee.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:172)
         at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:668)
         at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.dispatch(SocketOrChannelConnectionImpl.java:375)
         at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.read(SocketOrChannelConnectionImpl.java:284)
         at com.sun.corba.ee.impl.transport.ReaderThreadImpl.doWork(ReaderThreadImpl.java:73)
         at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:382)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    You might want to know that NetBeans 3.6 works with 1.5 (with a few tweaks -- see http://www.netbeans.org/community/articles/tiger/36Tiger.html)
    As Sun Java Studio is built on top of NetBeans, and as NetBeans 3.6 works with 1.5, you might expect a Studio version that supports 1.5.
    Also, NetBeans 3.6 supports JSP 2.0 and Servlet 2.4, meaning that it should be compatible with App Server 8.
    In other words, one way to get a roadmap for Sun Java Studio is to look at what NetBeans is doing.

  • Non-ACC client for WSIT enabled services

    Hallo All,
    Can anyone tell me how I could develop a non-ACC java client for SSL enabled web service/Reliable Messaging enabled web services.
    As of now, I am able to access these services with clients deployed in ACC containers of Glassfish V2UR1.
    I read some thing about glassfish connectors, but did not get a clear picture. I don't believe that Glassfish doesn't have support for non-ACC clients.
    Thanks a lot in advance.

    Hallo All,
    Can anyone tell me how I could develop a non-ACC java client for SSL enabled web service/Reliable Messaging enabled web services.
    As of now, I am able to access these services with clients deployed in ACC containers of Glassfish V2UR1.
    I read some thing about glassfish connectors, but did not get a clear picture. I don't believe that Glassfish doesn't have support for non-ACC clients.
    Thanks a lot in advance.

  • How can i check the office web app server(wac client) is calling custom WOPI host?

    I am getting an error when I testing my wopi host(which is the same as
    example) with Office Web app server "Sorry, there was a problem and we can't open this document.  If this happens again, try opening the document in Microsoft Word."
    1-how can find the log files of this error?
    2-how can i check the office web app server(wac client) is calling my WOPI host?
    I am not sure about cumunication between owa to wopi host. I actually dont know how to implement checkfile and getfile functions to wopi host for waiting for call back from owa client.
    Note:I am sure that office web app server is configured true. Because i test it with sharepoint 2013 and editing and viewing is working well.

    Hi,
    According to your post, my understanding is that
    CheckFileInfo is how the WOPI application gets information about the file and the permissions a user has on the file. It should have a URL that looks like this:
    HTTP://server/<...>/wopi*/files/<id>?access_token=<token>
    While CheckFileInfo provides information about a file, GetFile returns the file itself. It should have a URL that looks like this:
    HTTP://server/<...>/wopi*/files/<id>/contents?access_token=<token>
    There is a great article for your reference.
    http://blogs.msdn.com/b/officedevdocs/archive/2013/03/20/introducing-wopi.aspx
    You can also refer to the following article which is about building an Office Web Apps(OWA) WOPI Host.
    http://blogs.msdn.com/b/scicoria/archive/2013/07/22/building-an-office-web-apps-owa-wopi-host.aspx
    Thanks & Regards,
    Jason
    Jason Guo
    TechNet Community Support

  • HELP - Can't connect to Sun App Server

    Hi,
    I'm confused. The Sun App Server documentation states that the protocol to use in the JNDI context lookup is jms or tcpjms, and that the service runs on port 7676:
    javax.naming.ConfigurationException: Invalid URL: jms://localhost:7676 [Root exception is java.net.MalformedURLException: unknown protocol: jms]
    When I use the other (commented-out) line: iiop://localhost:3700, I get a different error (and I don't think this is the protocol I want to use anyway).
    JNDI API lookup failed: javax.naming.NameNotFoundException [Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0]
    javax.naming.NameNotFoundException [Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0]
    So which is it?? Here is my code...thanks in advance for your help!
    package com.tpc.jms.simpleProducer;
    import javax.jms.*;
    import javax.naming.*;
    import java.util.Hashtable;
    import java.util.Properties;
    public class SimpleJMSTest {
    // public static final String PROVIDER_URL = "iiop://localhost:3700";
    public static final String PROVIDER_URL = "jms://localhost:7676";
    public static final String CONTEXT_FAC = "com.sun.jndi.cosnaming.CNCtxFactory";
    public static void main (String argv[]) {
    try {
    Properties properties = new Properties();
    properties.put(Context.PROVIDER_URL, PROVIDER_URL);
    properties.put(Context.INITIAL_CONTEXT_FACTORY, CONTEXT_FAC);
    properties.put(Context.SECURITY_PRINCIPAL, "guest");
    properties.put(Context.SECURITY_CREDENTIALS, "guest");
    InitialContext initialCtx = new InitialContext(properties);
    System.out.println("Good!");
    //TopicConnectionFactory topicConnFactory = (TopicConnectionFactory) initialCtx.lookup (fac);
    //Topic nasdaqTopic = (Topic)initialCtx.lookup(topic);
    /* System.out.println("Creating topic connection");
    TopicConnection topicConnection = topicConnFactory.createTopicConnection();
    topicConnection.start ();
    System.out.println("Creating topic session: not transacted, auto ack");
    TopicSession topicSession = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
    System.out.println("Creating topic, subscriber");
    TopicSubscriber nasdaqTopicSubscriber = topicSession.createSubscriber (nasdaqTopic);
    System.out.println ("Ready to subscribe for messages :");
    nasdaqTopicSubscriber.setMessageListener(new SubscriberListener());*/
    catch (Exception e) {
    e.printStackTrace ();
    }

    Hi,
    First of all, you don't use iiop in JMS.
    And also for your problem, did you by any chance forget to create your connectionfactory in the application server?

  • How to install j2ee sun app server 8.0 in debain linux

    hi guys
    i am new to linux and i have downloaded the j2ee sun app server 8.0(linuxversion) from sun.java
    in sun.java documentation says first we have to change the mode to excecutable
    then he is saying to do this
    1. To run the installation program that uses a graphical interface, at the command prompt type the name of the bundle file at the command prompt.
    2.To run the installation program that uses the command-line interface, at the command prompt type the name of the bundle file followed by the -console option.
    after chmod + x <bundle name >
    the next step i am not able to do it
    what to do next
    any suggestions
    regards
    sandeep

    Hi rlubke
    Thanks for the suggestion
    1.Change the permission of the bundle file so that you have execute access:
    chmod +x <bundle-file-name>
    2. To run the installation program that uses a graphical interface, at the command prompt type the name of the bundle file at the command prompt.
    3.To run the installation program that uses the command-line interface, at the command prompt type the name of the bundle file followed by the -console option.
    Step 1. After chmod + x <bundle name >
    Step 2. sun/appserver/# <bundle name>
    bash: <bundle name>: command not found
    Step 3. sun/appserver# <bundle name>
    bash: <bundle name#>: command not found
    any suggestions
    i have done what u have said now
    Step 1. After chmod + x <bundle name >
    Step 2. sun/appserver/#./ <bundle name>
    Checking available disk space....
    Checking Java(TM) 2 Runtime Environment...
    Extracting Java(TM) 2 Runtime Environment files...
    Extracting installation files...
    Launching Java(TM) 2 Runtime Environment....
    Error: There are no files requiring installation.
    Deleting Temporary files...
    Step 3. sun/appserver# <bundle name>
    Checking available disk space....
    Checking Java(TM) 2 Runtime Environment...
    Extracting Java(TM) 2 Runtime Environment files...
    Extracting installation files...
    Launching Java(TM) 2 Runtime Environment....
    Error: There are no files requiring installation.
    Deleting Temporary files...
    this is what happening excatly

  • Deploying a WAR file to Sun App Server 8.1 PE

    So I thought that if I downloaded Sun App Server PE 8.1 and put it on my soon-to-be production machine, it should be pretty easy right?
    Nope. So I have JSC update 6 (which includes Sun Application Server 8.0) (God how I wish there was a catchy name like Tomcat or something)
    And I have a machine running a good copy, installed and everything, of Sun Application Server 8.1 Platform Edition (another catchy name) up on the production target.
    I create a WAR file in JSC, scp it up.
    Then try to deploy it - so I get bit by the no DB connection thing.
    Ok, but when I copy each of my connection's attributes (the driver (which I did copy up to the lib directory) is MySQL's Connector/J)
    I copy the username, password, URL and DriverClass attributes to the connection pool.
    I still get a
    "Operation 'pingConnectionPool' failed in 'resources' Config Mbean. Target exception message: Class name is wrong or classpath is not set for : com.sun.sql.datasource.DriverAdapter"
    when I try to Ping the ConnectionPool
    I have javax.sql.DataSource as the resource type... (same as 8.0 uses)
    what JAR file is DriverAdapter in? anyone know?
    cheers,
    Kris

    Okay. mysql folks - this works......
    here's what happened, on the production server, different from the dev machine....
    mysql 4.1.9
    sun application server platform edition PE 8.1
    connector/j - latest
    and on the dev machine: JSC Update 6 and the app works fine on the dev machine.
    first, there is a JAR file in ~whatever/Create/SunAppServer/lib/ named
    driveradaptor.jar
    and it it comtains
    com.sun.sql.datasource.DriverAdapter
    which 8.1 ain't got
    and should be copied up to
    /installdir/SunAppServer/domains/domain1/lib/ext/driveradapter.jar
    (domain1 is your app svr domain that runs your app.)
    your Connector/J JAR needs to go here too. I used:
    mysql-connector-java-3.2.0-alpha-bin.jar
    downloaded from mysql.com.
    and then there is the whole thing about Added Properties in the Connection Pool page inside the 8.1 Admin Console (which is nice work guys). Gawd, I added a bunch of properties and am, frankly, not sure which ones actually work (for the Ping, for the initial connection creation and the eventual successful connection all seem to use different combinations...)
    and I found this in the domain's domain.xml once all the admin console page filling was done - but you'll need to add each one as a Property in the connection pool:
    <jdbc-connection-pool connection-validation-method="auto-commit" datasource-classname="com.sun.sql.datasource.DriverAdapter" fail-all-connections="false" [blah...]
    <property name="Username" value="root"/>
    <property name="Password" value="secret"/>
    <property name="ValidationQuery" value="SELECT 1"/>
    <property name="DriverClassName" value="com.mysql.jdbc.Driver"/>
    <property name="LoginTimeout" value="0"/>
    <property name="Url" value="jdbc:mysql://localhost/databasename?autoReconnect=true"/>
    <property name="User" value="root"/>
    <property name="password" value="secret"/>
    <property name="PasswordCredential" value="secret"/>
    </jdbc-connection-pool>
    (and you see how User and Username and username are all the same thing? well, different parts of 8.1 seem to use different attributes...)
    Just keep Adding Properties in the connection pool until you get them all....
    Oh and, the two key class references for the pool are:
    datasource class: com.sun.sql.datasource.DriverAdapter
    resource type: javax.sql.ConnectionPoolDataSource
    Finally: in the /installdir/SunAppServer/domains/domain1/applications/j2ee-modules/YourAppName/WEB-INF/
    your 'sun-web.xml' (don't delete it, like some have advocated, I think that wrong) needs to look like:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 8.1 Servlet 2.4//EN" "http://www.sun.com/software/appserver/dtds/sun-web-app_2_4-1.dtd">
    <sun-web-app xmlns="http://java.sun.com/xml/ns/j2ee">
    <context-root>/yourcontext</context-root>
    <resource-ref>
    <res-ref-name>jdbc/Yourname</res-ref-name>
    <jndi-name>jdbc/Yourname</jndi-name>
    <default-resource-principal>
    <name>root</name>
    <password>secret</password>
    </default-resource-principal>
    </resource-ref>
    </sun-web-app>
    and I think that's all of it. the only Bug I would I would say is that the sun-web.xml should have the right res-ref-name, but then I think the Creator Team knows this and will fix it sometime soon.
    cheers,
    and Roger Federer lost in the Aussie Open. (I think he lost tomorrow too, that whole time zone thing being so damn Einsteinian...)
    -Kristofer

  • Web Services with Sun App Server

    We are load testing a simple web service running in SJSAS 8.0 Standard. With 1 or 2 users concurrent it seems OK, but once we move up to 5 concurrent users calling the WS, the domain in SJSAS crashes.
    Does anyone have experience or information regarding the app server and load with web services? Are there some config options that we can tweak? Are there any numbers out there about how many simultaneous connections the server can handle?
    A final note, things seem fine if we are just serving a simple web page from the server, its only when we try to call a WS that we run into these performance issues.
    Thanks.

    Are you connecting to any external resource using JNDI by any chance? If you're using Unix, check the number of file descriptors being opened on the Sun App server. "new dirContext(env)" creates OS file descriptors each time it's invoked (calling the web service for example).
    use
    $ps -ax
    get the process number of sjas and try issuing a:
    lsof -p <sjas_process_number> |wc -l
    and keep invoking the web service. If this number keeps increasing then you've an "fd" leak (perhaps not closing the dirContext). Linux for example has a default max file limit of 1024 under "root" user and when depleted, sjas will hang.
    Could this be the problem?
    Cheers
    Steve

  • "Message Driven Bean" doesn't work with Sun App Server

    Hello all,
    i have a little bit problems, running a simple "Message Driven Bean" under the Sun App Server. The deployment of it works fine, but after starting the SUN App Server i get the following error message:
    An error occurred during the message-driven beancontainer initialization at runtime. The most common cause for this is that the physical resource(e.g. Queue) from which the message-driven bean is consuming either does not exist or has been configured incorrectly. Another common error is that the message-driven bean implementation class does not correctly implement the required javax.ejb.MessageBean or MessageListener interfaces.
    Has anybody a workaround for this problem?
    The queue seems to be correctly installed. A simple client programm from the Sun Tutorial (Consumer & Producer) works fine without any Errors or Exceptions.
    I am a little bit confused, because the queue seems to work with the client programms but not with a MDB running on the SUN App Server.
    Thanks for you help!
    Greetings
    Manuel

    Hello Mr Manuel!
    could you plz help me with the steps for creating a message driven bean using netbeans ver 5.0(with Sun Java� System Application Server Platform Edition 8.2 )
    I just know how to work with Session beans & Entity Bean, and am try to learn to work on Message Driven Beans too. there are no proper tutorials where i can find steps for creating these..
    I need the steps from the scratch.,like creating QueueConnection Factory & Destination etc..
    It will be gr8 if you can help me with this at the earliest .
    Thank you
    Bye

  • Sun app server problem using asadmin tool

    I have installed sun app server and trying to do the simplemessage tutorial. When I run the
    ant create-cfcommand I get the following
    [exec] Invalid user or password
    [exec] CLI137 Command create-jms-resource failed.I have put an echo line in app-server-ant.xml to see what the command is and it is.
    [echo] c:/Sun2/SDK/bin/asadmin.bat create-jms-resource --user admin  --passwordfile C:/Sun2/SDK/javaee-5-doc-tutorial-1.0_03/javaeetutorial5/examples/common/admin-password.txt --host localhost --port 4850 --restype javax.jms.ConnectionFactory --enabled=true jms/ConnectionFactoryI have checked the password file and it is
    AS_ADMIN_PASSWORD=adminadminAny ideas?
    I have checked around about using parameter password but when running this I get an error saying this is not valid and that I should use passwordfile
    Kelvin

    You haven;t specified the exceptions you r getting ........while starting your default server.
    if u r getting exception about InetClass then connect your system with LAN/Internet then your problem will be solved becoz i m using same location address as you specified, space doesn't matter at all - i think so, it is running fine........

  • Integrating Sun App Server with WebSphere MQ

    Hi,
    I am using Sun App server V8.1 . I also have a websphere MQ v5.3 installed in my system. I want to integrate this MQ with the App server.
    I created a queueManager and a Queue in MQ and using the JMSAdmin console of the Mq, i created jndi lookup resources using INITIAL_CONTEXT_FACTORY=com.sun.jndi.fscontext.RefFSContextFactory
    In the application server side, i created a Resource adapter using the command:
    create-resource-adapter-config --property SupportsXA=true:ProviderIntegrationMode=jndi:RMPolicy=OnePerPhysicalConnection:JndiProperties=java.naming.factory.url.pkgs\\=com.ibm.mq.jms.naming,java.naming.factory.initial\\=com.sun.jndi.fscontext.RefFSContextFactory,java.naming.provider.url\\=file\\:D\\:\\MQ:LogLevel=finest mqra
    Then i deployed this resource adaptor using the command :
    deploy name mqra target server "D:\Sun\AppServer\lib\addons\resourceadapters\genericjmsra\genericra.rar"
    Using this resource adapter i created a connection pool, connector resource and an admin object using the commands
    create-connector-connection-pool raname mqra connectiondefinition javax.jms.QueueConnectionFactory transactionsupport  XATransaction property ConnectionFactoryJndiName=MQQCF mymqpool
    create-connector-resource --poolname mymqpool jms/MyMqQCF
    create-admin-object raname mqra restype javax.jms.Queue --property DestinationJndiName=RTQueue jms/MyMqQueue
    After that, i wrote a java code to lookup these resources and put a message into the queue.
    This is the snippet of my java code
    InitialContext ic = new InitialContext();
    QueueConnectionFactory cnxFact = (QueueConnectionFactory)ic.lookup("jms/MyMqQCF");
    Queue qu = (Queue)ic.lookup("jms/MyMqQueue");
    try {               
    QueueConnection qConn = cnxFact.createQueueConnection();
    QueueSession qSess = qConn.createQueueSession(false,Session.AUTO_ACKNOWLEDGE);
    QueueSender qSend = qSess.createSender(qu);
    TextMessage msg = qSess.createTextMessage();
    msg.setText("1");
    qSend.send(msg);
    qConn.close();
    I am getting an exception in the line, QueueConnection qConn = cnxFact.createQueueConnection();
    here is the stack trace
    java.lang.ClassCastException: com.ibm.mq.jms.MQQueueConnectionFactory
    at com.sun.genericra.outbound.ManagedQueueConnectionFactory.createXAConnection(ManagedQueueConnectionFactory.java:45)
    at com.sun.genericra.outbound.AbstractManagedConnectionFactory.createPhysicalConnection(AbstractManagedConnectionFactory.java:127)
    at com.sun.genericra.outbound.AbstractManagedConnectionFactory.createManagedConnection(AbstractManagedConnectionFactory.java:111)
    at com.sun.enterprise.resource.ConnectorAllocator.createResource(ConnectorAllocator.java:90)
    at com.sun.enterprise.resource.IASNonSharedResourcePool.getUnenlistedResource(IASNonSharedResourcePool.java:437)
    at com.sun.enterprise.resource.IASNonSharedResourcePool.internalGetResource(IASNonSharedResourcePool.java:355)
    at com.sun.enterprise.resource.IASNonSharedResourcePool.getResource(IASNonSharedResourcePool.java:250)
    at com.sun.enterprise.resource.PoolManagerImpl.getResourceFromPool(PoolManagerImpl.java:213)
    at com.sun.enterprise.resource.PoolManagerImpl.getResource(PoolManagerImpl.java:174)
    at com.sun.enterprise.connectors.ConnectionManagerImpl.internalGetConnection(ConnectionManagerImpl.java:286)
    at com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:145)
    at com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:121)
    at com.sun.genericra.outbound.ConnectionFactory.createConnection(ConnectionFactory.java:69)
    at com.sun.genericra.outbound.ConnectionFactory.createQueueConnection(ConnectionFactory.java:101)
    Can anybody help???

    bump
    update:
    So to avoid this problem I added spring.jar to the server classpath. that got rid of this message but then it started complaining that its missing struts2 core jar..i added that in server classpath as well...I did same for 4 other files and in the end it said 'bean for xwork has already been initialized' (because all these jars are in the application as well).
    So I am stuck. if I add all jars to server classpath..it says beans have already been initialized. If I take out the jars from server classpath then it says that stuff is missing (eg. contextLoader.properties missing - orig post)
    again, all this goes away when I restart the server..so i am just trying to avoid having to restart server every code change.

Maybe you are looking for

  • Excise Base is Zero! STO

    Hi to all, I am facing a problem in ECC5.0 and stuck in stock transport order between plant to plant. I have followed the steps as below: Creating stock transport order. Creating Outbound delivery Doing PGI creating performa invoice - Billing documen

  • Error in Running JCO code in Netweaver Devloper Studio

    Hi, I have written a simple java program to get data from SAP using JCO code. It get compiled successfuly but when I run it, It gives the following error : java.lang.NoClassDefFoundError      at com.sap.mw.jco.MiddlewareJRfc$Client.connect(Middleware

  • Firefox 5 not working on Dell Studio XPS

    Firefox 5 installs without a problem but the tabs when you click on them will not open and right clicking a link to open in new tab doesn't work Dell Studio Xps 9100 Windows 7 Same with firefox 4.... 3.6.18 no problem

  • X2go fails to get Client Login working!

    Following the wiki: http://wiki.archlinux.org/index.php/X2go I setup my Desktop as x2go Server and try to login from a notebook from local network (Both with Archlinux) Login fails with: Write problem at /home/'USER'/.x2go/ssh/socaskpassGHTZF First i

  • JTable:  Setting tab order

    Lets say that I have a table with ten rows and five columns. The default tab order tabs through each cell, left to right, top to bottom. How do I EXCLUDE the cells of the two leftmost columns from the tab order? Many thanks in advance, especially for