Hosting a Java TCP/IP Sever

Hello, I have been doing some research and the more I read the more I get confused about this topic. Also I'm not sure if I put this in the right topic, so I'm sorry if this is the wrong topic.
I would like to professionally host a Server application very similar to the sample Knock-Knock Server on Sun's Site http://java.sun.com/docs/books/tutorial/networking/sockets/clientServer.html.
I was looking at using Tomcat, but I am not sure this is what it was designed to do. Reading about Servlets I seem to get the idea that it is only meant for dynamically generating web content.
My system looks something like this
-Multiple Clients
-Multi-thread TCP/IP server being hosted by some professional hosting service
-SQL data base
I was originally looking at using Servlet technology because I would like to make some modifications to my database using a web form, but I think I could also do this using PHP instead, unless there is a clean way to a Servlet to my TCP/IP server on the same machine.
So my question is, what kind of tool would I use to professionally host my TCP/IP server? I have read about Tomcat and JBOSS a little bit so far, but the more I read the more confused I get about the subject. I am new to the hosting realm and need a little direction :)
P.S. Duke reward points for anyone who can answer quickly and thouroghly if you want them!

Ok, Maybe I'm finally starting to answer my own question. So let me know if I'm on the right track.
I can use some sort of Java hosting solution, lets say for this example I want to use http://s43.eatj.com/
I then need to create a WAR file which from what I have read so far is similar to a plain old JAR file. Then I should be able to upload my WARed application and let it run?
If that's right are there any good tutorials with good explanations of WAR files for newbies?
Thanks!

