SocketConnection example in MIDP 2.0 javadoc doesn't work

Good Afternoon every1,
I am having a problem in establishing a TCP connection, the following code doesn't work:
try{
            SocketConnection sc = (SocketConnection)Connector.open("socket://localhost:5555");
            sc.setSocketOption(SocketConnection.LINGER, 5);
            System.out.println("Connected\n");
            InputStream is  = sc.openInputStream();
            OutputStream os = sc.openOutputStream();
            os.write("\r\n".getBytes());
            int ch = 0;
            while(ch != -1) {
                ch = is.read();
            is.close();
            os.close();
            sc.close();
        } catch (Exception ex) {
            ex.printStackTrace();
and the stack trace of the exception is as follows:
javax.microedition.io.ConnectionNotFoundException: TCP open
at com.sun.midp.io.j2me.socket.Protocol.connect(Protocol.java:216)
at com.sun.midp.io.ConnectionBaseAdapter.openPrim(ConnectionBaseAdapter.java:100)
at com.sun.midp.io.j2me.socket.Protocol.openPrim(+108)
at javax.microedition.io.Connector.openPrim(Connector.java:302)
at javax.microedition.io.Connector.open(Connector.java:211)
at javax.microedition.io.Connector.open(Connector.java:187)
at javax.microedition.io.Connector.open(Connector.java:169)
at hello.HelloMidlet.<init>(HelloMidlet.java:25)
at java.lang.Class.runCustomCode(+0)
at com.sun.midp.midlet.MIDletState.createMIDlet(+19)
at com.sun.midp.midlet.Selector.run(Selector.java:151)
So It crashes before establishing the connection, I tried more than other connection type: StreamConnection, HttpConnection...but it was useless as the same exception happens...Can any1 help me in resolving this issue plzz ??
Thanks a lot...

The 2.0 map now claims I'm 6-7 miles SW of where I really am. I'm glad I'm not alone with the map bug, but I don't have the other problems you are describing.

Similar Messages

  • Response.sendRedirect doesn't work with Internet Explorer

    I do posts like advised here: http://www.theserverside.com/tt/articles/article.tss?l=RedirectAfterPost. GET-POST-REDIRECT-GET. Now I have a problem when do redirecting to the same page in Internet Explorer. It works good with Mozilla Firefox but not with Internet Explorer. When user click to "Enable"/"Disable" link and do submit, application makes changes on the database. Changes occurs, but redirect to the page doesn't work. When I refresh page, I see that, the changes was occurred. When I use Mozilla Firefox with same JSP, there is no need to refresh page, because, redirect works. When I change redirect URL to other, for example http://www.google.com/, redirect doesn,t work in Internet Explorer too.
    Code of users.jsp JSP:
    <%@ page import="az.ub.ccs.beans.User" %>
    <%@ page contentType="text/html;charset=UTF-8" language="java" %>
    <%@ page errorPage="error.jsp" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <jsp:useBean id="bc" scope="page" class="az.ub.ccs.beans.BreadCrumb" />
    <jsp:useBean id="user" scope="request" class="az.ub.ccs.beans.User"/>
    <c:if test="${sessionScope.active == null}"><c:redirect url="login.jsp" /></c:if>
    <%
       if(request.getParameter("stateAction") != null)
          int state = (request.getParameter("stateAction").equals("enable")) ? 0 : 1;
          User.changeUserState(Integer.parseInt(request.getParameter("itemID")), state);
          response.sendRedirect("users.jsp");
          //response.setStatus(HttpServletResponse.SC_SEE_OTHER);
          //response.setHeader("Location", "users.jsp");
       bc.add("Users");
    %>
    <jsp:include page="top.jsp" flush="true">
       <jsp:param name="breadCrumbString" value="${bc.breadCrumbsAsHTML}"/>
       <jsp:param name="pageTitle" value="Users"/>
    </jsp:include>
    <tr>
       <td>
          <table border="1" width="100%">
             <tr class="tableHeader">
                <td>ID</td>
                <td>&#1048;&#1084;&#1103; &#1087;&#1086;&#1083;&#1100;&#1079;&#1086;&#1074;&#1072;&#1090;&#1077;&#1083;&#1103;</td>
                <td>&#1051;&#1086;&#1075;&#1080;&#1085;</td>
                <td>&#1053;&#1086;&#1084;&#1077;&#1088; &#1075;&#1088;&#1091;&#1087;&#1087;&#1099;</td>
                <td>&#1053;&#1072;&#1079;&#1074;&#1072;&#1085;&#1080;&#1077; &#1075;&#1088;&#1091;&#1087;&#1087;&#1099;</td>
                <td>Email</td>
                <td>&#1053;&#1086;&#1084;&#1077;&#1088;</td>
                <td colspan="2">&#1044;&#1077;&#1081;&#1089;&#1090;&#1074;&#1080;&#1077;</td>
             </tr>
             <c:forEach items="${user.userList}" var="user">
             <tr>
                <td align="right">"${user.userID}"</td>
                <td><c:out value="${user.userName}"/></td>
             </c:forEach>
             <tr>
                <td colspan="7"> </td>
                <td colspan="2"><a href="addEditUser.jsp">[Add new]</a></td>
             </tr>
          </table>
          <form name="stateForm" method="post" action="users.jsp">
             <input type="hidden" name="itemID"/>
             <input type="hidden" name="stateAction"/>
          </form>
       </td>
    </tr>
    <jsp:include page="bottom.jsp" flush="true"/>

    I use HttpWatch to see request and response details. Link to the report file of HttpWatch http://tasadar8.googlepages.com/CCSHttpWatch.rar

  • TagExtraInfo example in weblogic 5.1 doesn't work!!!!!

              Hi
              i was trying example given in weblogic 5.1 i.e. session list. that uses tagextrainfo
              class to set the attributes in JSP. but it doesn't work.
              Please respond to this error.
              i am attaching error docs error.txt
              On Browser
              Compilation of 'E:\weblogic\myserver\classfiles\jsp_servlet\_sessionlist.java'
              failed:
              E:\weblogic\myserver\classfiles\jsp_servlet\_sessionlist.java:93: cannot resolve
              symbol
              probably occurred due to an error in /SessionList.jsp line 49:
              <td><%= name %></td>
              E:\weblogic\myserver\classfiles\jsp_servlet\_sessionlist.java:95: cannot resolve
              symbol
              probably occurred due to an error in /SessionList.jsp line 50:
              <td><%= value %></td>
              E:\weblogic\myserver\classfiles\jsp_servlet\_sessionlist.java:99: cannot resolve
              symbol
              probably occurred due to an error in /SessionList.jsp line 51:
              <td><a href="<%=request.getRequestURI()%>?action=delete&delName=<%=name%>">
              On Server Console
              Mon Oct 08 18:26:06 GMT+05:30 2001:<I> <ServletContext-General> looking for taglib
              uri session.tld a
              s resource /WEB-INF/session.tld in Web Application root:
              Mon Oct 08 18:26:10 GMT+05:30 2001:<I> <ServletContext-General> Generated java
              file: E:\weblogic\mys
              erver\classfiles\jsp_servlet\_sessionlist.java
              Mon Oct 08 18:26:29 GMT+05:30 2001:<E> <ServletContext-General> Compilation of
              E:\weblogic\myserver\
              classfiles\jsp_servlet\_sessionlist.java failed:
              E:\weblogic\myserver\classfiles\jsp_servlet\_sessionlist.java:93: cannot resolve
              symbol
              symbol : variable name
              location: class jsp_servlet._sessionlist
              out.print(weblogic.utils.StringUtils.valueOf( name )); //[ /SessionList.jsp;
              Line: 49]
              ^
              E:\weblogic\myserver\classfiles\jsp_servlet\_sessionlist.java:95: cannot resolve
              symbol
              symbol : variable value
              location: class jsp_servlet._sessionlist
              out.print(weblogic.utils.StringUtils.valueOf( value )); //[ /SessionList.jsp;
              Line: 50]
              ^
              E:\weblogic\myserver\classfiles\jsp_servlet\_sessionlist.java:99: cannot resolve
              symbol
              symbol : variable name
              location: class jsp_servlet._sessionlist
              out.print(weblogic.utils.StringUtils.valueOf(name)); //[ /SessionList.jsp;
              Line: 51]
              ^
              3 errors
              java.io.IOException: Compiler failed executable.exec([Ljava.lang.String;[d:/jdk1.3/bin/javac.exe,
              -c
              lasspath, d:\jdk1.3\jre\lib\rt.jar;d:\jdk1.3\jre\lib\i18n.jar;d:\jdk1.3\jre\lib\sunrsasign.jar;d:\jd
              k1.3\jre\classes;.\lib\weblogic510sp10boot.jar;.\classes\boot;.\eval\cloudscape\lib\cloudscape.jar;d
              :\jdk1.3\lib\tools.jar;;.\license;.\lib\weblogic510sp10.jar;.\classes;.\lib\weblogicaux.jar;.\myserv
              er\serverclasses;E:\weblogic\myserver\servletclasses;E:\weblogic\myserver\public_html;E:\weblogic\my
              server\classfiles;null, -d, E:\weblogic\myserver\classfiles, E:\weblogic\myserver\classfiles\jsp_ser
              vlet\_sessionlist.java])
              at weblogic.utils.compiler.CompilerInvoker.compileMaybeExit(CompilerInvoker.java:459)
              at weblogic.utils.compiler.CompilerInvoker.compile(CompilerInvoker.java:249)
              at weblogic.servlet.jsp.JspStub.compilePage(JspStub.java:366)
              at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:227)
              at weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:200)
              at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:115)
              at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:138)
              at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:922)
              at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:886)
              at weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContextManager.java:
              269)
              at weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:380)
              at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:268)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:129)
              Mon Oct 08 18:26:31 GMT+05:30 2001:<E> <ServletContext-General> Servlet failed
              with Exception
              java.io.IOException: Compiler failed executable.exec([Ljava.lang.String;[d:/jdk1.3/bin/javac.exe,
              -c
              lasspath, d:\jdk1.3\jre\lib\rt.jar;d:\jdk1.3\jre\lib\i18n.jar;d:\jdk1.3\jre\lib\sunrsasign.jar;d:\jd
              k1.3\jre\classes;.\lib\weblogic510sp10boot.jar;.\classes\boot;.\eval\cloudscape\lib\cloudscape.jar;d
              :\jdk1.3\lib\tools.jar;;.\license;.\lib\weblogic510sp10.jar;.\classes;.\lib\weblogicaux.jar;.\myserv
              er\serverclasses;E:\weblogic\myserver\servletclasses;E:\weblogic\myserver\public_html;E:\weblogic\my
              server\classfiles;null, -d, E:\weblogic\myserver\classfiles, E:\weblogic\myserver\classfiles\jsp_ser
              vlet\_sessionlist.java])
              at weblogic.utils.compiler.CompilerInvoker.compileMaybeExit(CompilerInvoker.java:459)
              at weblogic.utils.compiler.CompilerInvoker.compile(CompilerInvoker.java:249)
              at weblogic.servlet.jsp.JspStub.compilePage(JspStub.java:366)
              at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:227)
              at weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:200)
              at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:115)
              at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:138)
              at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:922)
              at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:886)
              at weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContextManager.java:
              269)
              at weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:380)
              at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:268)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:129)
              waitng for answer.
              Regards
              Abhi
    </a>

              Hi
              i was trying example given in weblogic 5.1 i.e. session list. that uses tagextrainfo
              class to set the attributes in JSP. but it doesn't work.
              Please respond to this error.
              i am attaching error docs error.txt
              On Browser
              Compilation of 'E:\weblogic\myserver\classfiles\jsp_servlet\_sessionlist.java'
              failed:
              E:\weblogic\myserver\classfiles\jsp_servlet\_sessionlist.java:93: cannot resolve
              symbol
              probably occurred due to an error in /SessionList.jsp line 49:
              <td><%= name %></td>
              E:\weblogic\myserver\classfiles\jsp_servlet\_sessionlist.java:95: cannot resolve
              symbol
              probably occurred due to an error in /SessionList.jsp line 50:
              <td><%= value %></td>
              E:\weblogic\myserver\classfiles\jsp_servlet\_sessionlist.java:99: cannot resolve
              symbol
              probably occurred due to an error in /SessionList.jsp line 51:
              <td><a href="<%=request.getRequestURI()%>?action=delete&delName=<%=name%>">
              On Server Console
              Mon Oct 08 18:26:06 GMT+05:30 2001:<I> <ServletContext-General> looking for taglib
              uri session.tld a
              s resource /WEB-INF/session.tld in Web Application root:
              Mon Oct 08 18:26:10 GMT+05:30 2001:<I> <ServletContext-General> Generated java
              file: E:\weblogic\mys
              erver\classfiles\jsp_servlet\_sessionlist.java
              Mon Oct 08 18:26:29 GMT+05:30 2001:<E> <ServletContext-General> Compilation of
              E:\weblogic\myserver\
              classfiles\jsp_servlet\_sessionlist.java failed:
              E:\weblogic\myserver\classfiles\jsp_servlet\_sessionlist.java:93: cannot resolve
              symbol
              symbol : variable name
              location: class jsp_servlet._sessionlist
              out.print(weblogic.utils.StringUtils.valueOf( name )); //[ /SessionList.jsp;
              Line: 49]
              ^
              E:\weblogic\myserver\classfiles\jsp_servlet\_sessionlist.java:95: cannot resolve
              symbol
              symbol : variable value
              location: class jsp_servlet._sessionlist
              out.print(weblogic.utils.StringUtils.valueOf( value )); //[ /SessionList.jsp;
              Line: 50]
              ^
              E:\weblogic\myserver\classfiles\jsp_servlet\_sessionlist.java:99: cannot resolve
              symbol
              symbol : variable name
              location: class jsp_servlet._sessionlist
              out.print(weblogic.utils.StringUtils.valueOf(name)); //[ /SessionList.jsp;
              Line: 51]
              ^
              3 errors
              java.io.IOException: Compiler failed executable.exec([Ljava.lang.String;[d:/jdk1.3/bin/javac.exe,
              -c
              lasspath, d:\jdk1.3\jre\lib\rt.jar;d:\jdk1.3\jre\lib\i18n.jar;d:\jdk1.3\jre\lib\sunrsasign.jar;d:\jd
              k1.3\jre\classes;.\lib\weblogic510sp10boot.jar;.\classes\boot;.\eval\cloudscape\lib\cloudscape.jar;d
              :\jdk1.3\lib\tools.jar;;.\license;.\lib\weblogic510sp10.jar;.\classes;.\lib\weblogicaux.jar;.\myserv
              er\serverclasses;E:\weblogic\myserver\servletclasses;E:\weblogic\myserver\public_html;E:\weblogic\my
              server\classfiles;null, -d, E:\weblogic\myserver\classfiles, E:\weblogic\myserver\classfiles\jsp_ser
              vlet\_sessionlist.java])
              at weblogic.utils.compiler.CompilerInvoker.compileMaybeExit(CompilerInvoker.java:459)
              at weblogic.utils.compiler.CompilerInvoker.compile(CompilerInvoker.java:249)
              at weblogic.servlet.jsp.JspStub.compilePage(JspStub.java:366)
              at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:227)
              at weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:200)
              at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:115)
              at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:138)
              at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:922)
              at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:886)
              at weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContextManager.java:
              269)
              at weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:380)
              at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:268)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:129)
              Mon Oct 08 18:26:31 GMT+05:30 2001:<E> <ServletContext-General> Servlet failed
              with Exception
              java.io.IOException: Compiler failed executable.exec([Ljava.lang.String;[d:/jdk1.3/bin/javac.exe,
              -c
              lasspath, d:\jdk1.3\jre\lib\rt.jar;d:\jdk1.3\jre\lib\i18n.jar;d:\jdk1.3\jre\lib\sunrsasign.jar;d:\jd
              k1.3\jre\classes;.\lib\weblogic510sp10boot.jar;.\classes\boot;.\eval\cloudscape\lib\cloudscape.jar;d
              :\jdk1.3\lib\tools.jar;;.\license;.\lib\weblogic510sp10.jar;.\classes;.\lib\weblogicaux.jar;.\myserv
              er\serverclasses;E:\weblogic\myserver\servletclasses;E:\weblogic\myserver\public_html;E:\weblogic\my
              server\classfiles;null, -d, E:\weblogic\myserver\classfiles, E:\weblogic\myserver\classfiles\jsp_ser
              vlet\_sessionlist.java])
              at weblogic.utils.compiler.CompilerInvoker.compileMaybeExit(CompilerInvoker.java:459)
              at weblogic.utils.compiler.CompilerInvoker.compile(CompilerInvoker.java:249)
              at weblogic.servlet.jsp.JspStub.compilePage(JspStub.java:366)
              at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:227)
              at weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:200)
              at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:115)
              at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:138)
              at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:922)
              at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:886)
              at weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContextManager.java:
              269)
              at weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:380)
              at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:268)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:129)
              waitng for answer.
              Regards
              Abhi
    </a>

  • I just downlouded the latest version of the Muse CC and it doesn't work well, it freezes all the time, in particular with the tools. Example the selection tool doesen't wor at all.

    I just downlouded the latest version of the Muse CC and it doesn't work well, it freezes all the time, in particular with the tools. Example the selection tool doesn't wor at all. Is there any solution for this problem?

    Hi!
    I restarted the computer, but the same issue happens again. When I move my mouse over some object or tool, it doesn’t come active at all (only some of the tools works) When I try to change “site properties”, I can’t choose tablet or phone mode or even I can’t select the checkboxes, only thing what I can do is change the numbers (high and width) . After all the main problem is that I can’t select some of the items or functions by mouse, but only by the keyboard.

  • Oracle standard example doesn't work

    Hi All,
    I am surprsied to see that following standard example from Oracle doesn't work as expected. http://www.oracle.com/technology/products/integration/esb/files/stringtoxml.zip
    Did any one face same error with it?
    Regards,
    Vigni

    Hi,
    The xml string is not valid, you need to place the following part at the beginning of the string:
    &lt;?xml version="1.0" encoding="UTF-8"?&gt;
    So the first line needs to read:
    String in = "&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\n<parameters xmlns=\"http://www.tcs.com/WSIF/insurance/IdentifyPolicy/1.0\">\n" +
    You also must change the indexOf parts to >=0 instead of >0. the parseString method should be:
    public static NodeList parseString1(String inputXML) throws XMLParseException,
    SAXException,
    IOException {
    System.out.println(inputXML);
    StringBuffer s4= new StringBuffer(inputXML);
    int index = 0;
    while(s4.indexOf("&gt;") > 0 || s4.indexOf("&lt;") >= 0){
    index = s4.indexOf("&gt;");
    if (index>=0)
    s4.replace(index,index+4,">");
    index = s4.indexOf("&lt;");
    if (index >=0)
    s4.replace(index,index+4,"<");
    System.out.println(s4.toString());
    DOMParser parser1 = new DOMParser();
    ByteArrayInputStream Bis1 = new ByteArrayInputStream(s4.toString().getBytes());
    parser1.parse(Bis1);
    XMLDocument xd1= parser1.getDocument();
    return (xd1.getChildNodes());
    Regards,
    Andre

  • Why this example doesn't work ?

    for example below:
    html code:
    <applet code=LunarPhasesRB.class width="200" height="200">
        </applet>when i run it on IE , i get below result:
    failed to loading java program.
    why it doesn't work on IE ?
    who can help me ?
    thanks !

    thanks a lot!
    left of web browser appear below info:
    small application program LunarPhasesRB notinited
    what does it mean ?
    if i click "Click to activate and use this control".
    another err:
    failed to loading java program.
    who can help me ?

  • RMI example just doesn't work (jdk1.5.0_01+jdk1.5.0)

    Hi!
    RMI example from the "Getting Started Using Java RMI" (http://java.sun.com/j2se/1.5.0/docs/guide/rmi/hello/hello-world.html) doesn't work.
    Everything compiles fine , but when starting server with a command:
    java -classpath test example.hello.Server
    it says (on Linux Fedora Core 2):
    Server exception: java.lang.NullPointerException
    java.lang.NullPointerException
    at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
    at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:343)
    at sun.rmi.registry.RegistryImpl_Stub.bind(Unknown Source)
    at example.hello.Server.main(Server.java:61)
    On the Windows( XP SP2) it says:
    Server exception: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
    java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
    java.lang.ClassNotFoundException: example.hello.Hello
    java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
    java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
    java.lang.ClassNotFoundException: example.hello.Hello
    at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:385)
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:240)
    at sun.rmi.transport.Transport$1.run(Transport.java:153)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
    at java.lang.Thread.run(Thread.java:595)
    at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
    at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:343)
    at sun.rmi.registry.RegistryImpl_Stub.bind(Unknown Source)
    at example.hello.Server.main(Server.java:61)
    Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
    java.lang.ClassNotFoundException: example.hello.Hello
    at sun.rmi.registry.RegistryImpl_Skel.dispatch(Unknown Source)
    at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:375)
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:240)
    at sun.rmi.transport.Transport$1.run(Transport.java:153)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
    at java.lang.Thread.run(Thread.java:595)
    Caused by: java.lang.ClassNotFoundException: example.hello.Hello
    at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:242)
    at sun.rmi.server.LoaderHandler.loadProxyInterfaces(LoaderHandler.java:707)
    at sun.rmi.server.LoaderHandler.loadProxyClass(LoaderHandler.java:651)
    at sun.rmi.server.LoaderHandler.loadProxyClass(LoaderHandler.java:588)
    at java.rmi.server.RMIClassLoader$2.loadProxyClass(RMIClassLoader.java:628)
    at java.rmi.server.RMIClassLoader.loadProxyClass(RMIClassLoader.java:294)
    at sun.rmi.server.MarshalInputStream.resolveProxyClass(MarshalInputStream.java:238)
    at java.io.ObjectInputStream.readProxyDesc(ObjectInputStream.java:1494)
    at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1457)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1693)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
    ... 9 more
    Is it possible to make it work somehow?
    Thank you!
    Dmitriy Ulupov

    There is quite enough data in the exception to figure this out, and the answer is 'none of the above'. Have a look at this:
    java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
    java.lang.ClassNotFoundException: example.hello.Hello
    java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
    java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
    java.lang.ClassNotFoundException: example.hello.Hello
    at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:385)
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:240)
    at sun.rmi.transport.Transport$1.run(Transport.java:153)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
    at java.lang.Thread.run(Thread.java:595)
    at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall .java:247)
    at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:343)
    at sun.rmi.registry.RegistryImpl_Stub.bind(Unknown Source)The basic problem is java.lang.ClassNotFoundException: example.hello.Hello
    and it occurs remotely when executing Naming.bind, i.e. it happens in the Registry. In other words the Registry cannot find examples.hello.Hello. There are several solutions to this including modifying the Registry's classpath or using the RMI codebase feature.

  • JClient query by example doesn't work in 10.1.2.

    I've a JClient application I migrated from 9.0.4 to 10.1.2.
    In the migrated app query by example doesn't work anymore in JTables.
    Could someone help ?
    Tks
    Tullio

    Frank, I got a testcase from Tullio. It's a 9.0.4 project uding JClient that is pre-ADF bindings.
    I migrated his 9.0.4 project to 9.0.5.2 first.
    In 9.0.5.2, I see already a change in behavior related to enter-query mode in the JTable, but the number of rows displayed looks correct.
    Tullio, can you confirm if the problem you are seeing vis a vis enter query mode is that if you:
    1. Click enter-query button
    2. Click into a field like Ename and type SMITH but don't [Tab] out of that field yet
    3. Click on the execute-query button
    It behaves as if you've entered no criteria there.
    If at step 2 above you clicked [Tab] to exit the field where you typed SMITH, then it works correctly.
    Is this the enter-query-JTable-related problem you're seeing (that is, related to when you don't focus-out of the field?)
    The "number-of-rows-displayed" issue you mention in this other thread (10.1.2 JClient binding Error. does reproduce with your testcase only in 10.1.2 (as well as also still having this 9.0.5.2 focus-related issue in enter query mode).

  • The vga adapter (for a Benq projector, for example) is only for Ipod touch 4g? I have an 2g. Doesn't work for this?

    The vga adapter (for a Benq projector, for example) is only for Ipod touch 4g? I have an 2g. Doesn't work for this?
    Thanks in advance.

    The VGA is for the 4G iPod only. The 2G can use the composite and component cables.
    http://support.apple.com/kb/HT1454

  • Rich Textbox example doesn't work in Windows 7

    In the past I use the Rich Textbox example (\samples\userint\activex\richTextxbox.prj) in Windows XP (CVI 2010 SP1).
    Now I noticed that this example doesn't work in Windows 7 64-bit because the ActiveX is not registered on the system (see attached error.jpg).
    Isn't this control installed by CVI IDE itself?
    How can I get this example working on my Win 7 64-bit machine?
    Vix
    In claris non fit interpretatio
    Using LV 2013 SP1 on Win 7 64bit
    Using LV 8.2.1 on WinXP SP3
    Using CVI 2012 SP1 on Win 7 64bit, WinXP and WinXP Embedded
    Using CVI 6.0 on Win2k, WinXP and WinXP Embedded
    Solved!
    Go to Solution.
    Attachments:
    error.JPG ‏29 KB

    Hi Vix
    It looks like the Rich Textbox control component provided by one of the VB runtimes is no longer included by default with Windows 7.
    I have been able to manually register the ActiveX control using Regsvr32 as described in the following Microsoft KB.
    I was able to download the needed ActiveX control from here and from there you need to copy the .ocx ActiveX control to your C:\Windows\SysWOW64 directory. Open up a command prompt as administrator and run 'REGSVR32 RICHTX32.OCX'.
    SysWOW64 is the 'Windows On Windows' emulation directory which is used for running 32 bit controls in a 64 bit environment.
    I realise this isn't the best solution as it will make application deployment a little more complicated, another solution may be to use another RTF ActiveX control such as the one here: http://www.lebans.com/richtext.htm.
    Thanks
    Chris | Applications Engineer NIUK

  • In "Examples" sendMailServlet doesn't work

    I installed tomcat4.0.3 in a linux machine. Everything is ok, all examples work, but only the last one does not. I get
    Apache Tomcat/4.0.3 - HTTP Status 503 - Servlet SendMailServlet is currently unavailable
    What is wrong?

    Hi,
    In "Examples" sendMailServlet doesn't work?Please find the extract from http://www.bigblock.com/support/wri_http.htm
    for HTTP error status 503
    503 Service Unavailable
    The web server is too busy processing current requests to
    listen to a new client. This error represents a serious
    problem with the webserver (normally solved with a reboot).
    Try again after restarting the Tomcat Server.
    Hope this helps.
    Good Luck.
    Gayam.Srinivasa Reddy
    Developer Technical Support
    Sun Micro Systems
    http://www.sun.com/developers/support/

  • Class unloading doesn't work as described in this forum !!!

    Hi,
    to the problem of dynamic class unloading many people in this forum wrote:
    - write your own class loader
    - load the class to be unloaded later
    - set all instances of your own class loader to null
    - if the work is done set all instances of the loaded classes to null
    - call the garbage collector and the classes will be removed
    I constructed a simple test for the problem:
    - the test class
    public class Impl {
    public String getVersion () {
    return "1";
    - instanciating the test class
    - printing the value of getVersion() to the screen
    - changing the return value of getVersion() and recompiling it (the test application is still runnig)
    - unload try (see below)
    - instanciating the test class
    - printing the value of getVersion() to the screen
    Back to the tipps above. Why doing this? The theory says a class loader stores every loaded class for
    suppressing unnecessary reloads. In reality the classes are NOT stored in the own class loader but in
    the parent of it. If no parameter is given to a class loader's constructor the parent of a class loader
    is the system classloader.
    Let's have a look at the source code of java.lang.ClassLoader.loadClass(...):
    protected synchronized Class loadClass(String name, boolean resolve)
    throws ClassNotFoundException
    // First, check if the class has already been loaded
    Class c = findLoadedClass(name);
    if (c == null) {
    try {
    if (parent != null) {
    ### here the loadClass() of the parent is called and the
    ### loaded class is stored within the parent
    c = parent.loadClass(name, false);
    } else {
    c = findBootstrapClass(name);
    } catch (ClassNotFoundException e) {
    // If still not found, then call findClass in order
    // to find the class.
    c = findClass(name);
    if (resolve) {
    resolveClass(c);
    return c;
    My Idea was: Give a null to the class loader's constructor so the classes cannot be stored within a parent.
    Here my test class loader (it is build as it is described within javadoc of java.lang.ClassLoader
    except the constructor):
    import java.io.*;
    public class MyClassLoader extends ClassLoader {
    public MyClassLoader () {
    super ( null );
    public Class findClass ( String name ) {
    byte[] b = loadClassData ( name );
    return defineClass ( name, b, 0, b.length );
    private byte[] loadClassData ( String name ) {
    byte[] ret = null;
    try {
    InputStream in = new FileInputStream ( name + ".class" );
    ret = new byte[in.available ()];
    in.read ( ret );
    } catch ( Exception e ) {
    e.printStackTrace ();
    return ret;
    The loading of the class works fine
    ClassLoader cl = new MyClassLoader ();
    Class c = cl.loadClass ( "Impl" );
    Object i = c.newInstance ();
    Impl impl = (Impl)i;
    The class "Impl" was found and instanciated. But the cast "Impl impl = (Impl)i;" causes a
    "java.lang.ClassCastException: Impl"
    May second idea was deleting all instances of the class to unload from the class loader via reflection.
    A strange way I know but if this is the only way I will do it. But this doesn't work too.
    After deleting the class from the class loader and all its parents the class is still anywhere in the depth
    of the VM.
    Can anybody help me with this problem?
    Thanks in advance,
    Axel.

    <pre>
    I made a similar and simpler program and it worked:
    import java.net.URLClassLoader;
    import java.net.URL;
    public class DynamicExtension {
         public static void main(String args[]) throws Exception {
              URL[] ua = new URL[] {  new URL("file://c:\\TEMP\\") };
              URLClassLoader ucl = new URLClassLoader(ua);
              MyLoadable l =
                   (MyLoadable) ucl.loadClass("LoadableObject").newInstance();
              l.printVersion();
              Thread.currentThread().sleep(10000);
    //you have ten seconds to replace the old version of the LoadableObject.class file
    //so yo?d better had compiled the new one before executing this
              ucl = new URLClassLoader(ua);
              l = (MyLoadable) ucl.loadClass("LoadableObject").newInstance();
              l.printVersion();
              ucl = null;
              l = null;
              System.gc();
    public class LoadableObject implements MyLoadable {
         public void printVersion() {
              System.out.println("version 1");
         protected void finalize() {
              System.out.println("finalizing " + this);
    public interface MyLoadable {     void printVersion();  }
    C:\Java\TIJ2\Test>java DynamicExtension
    version 1
    version 2
    finalizing LoadableObject@1bd03e
    finalizing LoadableObject@4abc9
    The ClassCastException was due to the fact that one class was loaded by the system class loader, the one that appers as Impl impl = (Impl), and the other by MyClassLoader. That mean that they are different for the VM because they are in different namespaces: The namespace for MyClassLoader is the set of classes loaded by itself and those returned to it by his parent class loader as a result of a request to MyClassLoader?s parent class loader to load a class.
    Setting null for the parent of MyClassLoader was in fact the cause of the problem, because that caused a call to a native method called findBoostrapClass. I guess this method looks for the classes in the bootstrap classpath where MyClassLoader shouldn?t be. This causes MyClassLoader loaded the class itself. If MyClassLoader had had the system class loader as its parent the result had been that only one classloader would have loaded the class. This is what happens in the example above so no ClassCastException is thrown.
    In the source code for ClassLoader
    there is the following:
    * The classes loaded by this class loader. The only purpose of this
    * table is to keep the classes from being GC'ed until the loader
    * is GC'ed.
    private Vector classes = new Vector(); /*
    and:
    * Called by the VM to record every loaded class with this loader.
    void addClass(Class c) {
    classes.addElement(c);
    I would like to have seen findLoadedClass checking the already loaded classes in this Vector, but this method is native. Anyway, as the code for loadClass shows, the parent or bootstrap classloader is checked if findLoadedClass doesn?t find the class; Can we guess that findLoadedClass only checks the clases loaded by the classloader, not its parent?
    By the way, could an example like this be made in c++?
    </pre>

  • HTTP Connection KeepAlive doesn't work!

    Hello,<br>
    <br>
    why the KeepAlive-Feature (reusing of TCP-connections, described at http://java.sun.com/j2se/1.5.0/docs/guide/net/http-keepalive.html) doesn't work in the following example? I'm using J2SE 1.4...
    <br>
    <br>
    <br>import java.net.HttpURLConnection;
    <br>import java.net.URL;
    <br>
    <br>public class Test {
    <br>
    <br> public static void main(String[] args) {
    <br> try {
    <br> for (int i=0; i<5; i++) {
    <br> URL url = new URL("http://www.sun.com/");
    <br> HttpURLConnection conn = (HttpURLConnection) url.openConnection();
    <br> conn.setRequestMethod("GET");
    <br> conn.connect();
    <br> conn.getContent();
    <br> conn.disconnect();
    <br> }
    <br> } catch (Exception e) {           
    <br> System.err.println("Exception: "+e.getMessage());
    <br> }
    <br> }
    <br>
    <br>}
    <br>
    <br>
    <br>
    I've checked with Ethereal (http://www.ethereal.com), that 5 different TCP-connections are used, when this example runs.
    <br>
    Where is my mistake??
    <br>
    Does KeepAlive works with MIDP 1.0?
    <br>
    <br>
    Slavik

    may be conn.disconnect(); is closing the underlaying connection.
    Also try putting "Connection: keep-alive" header to the request

  • Print to pdf often doesn't work with multiple pages?

    When I try to print to pdf, it often doesn't work right.
    I can select, for example, multiple Excel worksheets to print. It looks fine with 4 pages in Preview, but when I select save as .pdf, it only prints 2 of the 4 pages, and it prints those in 2 separate documents rather than a single .pdf document with multiple pages.
    Is there a way to do this? Is this an Apple error or Microsoft error? Since it looks fine in Preview, my guess it is an Apple error?
    Mark

    It sounds like this is the problem with the way Apple handles multiple orientations in a pdf document. You can use Acrobat to print the files - it handles multiple orientations correctly. There was a previous thread on this:
    http://discussions.apple.com/message.jspa?messageID=1983431#1983431

  • What to do when Outlook AutoArchive doesn't work

    AutoArchive feature helps us manage the space in the mailboxes or on the e-mail server that were are using by automatically moving items to an archive location. These items can be Email messages, Calendar items, Tasks, Notes, Journal entries.
    However, sometimes some users may find that Outlook AutoArchive doesn’t work as expected, this can be frustrating. In this article I’ll introduce some steps to troubleshoot this issue, I hope it will be helpful to those who meet the issue.
    Always check the Default AutoArchive settings first
    When AutoArchive is not working properly, the first thing we should do to troubleshoot the issue, is to make sure the AutoArchive setting is correct.
    I’ll take Outlook 2013 for example, go to FILE tab -> Options -> Advanced -> AutoArchive -> AutoArchive Settings… button, we will see the AutoArchive window below:

    To make AutoArchive work, make sure the first checkbox has been selected and you have configured how frequently you want AutoArchive to run.

    If you select “Prompt before AutoArchive runs”, it will notify you before AutoArchive runs.

    If you want to delete expired items, select “Delete expired items (e-mail folders only)”.

    You should select “Archive or delete old items”, or only expired items will be deleted.

    Select “Show archive folder in folder list” to let the archive.pst appear in the folder list, which helps you find archived items easily.

    You can set the age of the items that you want to archive in the field of “Clean out items older than x”, the age is based on the last Modified date by default. I’ll introduce this later in this article.

    Then you need to decide whether to move old items to an archive .pst file, or permanently delete old items. Once you have your choice, you can apply these settings to all folders now and click OK to save the settings.
    AutoArchive doesn’t work on one specific folder?
    Apart from the default settings, each folder can be set with its own AutoArchive settings different from the global settings.
    Right click on the folder and select Properties -> AutoArchive tab.

    You can select “Do not archive items in this folder” if you want this folder to be an exception of AutoArchive.

    If you select “Archive items in this folder using the default settings”, you will archive items in this folder using the default settings as it states, and the “Default Archive settings” button below is referring to the same AutoArchive
    window as FILE -> Options -> Advanced -> AutoArchive -> AutoArchive Settings.

    If you want the AutoArchive settings for this folder to be different from the Default AutoArchive settings, select “Archive this folder using these settings”. The age of items can be set to a different one, you can even select a separate
    .pst file to archive items in this folder. After everything is decided, click OK to save the settings.
    Please note these settings are specific to each folder and are not applied to subfolders. Please configure the settings individually for each folder.
    Modify the ArchiveIgnoreLastModifiedTime registry value
    Outlook archive works based on the last modified date and time by default, if you
    reply, forward, move, edit, save, import an item, the modified date will change, this may cause the AutoArchive not to archive the item.
    If you want to let Outlook to archive items based on the received date, you need to set the ArchiveIgnoreLastModifiedTime registry value.
    Since serious problems might occur if you modify the registry incorrectly, please back up registry in Windows first:http://windows.microsoft.com/en-US/windows7/Back-up-the-registry
    To create the ArchiveIgnoreLastModifiedTime registry value, follow these steps:
    Press Win + R to start Run, type
    regedit in the Open box, and then click OK.
    Locate and then click the following registry subkey:
    HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Outlook\Preferences (Outlook 2010)
    HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\Outlook\Preferences (Outlook 2013)
    On the Edit menu, point to New, click
    DWORD Value, type ArchiveIgnoreLastModifiedTime, and then press ENTER.
    Right-click ArchiveIgnoreLastModifiedTime, and then click
    Modify.
    In the Value data box, type 1, and then click
    OK.
    Exit Registry Editor and restart Outlook to make the registry take effect.
    Once the registry key is added, check if Outlook archives the items properly. We can try manually archiving:
    Go to FILE tab -> Info -> Cleanup Tools -> Archive, select the folders that you want to archive and archive criteria, click OK. Outlook should then archive the items based on the received date.
    The Archive .pst file
    As the Archive storage file, the .pst file may cause AutoArchive not working issue. If the .pst file is corrupted or too large, AutoArchive may not work as expected.
    Scanpst.exe is an Inbox repair tool to fix Outlook Data Files like .ost and .ost files, it can be used to fix a corrupted .pst file. To find Scanpst.exe, browse to the locations below:
    For Outlook 2013 on a 32-bit version of Windows:
    <disk drive>\Program Files\Microsoft Office 15\root\office15
    For Outlook 2013 on a 64-bit version of Windows:
    <disk drive>\Program Files(x86)\Microsoft Office 15\root\office15
    For Outlook 2010 on a 32-bit version of Windows:
    <disk drive>:\Program Files\Microsoft Office\Office14
    For Outlook 2010 on a 64-bit version of Windows:
    <disk drive>:\Program Files\Microsoft Office(x86)\Office14
    When the tool is opened, type the path and the file name of the .pst file or click Browse to locate the file by using the Windows file system, and then click Start.
    More details about the tool can be found in this kb below:
    How to repair your Outlook personal folder file (.pst)
    http://support.microsoft.com/kb/272227/en-us
    Another scenario is the .pst file is full. For Outlook 2003 and Outlook 2007 the default limit is 20GB and for Outlook 2010 and Outlook 2013 the limit is 50GB.
    You won’t be able to add items to the archive .pst file when the file reaches 19GB or 47.5GB, once the .pst file gets too large, I suggest you create a new .pst file to archive the items.
    One more thing to remember, don’t store the .pst file on the network share, which we always reminder our users of.
    Please click to vote if the post helps you. This can be beneficial to other community members reading the thread.

    Consider this program that tests whether a number is
    prime.
    [attempt to divide by each integer from 2 to n-1]At risk of lowering the signal to noise ratio, I
    should point out that the algorithm given is just
    about the worst possible.
    I know that the point was to illustrate debugging
    and not good prime test algorithms, and I disagree
    with the correspondent who thought the post was
    condescending.
    Anyway, the java libraries have good prime testing
    methods based on advanced number theory research that the
    non-specialist is unlikely to know. Looking at the java
    libraries first is always a good idea.
    Even with the naive approach, dramatic improvements
    are possible.
    First, only try putative divisors up to the square root
    of the number. For 999997 this is about 1000 times faster.
    Next only try dividing by prime numbers. This is about
    7 times faster again. The snag, of course, is to find the
    prime numbers up to 1000, so there might not be much
    advantage unless you already have such a list. The sieve
    of Erastosthenes could be used. This involves 31 passes
    through an array of 1000 booleans and might allow an
    improvement in speed at the expense of space.
    Sorry if I've added too much noise :-)

Maybe you are looking for