Connecting J2ME serversocket with J2SE socketconnection

***********connecting J2ME serversocket with J2SE socketconnection *****************
I am currently working on J2ME . Here I have a situation that I need to contact the push registry's socket connection of a midlet from the web server . I apparently wrote a J2SE client socket program to connect the midlet's socket inorder to fire the push registry. But I got a connection failure exception.
I want to know whether i could connect J2ME serversocket with J2SE client socket . The J2SE client socket application is residing at the webserver.If yes, how?
if any extra information needed regarding this , contact me at [email protected]
regards
amar

Yes, we have already done that...using J2ME socket demo server and J2SE as the client. We have also tested it in vice-versa with J2ME socket demo as the client and J2SE as the server and they both worked pretty well. Note : both J2ME 2.0 and 2.1 also J2SE 1.4.2_04. We used the KToolBar and the SUN ONE Studio ME as our IDEs
You can contact me at : [email protected]

Similar Messages

  • J2ME "instead of" J2SE?

    At our company we are thinking about a system that involves slimmed down PCs mounted in trucks. (There will also be an fleet management center at the companies head office.)
    Approx PC spec; 200 - 300 MHz CPU, no harddisk but flash RAM maybe 512 MB, 10 inch TFT color screen. Keyboard and probably a CD/DVD reader. OS; Win CE, WinXP Embedded or Linux.
    A map/navigation application would run on these. Another application will handle forms (an AWT-GUI will probably do).
    We hope to find a commercial map app to install.
    I would like to develop the other app in Java but the PC bulider didn't like the idea of runnig J2SE on that limited platform.
    How about developing in J2ME? Pros and cons?
    Can I just download J2ME from Sun, develop and run as I'm used to with J2SE? If we are running the JRE on Windows. Do we have to implement or port J2ME ourselfs.
    I have developed in J2SE (Swing, Java 2D) and a little in J2EE (JDBC, EJB, Applets).

    The original question is very interesting: should a mobile app move from J2SE to J2ME?
    The answer is not simple at this time because the specs are evolving fast.
    GUI features and h/w and OS portability is definitively a current factor but may not be important for many applications. A corporate application can usually select a set of hardware, OS and Java runtimes to support so all you have to do is make sure that your platform satisfies your business requirements and not the business requirements of the rest of the world.
    Mobile GUI in J2ME is being improved by some new specs in progress and to be implemented probably in runtimes shipped in 2005.
    TCP/IP features are now fully supported by MIDP2 (the socket and server socket are optional in the spec bu the all MIDP2 runtimes being shipped today support them).
    Floating-point arithmetic is now supported by the underlying spec., CLDC 1.1; it was not supported by CLDC 1.0.
    New specs have been proposed recently and are being supported by new J2ME runtimes: for example Wireless Messaging API (JSR-120, WMA) and Mobile Media API (JSR-135, MMA).
    The set of mobile Java specs including MIDP are being regrouped by the JTWI spec: Java Technology for Wireless Industry (JSR-185).
    The way to go in today's fast changing mobile technologies is CLDC and the specs supported by it:
    -      Connected Limited Device Configuration (CLDC)
    -      Mobile Information Device Profile (MIDP)
    -      Java Device Test Suite
    -      Information Module Profile (JSR-195)
    -      Java Technology for Wireless Industry (JSR-185) <<<<<<<<<<<<<<<<<<<<<<<<
    -      Wireless Messaging API (JSR-120)
    -      Mobile Media API (JSR-135)
    -      Location API for J2ME (JSR-179)
    -      SIP API for J2ME (JSR-180)
    -      Security and Trust Services API for J2ME (JSR-177)
    -      Mobile 3D Graphics (JSR-184)
    -      J2ME Web Services (JSR-172)
    -      Bluetooth API (JSR-82, Motorola, Java Partner Site)
    It looks like very soon if not already now, J2ME will have more features than J2SE for most interconnected mobile applications. For example, today, a MIDP2 device can install a new J2ME application over-the-air (OTA), something that cannot be done easily by J2SE, I believe. All the user has to do to install OTA is to browse to the web page with her mobile device that contains an html anchor () to the jad file referencing the application (a MIDlet) and the rest is automatic and the programmer has nothing to write to get this feature.
    serge

  • "Connection timed out" with HttpClient.

    Hi,
    My goal is to consume a web service using Apache AXIS. This web service uses Integrated Windows Authentication.
    I use IE have configured Proxy server address and Proxy server port using IE's Tools -> Internet Options -> Connections Tab -> LAN Settings -> Proxy serer.
    If type the webservice endpoint address of the form http://239.271.380.120/serveme/WS.asmx in my browser then I see in my browser "You are not authorized to view this page .. HTTP Error 401.2 - Unauthorized: Access is denied due to server configuration. Internet Information Services (IIS)" but there is another client in another network who is getting a login dialog to enter domain\\username and password when he types the web service endpoint address in the browser. This makes me think that either the so called another client is in the same domain as the web service provider and I am not.
    Anway, I tried to write standalone HttpClient (I use commons-httpclient-3.0-rc3, commons-codec-1.3, commons-logging-1.0.4) program NTCredentialsClient.java like below :
    NTCredentialsClient.java
    import org.apache.commons.httpclient.*;
    import org.apache.commons.httpclient.auth.*;
    import org.apache.commons.httpclient.methods.*;
    public class NTCredentialsClient {
         public static void main(String args[]) {
              HttpClient client = new HttpClient();
              NTCredentials credentials = new NTCredentials("user1", "password1", "MYDESKTOP", "domain1");
              AuthScope authScope = new AuthScope("20.222.335.37", 3128);
              client.getState().setCredentials(authScope, credentials);
              //client.getState().setCredentials(AuthScope.ANY, credentials);
              GetMethod get = new GetMethod("http://239.271.380.120/serveme/WS.asmx");
              get.setDoAuthentication(true);
              try {
                   int status = client.executeMethod(get);
                   System.out.println(status);
                   get.getResponseBodyAsStream();
                   // print the status and response
                    System.out.println(status + "\n" + get.getResponseBodyAsString());
              catch (Exception e) {
                   e.printStackTrace();
              finally {
                   get.releaseConnection();
    ------------------------------------------------------------------In the above program, user1, password1, domain1 are details given by my service provider and
    MYDESKTOP is my local machine name from which I am running the above program. 20.222.335.37
    is my proxy server address and 3128 is my proxy server port. Now when I run the above
    program I get this exception :
    Aug 16, 2005 12:43:45 PM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
    INFO: I/O exception caught when processing request: Connection timed out: connect
    Aug 16, 2005 12:43:46 PM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
    INFO: Retrying request
    Aug 16, 2005 12:44:11 PM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
    INFO: I/O exception caught when processing request: Connection timed out: connect
    Aug 16, 2005 12:44:11 PM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
    INFO: Retrying request
    Aug 16, 2005 12:44:37 PM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
    INFO: I/O exception caught when processing request: Connection timed out: connect
    Aug 16, 2005 12:44:37 PM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
    INFO: Retrying request
    java.net.ConnectException: Connection timed out: connect
            at java.net.PlainSocketImpl.socketConnect(Native Method)
            at java.net.PlainSocketImpl.doConnect(Unknown Source)
            at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
            at java.net.PlainSocketImpl.connect(Unknown Source)
            at java.net.SocksSocketImpl.connect(Unknown Source)
            at java.net.Socket.connect(Unknown Source)
            at java.net.Socket.connect(Unknown Source)
            at java.net.Socket.<init>(Unknown Source)
            at java.net.Socket.<init>(Unknown Source)
            at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:79)
            at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:121)
            at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:704)
            at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:382)
            at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:168)
            at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
            at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:324)
            at NTCredentialsClient.main(NTCredentialsClient.java:28)
    ------------------------------------------------------------------Can anyone please tell me whether the configurations I have made in my above client program are correct or is there anything that I am overlooking. Also, in the above program for AuthScope constructor, do I need to pass web service server adderss and port OR my local proxy address and local proxy port as constructor arguments ?
    Please suggest ...
    Thanks & Regards,
    Kr.

    You will need to define your proxy settings. In java, these are provided as system properties:
    System.setProperty("http.proxyHost", "<proxy>");
    System.setProperty("http.proxyPort", "<port>");
    If your proxy uses HTTP authentication, you will need to define a few more system properties, which I don't know off the top of my head. This should actually get you connected with the web server, but as for the 302 error, you'll probably need to contact the system administrator.
    Cheers
    Todd.

  • Open  Business Objects report with J2SE

    Hi, How can I do to open a Business Objects report with J2SE aplicattion?
    Thanks,

    Depending on the version of Crystal Reports / Business Objects you have, there are Java libraries you can use to connect to the Business Objects Application server. I spent a lot of time on BO's website figuring it out. In the end i only needed a few libraries to connect, and ask the server to print a report. I remember that there was a way to have the server send a pdf as a binary stream, that you could then save as a pdf file and read. You can do a lot more with the SDK, to the extent of creating your own report creation tool. If you would like some specifics, i might be able to find the some of the documentation i used. It all came from the BO website.
    Wish i could be more help
    chip.
    Edited by: Chipper on Mar 3, 2010 3:29 PM

  • Can JDBC3.0 code coexist with J2SE 1.4 ?

    I am working on a large project that currently is deployed on J2SE 1.3.1.
    One class implements java.sql.Connection and, as there are new methods
    on the Connection interface in J2SE 1.4, this class
    won't compile with 1.4.
    I can add the additional methods to MyConnection, but
    there is no separate jdbc.jar for jdbc 3.0 which means
    I can't execute the modified class with J2SE 1.3.
    Am I missing something here?
    Is there really no way the same code that implements java.sql.Connection can run in both 1.3 and 1.4?
    Peter Booth

    The class is a customized connection that works with our own connection pool.
    The problem is that to have the class compile with Java 1.4, I need to implement
    new methods such as the following. The first method works
    fine but the second depends upon the existence of
    java.sql.SavePoint - which would require the Java 1.4
    JDBC classes.
    I am sure I am not the only person encountering this.
    Is there any reason why a JDBC 3 jar isn't available
    as a separate download?.
    public PreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLException
    throw new java.lang.UnsupportedOperationException(
    "MyConnection: Method prepareStatement(String , String[] ) not implemented yet. \nThis is a Java 1.4 method and we're still using Java 1.3.1 in production");
    public void releaseSavepoint(Savepoint savepoint) throws SQLException
    {                                                                                      throw new java.lang.UnsupportedOperationException(  "MyConnection: Method releaseSavepoint(Savepoint ) not implemented yet. \nThis is a Java 1.4 method and we're still using Java 1.3.1");                                       
    }

  • Use J2ME APIs in J2SE, or vice versa?

    Is it possible to use J2SE APIs in a J2ME MIDlet, or vice versa? Or workarounds?
    The reason why I am even doing this is that I have a study project to make work a communication gateway between 2 systems. And 1 of them provides APIs in J2SE and 1 in J2ME.
    I tried serveral ways.
    1. In a J2ME MIDP 1.0 MIDlet, when calling the APIs provided in J2SE, I get :
    ALERT : Bad method signature
    2. In a J2ME MIDP 2.0 MIDlet, when calling the APIs provided in J2SE, I get :
    a. Before obfuscating:
    java.lang.NoclassDefFoundError:java/net/UnknownHostException:Cannot create class in system package
    at Canvas.<init>(+18)
    at MIDlet.startApp(+15)
    b. After obfuscating:
    Error verifying method MIDlet startApp()V
    Method...
    3. In a J2SE program, when calling J2ME APIs like
    javax.microedition.io.Connector.open(url);
    I get the
    java.lang.UnsatisfiedLinkError
    (see below for more details)
    Any help would be appreciated...
    Wen
    3. Details of java.lang.UnsatisfiedLinkError
    Exception in thread "main"
    java.lang.UnsatisfiedLinkError: getProperty0
    at
    com.sun.midp.Configuration.getProperty0(Native
    Method)
    at
    com.sun.midp.Configuration.getProperty(C:/tmp_java/build_WTK/j2me_mid
    p/src/share/classes/com/sun/midp/Configuration.java:34)
    at
    com.sun.midp.io.InternalConnector.<clinit>(C:/tmp_java/build_WTK/j2me
    _wtk/midp/src/lime/classes/com/sun/midp/io/InternalConnector.java:91)
    at
    javax.microedition.io.Connector.open(C:/tmp_java/build_WTK/j2me_midp/
    src/share/classes/javax/microedition/io/Connector.java:158)
    at
    javax.microedition.io.Connector.open(C:/tmp_java/build_WTK/j2me_midp/
    src/share/classes/javax/microedition/io/Connector.java:138)
    at
    javax.microedition.io.Connector.open(C:/tmp_java/build_WTK/j2me_midp/
    src/share/classes/javax/microedition/io/Connector.java:120)
    at
    terraplay.networking.SendReceiveHTTPDefault.openUrl(SendReceiveHTTPDe
    fault.java:40)
    at
    terraplay.networking.AsyncCommunicationHandler.setup(AsyncCommunicati
    onHandler.java:44)
    at Tgateway12.main(Tgateway12.java:45)

    "J2ME" is strictly speaking not defining any API. It is divided in configurations and profiles like CLDC and MIDP and so called "optional packages" like the WebService-API. All of those might have some classes in common with J2SE but definitely not all. So there might be some overlapping but it's not necessary and I wouldn't know of any configuration or profile being a true subset of j2me. CLDC / MIDP for example define a package javax.microedition that is not part of J2SE

  • Hello all .. i have a big problem in my ipad version 5.1.1 that is when i connect the ipad with my computer the i tunes give me this message ( itunes couldnt connect to this ipad .an unknown error occurred (0xE8000012).) how i can solve this problem pleas

    hello all .. i have a big problem in my ipad version 5.1.1 that is when i connect the ipad with my computer the i tunes give me this message ( itunes couldnt connect to this ipad .an unknown error occurred (0xE8000012).) how i can solve this problem please
    and this is an pic for the problem

    There is some troubleshooting for 0xE8 error codes on this page : http://support.apple.com/kb/TS3221 - you could see if anything on that page fixes it

  • JDBC - Connection is busy with hstmt

    Dear Friends,
    I have created a function with three Statements and three Resultsets, each resultset for each separate statement to execute a select query and have proper close methods too.
    I am executing this function in JComboBox ItemListener. I am getting the error..."Connection is busy with another hstmt"...
    I am using Java Swing with MS SQL Server...
    I solved this error by proper closing of resultsets and statements. But i can't when i call this in itemlistener. can anyone help me pls....
    Regards,
    V.Prasanna

    Try:
    Connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
    I had good luck with it to solve the same problem. I read somewhere that this is forcing the connection to create a new cursor etc...
    ming

  • How to connect my ipad with mac using bluetooth?

    how to connect my ipad with mac using bluetooth?

    You can't so quit trying. Take a look at this to see what is supported with regard to Bluetooth connections in iOS.
    iOS: Supported Bluetooth profiles

  • How to connect my Macbook with an ipad mini in order to have an access to the internet on my iPad?

    Dear fellows, I am having a trouble in how to connect my mac with an iPad mini in order to have an access to the internet.

    If you are attempting to share your iPad mini's cellular data connection with the MacBook, please check out the following Apple Support article for additional details on how to do so.

  • HT1695 How to connect my iPhone with the printers at school? Many thanks

    How to connect my iPhone with the printers at school? Many thanks

    They must be Airprint capable printers... if they are not, then there is no supported way of connecting to them.
    Airprint 101

  • How to connect my E61 with computer using WLAN

    please tell me the full setting of WLAN how i can connect my computer with WLAN

    You can't so quit trying. Take a look at this to see what is supported with regard to Bluetooth connections in iOS.
    iOS: Supported Bluetooth profiles

  • Satellite L500-13e connected to TV with HDMI cable - no sound on TV

    Hi! Sorry my English is bad.
    I have a problem, i tried to connect my notebook with TV through HDMI, but
    sound playing on notebook rather than TV ...
    In Realtek HD Manager i didn't find "HDMI Output options"
    Please, suggest what should I do?

    The whole story is a little bit strange now.
    As far as I know Satellite L500-13E is delivered with preinstalled Vista Home Premium and all drivers must be preinstalled.
    I don't understand how you can suddenly have this yellow question mark in device manager.
    What have you done with your notebook?
    Anyway, at first try to remove sound device from device manager and restart your notebook. If the yellow question mark is still there install Vista sound driver. You can find it on Toshiba download page - http://eu.computers.toshiba-europe.com

  • How to connect my macbook with local network

    hi,
    i would like to connect my macbook with the localnetwork. please guide me how to do it

    If you are attempting to share your iPad mini's cellular data connection with the MacBook, please check out the following Apple Support article for additional details on how to do so.

  • I use "hdmi to component converter" to connect apple tv with my old plasma tv by component cable. Sound is ok but the picture split 2screens left and right. Still can't fix it. Anyone can help or has any idea? should I try convert to av?

    I use "hdmi to component converter" to connect apple tv with my old plasma tv by component cable. Sound is ok but the picture split 2screens left and right. Still can't fix it. Anyone can help or has any idea? should I try convert to av?

    Your TV hasn't entered some odd picture in picture mode has it with  two 'inputs' side by side?
    AC

Maybe you are looking for