Similar Messages

  • Can't connect to IPv6-only host from java on Mac OS

    I have some IPv6-only hosts. I can successfully execute curl request to it by curl
    $ curl -I my.ip.v6.only.host HTTP/1.1 200 OK
    But when I trying to get it from java I have an error:
    HttpGet httpget = new HttpGet("http://my.ip.v6.only.host");
    CloseableHttpResponse response = httpclient.execute(httpget);  
    Stack trace:
    INFO: I/O exception (java.net.NoRouteToHostException) caught when processing request to {}->http://my.ip.v6.only.host: No route to host
    Mar 17, 2015 7:42:23 PM org.apache.http.impl.execchain.RetryExec execute
    INFO: Retrying request to {}->http://my.ip.v6.only.host
    java.net.NoRouteToHostException: No route to host
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
    at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
    at java.net.Socket.connect(Socket.java:579)
    at org.apache.http.conn.socket.PlainConnectionSocketFactory.connectSocket(PlainConnectionSocketFactory.java:72)
    at org.apache.http.impl.conn.HttpClientConnectionOperator.connect(HttpClientConnectionOperator.java:123)
    at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:318)
    at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:363)
    at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:219) 
    at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:195)
    at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:86)
    at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:108)
    at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:106)
    at MainTest.main(MainTest.java:25)
    Problem has been occured on java v1.7.0_65 and v1.8.0_40, MacOS 10.10.2. On previous version MacOS 10.9.5 it works well.
    What's going on? How it is possible that host is reachable by curl and unreachable from java.
    Also, I've tried to play around -Djava.net.preferIPv6Addresses=true and -Djava.net.preferIPv4Stack=false and it couldn't help.

    Using the code you supplied I was able to reproduce your errors. I've adjusted it accordingly and can connect to one of my 10.2 test databases.
    import java.sql.*;
    import oracle.jdbc.*;
    import oracle.jdbc.pool.*;
    class Conn {
      public static void main (String args []) throws SQLException
        Connection conn = null;       
        OracleDataSource ods = new OracleDataSource();
        // ods.setURL(" jdbc:oracle:thin:@localhost:1521:TEST");
        // conn = ods.getConnection("scott", "tiger");
        ods.setURL("jdbc:oracle:thin:@localhost:1521:TEST");
        conn = ods.getConnection("scott", "tiger");
        Statement stmt = conn.createStatement();
        ResultSet rset = stmt.executeQuery("select BANNER from SYS.V_$VERSION");
        while (rset.next())
            System.out.println (rset.getString(1));   // Print col 1
        stmt.close();
    }There are several different ways to configure OracleDataSources:
    http://download.oracle.com/docs/cd/B19306_01/java.102/b14355/urls.htm#BEIDBFDF
    So, hopefully it's just a mismatch config.

  • SAPehp tool does not know the host for Java stack

    I  am running SAPehp tool to apply enhp2 to a dual stack with
    ABAP and JAVA on seperated Windows boxes.
    I started SAPehp at the ABAP box.
    Because there is no way to tell where is the Java host, how do I apply
    the enhp2 to the Java side? How to make ABAP and Java in sync?
    Please help.
    Thanks!

    Hi Christy,
    I consider that both of your ABAP and Java system has separate database. If this is the case then you have to upgrade both system separately and run EHPI installer on both system. You can upgrade the system in same way as you are doing for your ABAP system only difference is the support packages and rest of the main things are same.
    I will recommend you to study upgrade guides for ABAP and Java system.
    If your ABAP and Java system has different SID but share same database (i.e. MCOD system) then run EHPI installer for upgrade once a time. It means that when you will upgrade the ABAP stack then don't run EHPI tool to upgrade Java stack at same time. Once ABAP system upgrade finished then upgrade Java system. And vice-versa.
    Thanks
    Sunny

  • Java TCP/UDP

    In java tutorial, it was said when using TCP, connection based connection, the port number will be automatically assigned. Is there any method that the port can be manually assigned?
    Regards
    Alpha

    I know that i no need to assign a port.
    But i don't why : when the program start to run in the first time, e.g. automatically assigned port 2000, then i run it 1 more time(the 2nd time), a warning message said couldn't open local port 2001, when i run it in 3rd time, it success again, the message shows it is using port 2002. Then i tried again(the 4th), it automatic assign port 2003 for me, the warning message said couldn't create local port : 2003, At last, i tried the 5th times, it was success again, it is using the port 2004.
    Why have this phenomenon ? How can i solve it?
    Regards

  • How to control tcp connection with java tcp socket programing ??

    Hi,
    I am connecting a server as using java socket programming.
    When server close the connection (socket object) as using close() method ,
    I can not detect this and My program continue sending data as if there is a connection with server.
    How to catch the closing connection ( socket ) with java socket programming.
    My Client program is as following :
    import java.io.PrintWriter;
    import java.net.Socket;
    public class client
      public client()
       * @param args
      public static void main(String[] args)
        Socket socket=null;
        PrintWriter pw=null;
        try
                          socket = new Socket("localhost",5555);
                          pw = new PrintWriter(socket.getOutputStream(),true);
                          int i=0;
                          while (true)
                            i++;
                            pw.println(i+". message is being send.");
                            Thread.sleep(5000);
        } catch (Exception ex)
                          ex.printStackTrace();
        } finally
                          try
                            if(pw!=null)pw.close();
                            if(socket!=null)socket.close();
                          } catch (Exception ex)
                            ex.printStackTrace();
                          } finally
    }

    I changed the code as following. But I couldn't catch the EOFException when I read from the socket. How can I catch this exception ?
    import java.io.BufferedReader;
    import java.io.EOFException;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.InputStreamReader;
    import java.io.PrintWriter;
    import java.net.Socket;
    import java.net.UnknownHostException;
    public class client
      public client()
       * @param args
      public static void main(String[] args)
        Socket socket=null;
        PrintWriter pw=null;
        BufferedReader bufIn=null;
        InputStreamReader inRead=null;
        InputStream in=null;
        try
                          socket = new Socket("localhost",5555);
                          in = socket.getInputStream();
                          inRead = new InputStreamReader(in);
                          bufIn = new BufferedReader(inRead);
                          pw = new PrintWriter(socket.getOutputStream(),true);
                          int i=0;
                          while (true)
                            i++;
                            try
                              bufIn.readLine();
                              pw.println(i+". message is being send.");
                              System.out.println(i+". message has been send");
                            } catch (Exception ex2)
                              System.out.println(ex2.toString());
                              System.out.println(i+". message could not be send");
                            } finally
                            Thread.sleep(5000);
        } catch (EOFException ex)
                          ex.printStackTrace();
        } catch (InterruptedException ex)
                          ex.printStackTrace();
        } catch (IOException ex)
                          ex.printStackTrace();
        } finally
                          try
                            if(pw!=null)pw.close();
                            if(socket!=null)socket.close();
                          } catch (Exception ex)
                            ex.printStackTrace();
                          } finally
    }

  • Can I use jaxm to build java/tcp based distributed apps?

    I�m interested in exploiting the capabilities of messaging providers in a standard tcp-based distributed app. Is it possible or jaxm/soap is http based?

    JAXM can be http based if you use the SOAPConnection.

  • Host pjc java source code

    Hello Duncan Mills,
    Is it possible for you to paste source code of your sample code host.jar
    i tried to search in many oracle demo files, but could not get it.
    Thanks

    I'm extremely sorry, realizing that i have created new thread under Forms Forum.
    re-pasitng.
    Threadname :
    JDAPI - Reinstate broken inheritance of property
    Hi,
    we have object library and toolbar-canvas,block,item,triggers and items properties and subclassed from it in all our forms.
    by mistake our developers has touched the trigger and inherritance is broken.
    i know with JDAPI programming we can find out broken inheritance item, but i don't know how to reinstate it,
    can anybody post a code to do this, i am particularly interested re-inheriting my toolbar triggers.
    Thanks in advance for all help.
    if(!iTrigger.getParentModule().equals(""))//Check if the Trigger is subclassed
    if(iTrigger.hasOverriddenProperty(JdapiTypes.TRIGGER_TEXT_PTID)) //Check if the Trigger has been overwritten
    ....i need code herein onward.

  • Java TCP/IP Web Applet.

    I was wondering if there are any great resources on the internet or otherwise to learn how to program a Java App that will enable people to conect to it thru the internet.

    The way you connect to it is by using ServerSocket and Socket (this may be obvious). Those classes are quite easy to use. Your subject said it was an applet; applets can only create a socket back to their originating server. So you should check the tutorial mentioned before for threads, servers, and sockets.

  • Best Azure service to host scalable java executeable?

    We have a system currently in demo mode that is a Web API that uses Process.Start to run a .jar file and read its standard out which is JSON. This is not very scalable because each process can consume hundreds of megs of memory each time it spins up. With
    all the various services that Azure offers I am unsure of what the best way to expose this .jar as a scalable service. 
    I know this is a subjective question, but I don't know where else to go. Thank  you.
    Bob - www.ContrivedExample.com

    Hi,
      This is a very subjective question indeed, my suggestion would be to use the Cloud Service Web/Worker role to implement your solution.
      you can refer to the following links that gives more details on the different services so that you make your decision on the best service that suits your needs.
    http://azure.microsoft.com/en-us/documentation/articles/fundamentals-application-models/
    http://azure.microsoft.com/en-in/documentation/articles/choose-web-site-cloud-service-vm/#oss
    http://azure.microsoft.com/en-us/documentation/services/cloud-services/
    Regards,
    Nithin Rathnakar

  • Help needed !! Java TCP

    The server side behaves like as album of images, when clients needs to brows an image, he just send image id over the network. Then server sends this image to client which it is displayed there.
    i know i should use ObjectInputStream and objectOutStream to send and receive images as objects
    i tried to solve it but i didn't work with me
    can any one help me please !!

    still not sure what the problem is...
    can you do
    //on the server:
    String path = "c:/some/path/porn.jpg";
    File f = new File(path);
    HashMap map = new HashMap();
    map.put(path, f);
    //get some image for the client:
    String pathFromClient = getPathFromClient(); //some function that you write
    File image = (File)map.get(pathFromClient);
    if(image != null){
    setImageToClient(image); //some function you write
    }

  • The TCP/IP connection to the host 127.0.0.1 , port 1433 has failed

    hi all,
    i am using SQL2005 server as my database server. i am trying to connect this server in java (i mean using JDBC). i am using windows authentication to connect my sqlserver.
    i have the url connection like this
    DriverManager.getConnection("jdbc:sqlserver://127.0.0.1\\SQL2005/database name",username","password");
    i am trying to connect the server using the above URL, but i couldn't connect it throws an error as the following.
    The TCP/IP connection to the host  127.0.0.1 , port 1433 has failed. Error: "Connection refused: connect. Verify the connection properties, check that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port, and that no firewall is blocking TCP connections to the port.".
    could anyone plz help me to make the connection in right way.
    i have tried to ping via telnet as well, even telnot not able to connect
    plz help me...
    thanks

    Hi,
    Besides Madhu mentioned, please check the TCP/IP port number of the instance of SQL Server.
    1. Open SQL Server Configuration Manager, and then expand SQL Server 2005 Network Configuration.
    2. Click Protocols for InstanceName, and then make sure TCP/IP is enabled in the right panel and double-click TCP/IP.
    3. On the Protocol tab, notice the value of the Listen All item.
    4. Click the IP Addresses tab:
    If the value of Listen All is yes, the TCP/IP port number for this instance of SQL Server 2005 is the value of the TCP Dynamic Ports item under IPAll.
    If the value of Listen All is no, the TCP/IP port number for this instance of SQL Server 2005 is the value of the TCP Dynamic Ports item for a specific IP address.
    5. Make sure the TCP Port is 1433.
    6. Click OK.
    If there are any more questions, please let me know.
    Thanks.
    ***Xiao Min Tan***Microsoft Online Community***

  • The TCP/IP connection to the host localhost, port 1433 has failed.

    Hi, im using sql server 2000,
    i have declared this in my program:
    Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
    String url = "jdbc:sqlserver://localhost:1433;databaseName=Factura";
    Connection conn = DriverManager.getConnection(url,"sa","");and is giving me this exception:
    run:
    Got an exception!
    The TCP/IP connection to the host localhost, port 1433 has failed.
    Error: "connect timed out.
    Verify the connection properties,
    check that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port,
    and that no firewall is blocking TCP connections to the port.".
    com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host localhost, port 1433 has failed.
    Error: "connect timed out. Verify the connection properties,
    check that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port,
    and that no firewall is blocking TCP connections to the port.".
            at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:171)
            at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:1033)
            at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:817)
            at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:700)
            at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:842)
            at java.sql.DriverManager.getConnection(DriverManager.java:582)
            at java.sql.DriverManager.getConnection(DriverManager.java:185)
            at factura.FacturaView.conexion(FacturaView.java:317)
            at factura.FacturaView.jTextField1KeyPressed(FacturaView.java:268)
            at factura.FacturaView.access$900(FacturaView.java:41)
            at factura.FacturaView$5.keyPressed(FacturaView.java:150)
            at java.awt.Component.processKeyEvent(Component.java:6225)
            at javax.swing.JComponent.processKeyEvent(JComponent.java:2801)
            at java.awt.Component.processEvent(Component.java:6044)
            at java.awt.Container.processEvent(Container.java:2041)
            at java.awt.Component.dispatchEventImpl(Component.java:4630)
            at java.awt.Container.dispatchEventImpl(Container.java:2099)
            at java.awt.Component.dispatchEvent(Component.java:4460)
            at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1850)
            at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:712)
            at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:990)
            at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:855)
            at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:676)
            at java.awt.Component.dispatchEventImpl(Component.java:4502)
            at java.awt.Container.dispatchEventImpl(Container.java:2099)
            at java.awt.Window.dispatchEventImpl(Window.java:2478)
            at java.awt.Component.dispatchEvent(Component.java:4460)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
            at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
            at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
            at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
    BUILD SUCCESSFUL (total time: 34 seconds)how can i solve this?
    thanks..
    Edited by: derok on Dec 8, 2010 1:31 PM
    Edited by: derok on Dec 8, 2010 9:14 PM
    Edited by: derok on Dec 11, 2010 1:51 PM
    Edited by: derok on Dec 11, 2010 1:52 PM

    tschodt wrote:
    derok wrote:
    1434 did not worked eitherWhat port is your SQL Server listening on?
    List of active ports:
    C:\> netstat -naboOn linux I would add -l and -t to only get listening TCP ports.netstat -nabo gave me this:
    Active Connections
      Proto  Local Address          Foreign Address        State           PID
      TCP    0.0.0.0:80             0.0.0.0:0              LISTENING       2004
      [httpd.exe]
      TCP    0.0.0.0:135            0.0.0.0:0              LISTENING       1148
      e:\windows\system32\WS2_32.dll
      E:\WINDOWS\system32\RPCRT4.dll
      e:\windows\system32\rpcss.dll
      E:\WINDOWS\system32\svchost.exe
      E:\WINDOWS\system32\ADVAPI32.dll
      [svchost.exe]
      TCP    0.0.0.0:443            0.0.0.0:0              LISTENING       2004
      [httpd.exe]
      TCP    0.0.0.0:445            0.0.0.0:0              LISTENING       4
      [System]
      TCP    0.0.0.0:2869           0.0.0.0:0              LISTENING       1528
      E:\WINDOWS\system32\httpapi.dll
      e:\windows\system32\ssdpsrv.dll
      E:\WINDOWS\system32\RPCRT4.dll
      [svchost.exe]
      TCP    0.0.0.0:3306           0.0.0.0:0              LISTENING       2428
      [mysqld.exe]
      TCP    0.0.0.0:4400           0.0.0.0:0              LISTENING       2592
      [nlsvc.exe]
      TCP    0.0.0.0:7511           0.0.0.0:0              LISTENING       204
      [raysat_3dsmax2010_32server.exe]
      TCP    127.0.0.1:1028         0.0.0.0:0              LISTENING       3080
      [alg.exe]
      TCP    127.0.0.1:5152         0.0.0.0:0              LISTENING       188
      [jqs.exe]
      TCP    192.168.0.101:139      0.0.0.0:0              LISTENING       4
      [System]
      TCP    127.0.0.1:5152         127.0.0.1:1163         CLOSE_WAIT      188
      [jqs.exe]
      TCP    192.168.0.101:2869     192.168.0.1:4563       CLOSE_WAIT      4
      [System]
      UDP    0.0.0.0:500            *:*                                    908
      [lsass.exe]
      UDP    0.0.0.0:445            *:*                                    4
      [System]
      UDP    0.0.0.0:4500           *:*                                    908
      [lsass.exe]
      UDP    0.0.0.0:1434           *:*                                    3036
      [sqlbrowser.exe]
      UDP    127.0.0.1:123          *:*                                    1284
      e:\windows\system32\WS2_32.dll
      e:\windows\system32\w32time.dll
      ntdll.dll
      E:\WINDOWS\system32\kernel32.dll
      [svchost.exe]
      UDP    127.0.0.1:1135         *:*                                    3508
      [iexplore.exe]
      UDP    127.0.0.1:1040         *:*                                    1284
      e:\windows\system32\WS2_32.dll
      E:\WINDOWS\system32\WINHTTP.dll
      E:\WINDOWS\system32\upnp.dll
      E:\WINDOWS\system32\RPCRT4.dll
      E:\WINDOWS\system32\ole32.dll
      [svchost.exe]
      UDP    127.0.0.1:44301        *:*                                    2880
      [PnkBstrA.exe]
      UDP    127.0.0.1:1900         *:*                                    1528
      e:\windows\system32\WS2_32.dll
      e:\windows\system32\ssdpsrv.dll
      E:\WINDOWS\system32\ADVAPI32.dll
      E:\WINDOWS\system32\kernel32.dll
      [svchost.exe]
      UDP    192.168.0.101:1900     *:*                                    1528
      e:\windows\system32\WS2_32.dll
      e:\windows\system32\ssdpsrv.dll
      E:\WINDOWS\system32\ADVAPI32.dll
      E:\WINDOWS\system32\kernel32.dll
      [svchost.exe]
      UDP    192.168.0.101:137      *:*                                    4
      [System]
      UDP    192.168.0.101:123      *:*                                    1284
      e:\windows\system32\WS2_32.dll
      e:\windows\system32\w32time.dll
      ntdll.dll
      -- unknown component(s) --
      [svchost.exe]
      UDP    192.168.0.101:138      *:*                                    4
      [System]Edited by: derok on Dec 10, 2010 11:04 AM
    Edited by: derok on Dec 10, 2010 11:11 AM

  • CVI RT (Real Time) - HOST TCP/IP Communication

    Hi,
    I am using CVI 2012 Real Time with PXI hardware. I am using TCP/IP communication b/n RT and Host. RT is server and Host is client. In my application, after TCP connection is established between client and server, client will send a command , take for example "GET_DATA" to RT, RT has to respond to that by sending that data.
    I am successful in
    Establishing RT-Host TCP communication ( I am able to see that host is reading the welcome message sent by RT).
    Host is sending the command "GET_DATA" to RT.
    RT is receiving the "GET_DATA" command from Host.
    In TCP server call back function, in TCP_DATAREADY event, i am using ServerTCPRead() to read data from Host. After reading the data, i am comparing the data with expected command and based on that i will be sending the data using ServerTCPWrite().
    RT is reading the command from Host, but it is not writing the data to client. I am not sure whether I can use ServerTCPWrite() in TCP Server call back function.
    I also tried using multithreaded concept, but not getting success.
    Please suggest any solution for this.
    Thanks,
    Haari

    Hey Rashid,
    Check out this tutorial with examples and let me know if it helps.
    Stephanie O.
    DIAdem Product Manager
    National Instruments

  • Java running host command - moved from PL/SQL forums

    Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production
    PL/SQL Release 11.1.0.6.0 - Production
    CORE 11.1.0.6.0 Production
    TNS for HPUX: Version 11.1.0.6.0 - Production
    NLSRTL Version 11.1.0.6.0 - Production
    Hi,
    I am not familiar with Java setting in Oracle
    I have a a stored procedure that call a java program to execute host command like
    ssh user1@localhost '/home/user1/someprogram'
    if we execute this directly using PuTTY
    we can do the following with no problem
    su - oracle
    ssh user1@localhost '/home/user1/someprogram'
    but when we execute the stored procedure,
    we have to do
    */usr/bin/ssh* user1@localhost '/home/user1/someprogram'
    does anybody where to set the path or environment to make the java know the path correctly.
    thanks
    ps:. this is happen after we recently upgraded our Oracle from 9.2.0.8 to 11.1.0.6

    pgoel wrote:
    You said,
    a stored procedure that call a java program to execute host command like ssh user1@localhost '/home/user1/someprogram'SP -calls> Java Program (JP) -runs> ssh user1@localhost '/home/user1/someprogram'. is that right? I presume locahost is a database server.correct
    this is the stored procedure
    CREATE OR REPLACE PROCEDURE host_command (p_command  IN  VARCHAR2)
      AS LANGUAGE JAVA
      NAME 'Host.executeCommand (java.lang.String)';and this is the java
    create or replace and compile java source named host as
    import java.io.*;
    public class Host {
      public static void executeCommand(String command) {
        try {
          String[] finalCommand;
          if (isWindows()) {
            finalCommand = new String[4];
            // Use the appropriate path for your windows version.
            finalCommand[0] = "C:\\windows\\system32\\cmd.exe";  // Windows XP/2003
            //finalCommand[0] = "C:\\winnt\\system32\\cmd.exe";  // Windows NT/2000
            finalCommand[1] = "/y";
            finalCommand[2] = "/c";
            finalCommand[3] = command;
          else {
            finalCommand = new String[3];
            finalCommand[0] = "/bin/sh";
            finalCommand[1] = "-c";
            finalCommand[2] = command;
          final Process pr = Runtime.getRuntime().exec(finalCommand);
          pr.waitFor();
          new Thread(new Runnable(){
            public void run() {
              BufferedReader br_in = null;
              try {
                br_in = new BufferedReader(new InputStreamReader(pr.getInputStream()));
                String buff = null;
                while ((buff = br_in.readLine()) != null) {
                  System.out.println("Process out :" + buff);
                  try {Thread.sleep(100); } catch(Exception e) {}
                br_in.close();
              catch (IOException ioe) {
                System.out.println("Exception caught printing process output.");
                ioe.printStackTrace();
              finally {
                try {
                  br_in.close();
                } catch (Exception ex) {}
          }).start();
          new Thread(new Runnable(){
            public void run() {
              BufferedReader br_err = null;
              try {
                br_err = new BufferedReader(new InputStreamReader(pr.getErrorStream()));
                String buff = null;
                while ((buff = br_err.readLine()) != null) {
                  System.out.println("Process err :" + buff);
                  try {Thread.sleep(100); } catch(Exception e) {}
                br_err.close();
              catch (IOException ioe) {
                System.out.println("Exception caught printing process error.");
                ioe.printStackTrace();
              finally {
                try {
                  br_err.close();
                } catch (Exception ex) {}
          }).start();
        catch (Exception ex) {
          System.out.println(ex.getLocalizedMessage());
      public static boolean isWindows() {
        if (System.getProperty("os.name").toLowerCase().indexOf("windows") != -1)
          return true;
        else
          return false;
    Where does Java Progarm reside? On the database server filesystem OR within the Database itslef. within the Database itslef.
    Edited by: HGDBA on Mar 11, 2011 1:50 PM

  • Reposinst Fails With Java Error on OWB 10.2.0.4

    When Warehouse Builder repository creation (reposinst.sh) goes up to 21% (build repository owner) and dies with :
    Before processing SPAWN Token
    *... I am in processSPAWN ...*
    wholeLine =../unix/jvm.sh -classpath ../../../lib/transx.zip:../../../lib/xschema.jar:../../../lib/xsu12.jar:../../../rdbms/jlib/xdb.jar:../../lib/int/rtpplatform.jar:../../lib/int/rtpcommon.jar:../../../jdbc/lib/ojdbc14.jar:../../../lib/xmlparserv2.jar:../../../sqlj/lib/runtime12.jar:../../../jdk/jre/lib/rt.jar oracle.xml.transx.loader (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=%host)(PORT=%port))(CONNECT_DATA=(SERVICE_NAME=%serviceName))) %user %password ../../browserasst/views/owb_uprop_nls.xml
    Connection: host/port/serice_name = HOST_NUMBER/PORT_NUMBER/BASE
    url = (DESCRIPTION=(ADDRESS=(HOST=HOST_NUMBER)(PROTOCOL=tcp)(PORT=PORT_NUMBER))(CONNECT_DATA=(SERVICE_NAME=BASE)))
    *[getConnection]....*
    after executing the output
    *(Spawn Token) Error loading Java into DB:*
    Error occured in 'processSPAWN': java.io.BufferedInputStream@6b93c5
    java.lang.Exception: Error occured in 'processSPAWN': java.io.BufferedInputStream@6b93c5
    at oracle.wh.service.impl.assistant.ProcessEngine.processSPAWN(ProcessEngine.java:886)
    at oracle.wh.service.impl.assistant.ProcessEngine.processFileTokens(ProcessEngine.java:583)
    at oracle.wh.service.impl.assistant.ProcessEngine.createOWBRepository(ProcessEngine.java:269)
    at oracle.wh.ui.install.assistant.wizards.AssistantWizardDefinition$4.runTask(AssistantWizardDefinition.java:531)
    at oracle.ewt.thread.TaskScheduler.runTask(Unknown Source)
    at oracle.ewt.thread.TaskScheduler.processTask(Unknown Source)
    at oracle.ewt.thread.TaskScheduler$TaskQueue.run(Unknown Source)
    at oracle.ewt.timer.Timer.doRun(Unknown Source)
    at oracle.ewt.timer.Timer.run(Unknown Source)
    at java.lang.Thread.run(Thread.java:534)
    *[processSPAWN]: A spawned program error. Exception = java.lang.Exception: Error occured in 'processSPAWN': java.io.BufferedInputStream@6b93c5*
    Get the error, stop processing other tokens...
    java.lang.Exception: Error occured in 'processSPAWN': java.io.BufferedInputStream@6b93c5
    at oracle.wh.service.impl.assistant.ProcessEngine.processSPAWN(ProcessEngine.java:886)
    at oracle.wh.service.impl.assistant.ProcessEngine.processFileTokens(ProcessEngine.java:583)
    at oracle.wh.service.impl.assistant.ProcessEngine.createOWBRepository(ProcessEngine.java:269)
    at oracle.wh.ui.install.assistant.wizards.AssistantWizardDefinition$4.runTask(AssistantWizardDefinition.java:531)
    at oracle.ewt.thread.TaskScheduler.runTask(Unknown Source)
    at oracle.ewt.thread.TaskScheduler.processTask(Unknown Source)
    at oracle.ewt.thread.TaskScheduler$TaskQueue.run(Unknown Source)
    at oracle.ewt.timer.Timer.doRun(Unknown Source)
    at oracle.ewt.timer.Timer.run(Unknown Source)
    at java.lang.Thread.run(Thread.java:534)
    Exception = Exception occured in 'processSPAWN'. java.lang.Exception: Error occured in 'processSPAWN': java.io.BufferedInputStream@6b93c5
    java.lang.Exception: Exception occured in 'processSPAWN'. java.lang.Exception: Error occured in 'processSPAWN': java.io.BufferedInputStream@6b93c5
    at oracle.wh.service.impl.assistant.ProcessEngine.processSPAWN(ProcessEngine.java:898)
    at oracle.wh.service.impl.assistant.ProcessEngine.processFileTokens(ProcessEngine.java:583)
    at oracle.wh.service.impl.assistant.ProcessEngine.createOWBRepository(ProcessEngine.java:269)
    at oracle.wh.ui.install.assistant.wizards.AssistantWizardDefinition$4.runTask(AssistantWizardDefinition.java:531)
    at oracle.ewt.thread.TaskScheduler.runTask(Unknown Source)
    at oracle.ewt.thread.TaskScheduler.processTask(Unknown Source)
    at oracle.ewt.thread.TaskScheduler$TaskQueue.run(Unknown Source)
    at oracle.ewt.timer.Timer.doRun(Unknown Source)
    at oracle.ewt.timer.Timer.run(Unknown Source)
    at java.lang.Thread.run(Thread.java:534)
    java.lang.Exception: Exception occured in 'processSPAWN'. java.lang.Exception: Error occured in 'processSPAWN': java.io.BufferedInputStream@6b93c5
    at oracle.wh.service.impl.assistant.ProcessEngine.processSPAWN(ProcessEngine.java:898)
    at oracle.wh.service.impl.assistant.ProcessEngine.processFileTokens(ProcessEngine.java:583)
    at oracle.wh.service.impl.assistant.ProcessEngine.createOWBRepository(ProcessEngine.java:269)
    at oracle.wh.ui.install.assistant.wizards.AssistantWizardDefinition$4.runTask(AssistantWizardDefinition.java:531)
    at oracle.ewt.thread.TaskScheduler.runTask(Unknown Source)
    at oracle.ewt.thread.TaskScheduler.processTask(Unknown Source)
    at oracle.ewt.thread.TaskScheduler$TaskQueue.run(Unknown Source)
    at oracle.ewt.timer.Timer.doRun(Unknown Source)
    at oracle.ewt.timer.Timer.run(Unknown Source)
    at java.lang.Thread.run(Thread.java:534)
    before open 'UnSuccessDialog'
    *Posting GUI_FINISHED on oracle.wh.ui.owbcommon.OWBWizard$7[frame0,157,58,700x572,invalid,layout=java.awt.BorderLayout,title=Repository Assistant - Summary,resizable,normal,defaultCloseOperation=DO_NOTHING_ON_CLOSE,rootPane=javax.swing.JRootPane[,5,25,690x542,invalid,layout=javax.swing.JRootPane$RootLayout,alignmentX=null,alignmentY=null,border=,flags=385,maximumSize=,minimumSize=,preferredSize=],rootPaneCheckingEnabled=true], isCancelled = false*
    I tried with:
    I Navigated to owb_home/owb/bin/admin; Edited the file jdbcdriver.properties; Replaced driver=thin with driver=oci and Restarted the reposinst. But I did not work.
    And Default Configuration for External Procedures is OK.
    Any another idea?
    Thanks for all!

    > I am in the process of installing CRM 7 with Netweaver on 7.01 on a Windows 2008 64-bit system.  I would have preferred a windows 2003 system, but according to an OSS note (1326698 and 1320013) CRM 7.0 isn't supported on Windows 2003.
    The statement in the note is valid for CRM 7.0 SR1 only!
    > Can anyone suggest what the problem might be?
    Did you disable UAC?
    Markus

Maybe you are looking for

  • Unable to launch project schedule in project pro 2010 via the icon in project center on project server 2010

    Unable to launch a project in project pro 2010 via the icon in project server 2010 project center.  Nothing happens.  The pull down "open" menu doesn't do anything either.  Can't open the schedule in project pro in read-only or edit mode. This is hap

  • I made menu but it plays the first video clip and no autostart

    Hi all, I created a dvd today with a menu, but instead of starting at the menu and letting you choose it automatically plays the first clip when you play the dvd. And when I put the dvd in a dvd player it doesn't automatically play the dvd menu or an

  • Flash Builder 4.6 Update

    I updated through the help menu today and now I have an error I'm unable to find. When I launch Flash Builder a message box appears saying "An error has occured. See the log file [User]\Adobe Flash Builder 4.6\.metadata\.log" Has anyone else come acr

  • My application (SandVox) disapeared in the purchases tab

    ...and I just want to download and install Sandvox I purchased on my MacPro onto my MacBook Pro laptop - keep getting I have a free copy and don't have a register key to make the application "bought".   Dave

  • DMS Solution

    Hello, I want to work on DMS (Document Management System) solution, and i want to know prior developing the application that Is there an integration of scanners and image encoders and decoders (i know its more updated on ver1.4 or with JAI), but have