Socket Programming-Not getting response from server.

Hi,
I am trying to communicate with server using java socket programming, I am getting the response for first two times third time when I am trying to write some thing I am not getting any response from the server,
I am writing to migrate the vb code to Java the vb is using a c++ dll to communicate with the server and we tried accessing the dll from java using JNI then it is working fine, this dll is dependent on windows so we want to avoid the dependency with windows that is why we are going for socket programming, Please help on this.

Hi,
I am writing the data in forms of string
like
Socket sockt = new Socket(ipAddress, portNo);     
out= new DataOutputStream(sockt.getOutputStream());
in = new DataInputStream(sockt.getInputStream());
out.writeBytes("Serv");
out.writeBytes("Serv,32");
out.writeBytes("home,serv32,run.prg,sucess");
these are the strings to communicate with server.
I am trying to read the same
StringBuffer buf = new StringBuffer();
          byte b = '\0';
                    try {
               while ((b = in.readByte()) != '\0')
                    char ch = (char) b;
                    buf.append(ch);
          } catch (Exception e) {
               System.out.println(e.getStackTrace());
we are getting the response for the first two strings, but for the third string it is getting stucked for some time and returing some junk values like '???' we are sending the same string using JNI and it is working.

Similar Messages

  • Not getting Response from RFC

    Hi,
        I am doing RFC to File. I could generate the FILE successfully. But I am not getting Response from RFC. I am getting empty payload. I am doing with out BPM. I did succesfully File-RFC-File. but here RFC is the sender. I have some doubts  in defining Interface mapping and Message Mapping. Is this a Syscronous scenario by default ?
    If I want to get the resonse of RFC to a file. How many Receivers and Senders do i need to create?
    Regards,
    Varun
    Edited by: Varun on Sep 9, 2008 1:00 PM

    hi,
    Map Rfc.response to the File; hence rfc sender adapter and file receiver adapter..one sender n 1 receiver.Remember:
      1. In the report that makes the call to XI , make sure that you use call RFC in a background task.
      2. Make sure you use Commit Work at the end of the report.
    Follow:
    Send RFC to SAP XI – Asynchronous
    Also pls visit
    Re: RFC to FILE
    for the same scenario.
    Thanks,
    Durga
    Edited by: NagaDurga Nannapaneni on Sep 9, 2008 10:55 AM

  • Mails are not getting deleted from server

    Hi
    I am reading a mail from using java mail from my mail server.
    When i am setting the message.setFlag(Flag.DETELED,true);
    the mail is not getting deleted from the server.
    I am not able to trace the problem, please help me solving this problem. It's a bit urgent.
    store = session.getStore("pop3");
    store.connect(hName, portNo, uName, pWord);
    folder = store.getFolder("INBOX");
    folder.open(Folder.READ_WRITE);
    Message message[] = folder.getMessages();
    System.out.println("Unread Msg Count : " + folder.getUnreadMessageCount());
    int n = message.length;
    for (int i = 0; i < n; i++) {
    fromMsg = (message.getFrom()[0]).toString();
    subMsg = (message[i].getSubject()).toString();
    if (folder instanceof POP3Folder) {
    POP3Folder pf = (POP3Folder) folder;
    Part messagePart = message[i];
    content = messagePart.getContent();
    if (content instanceof Multipart)
    messagePart = ((Multipart) content).getBodyPart(0);
    String contentType = messagePart.getContentType();
    Part messagePart = message[i];
    content = messagePart.getContent();
    if (content instanceof Multipart){
    messagePart = ((Multipart) content).getBodyPart(0);
    String contentType = messagePart.getContentType();
    message[i].setFlag(Flag.DELETED, true);
    store.close();
    Thanks and Regards,
    Luv Amieee...
    xx                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    yeah true...
    i did not close the folder.
    i got to know from sun faq only later on yesterday.
    but still.. thanks a lot...
    luv amieee..
    xx

  • One socket and two ports, not getting response from the server

    Hi everyone,
    I am working on device which communicate through Tcp sockets, It has an IP address and one port for listening and another for sending the response.
    Problem is that I am able to create a connection to Device ip+port, and i am trying to listen on the same port while the device is sending the response on other port. My problem is that i can't create another socket using this port and therefore not getting the response from the device.
    Can you people tell me how to handle such socket communication in java ?
    Thanks in advance.

    I am working on device which communicate through Tcp sockets, It has an IP address and one port for listening and another for sending the response.Are you sure? That's not usual. It would be usual for it to use the same port for listening, reading, and writing.
    Problem is that I am able to create a connection to Device ip+port, and i am trying to listen on the same port while the device is sending the response on other port.I would try just reading from the same socket you are sending on. I suggest you have misunderstood how the device works.

  • Why im getting too long time in getting response from server in RMI???

    I'm using RMI architecture. On my server side I put this method getRubricHierarchy() which returns the ArrayList of Test class objects. everything is working properly fine.
    Im getting response properly, problem is its taking very long time in getting the response. method populate and create ArrayList in 0 second at server side but its taking more than 20 seconds to get response at client side.
    My arraylist size is 30,000.
    Any suggestions to reduce the time.
    below you can see the code.
    public List<Test> getRubricHierarchy(String strTree,String gblCombinedRepSectionID,String gblCompleteRepSectionID,String gblCompleteRepertoryID,Map authMap) {
            Connection con=null;
              ResultSet rs = null;
              List<Test> l = new ArrayList<Test>();
              List allList = new ArrayList();
              con = createDBCon();
              rs = con.createStatement().executeQuery("select * from rubric where sectionid='"+gblCombinedRepSectionID+"' order by orders");
              Map parentMap = new HashMap();
              while (rs.next()) {
                   Test rNode = new Test();
                String rubrid = rs.getString("id");
                   final String desc = rs.getString("name");
                   rNode.setRubricName(desc);
                   rNode.setRubricID(rubrid);
                   rNode.setAuthor(rs.getString("repid"));
                   final int levlId = rs.getInt("levelid");
                   rNode.setRubLevel(levlId);
                   rNode.setCrossRef(rs.getString("CROSSREFERENCE"));
                   final String parentID = rs.getString("PARENTID");
                   rNode.setParentID(parentID);
                   rNode.setSectionID(rs.getString("sectionid"));
                   if (parentID.equals("0")) {
                        l.add(rNode);
                   allList.add(rNode);
                   List rmdyLst = (List) parentMap.get(parentID);
                   if (rmdyLst == null) {
                        rmdyLst = new ArrayList();
                        parentMap.put(parentID, rmdyLst);
                   rmdyLst.add(rNode);
              rs.close();
              for (Iterator iterator = allList.iterator(); iterator.hasNext();) {
                   Test rNodes = (Test) iterator.next();
                   List remdyLst = (List) parentMap.get(rNodes.getRubricID());
                   if (remdyLst != null) {
                        rNodes.setChildren(remdyLst);
                        for (Iterator iterator2 = remdyLst.iterator(); iterator2.hasNext();) {
                             Test rn = (Test) iterator2.next();
                             rn.setParent(rNodes);
            }catch(Exception e){
                e.printStackTrace();
              return l;
         }here is my Test Class
    public class Test implements  Serializable,Cloneable , MutableTreeNode{
            private String strRubricID,strOldRubricID,strRubricName,strCrossRef,Author,strParentID,strSectionID;
            private int rubLevel;
            private List remedyList;
            private List children = new ArrayList();
            private Test parent;
            private int order;
            private String AuthorName="";
            private String abbr;
            private String treeType="";
            private int noRem=-1;
            private boolean isAddAsChild=false;
            private String strRubricHie="";
            private String user="";
            public static final Enumeration<TreeNode> EMPTY_ENUMERATION = new Enumeration() {
                public boolean hasMoreElements() {
                    return false;
                public TreeNode nextElement() {
                    throw new NoSuchElementException("No more elements");
            public Test(){
            public void setUser(String user){
                this.user = user;
            public String getUser(){
                return user;
            public void setRubricHierarchy(String s){
                this.strRubricHie=s;
            public String getRubricHierarchy(){
                return strRubricHie;
            public Test(String treeType){
                this.treeType = treeType;
            public void setAddAsChild(boolean b){
                this.isAddAsChild=b;
            public boolean isAddAsChild(){
                return isAddAsChild;
            public Test getUserObject(){
                return this;
            public  void setRubricID(String id){
                this.strRubricID = id;
            public  String getRubricID(){
                return strRubricID ;
            public  void setOldRubricID(String id){
                this.strOldRubricID = id;
            public  String getOldRubricID(){
                return strOldRubricID ;
            public  void setParent(Test r){
                this.parent = r;
            public  Test getParent(){
                return parent;
            public  void setParentID(String id){
                this.strParentID = id;
            public  String getParentID(){
                return strParentID;
            public  void setSectionID(String id){
                this.strSectionID= id;
            public  String getSectionID(){
                return strSectionID;
            public  void setRubricName(String name){
                this.strRubricName = name;
            public  String getRubricName(){
                return strRubricName;
            public  void setAuthorName(String name){
                this.AuthorName = name;
            public  String getAuthorName(){
                return AuthorName;
            public  void setAuthorAbbrivation(String a){
                this.abbr = a;
            public  String getAuthorAbbrivation(){
                return abbr;
            public void setRubLevel(int rubLevel) {
                this.rubLevel = rubLevel;
            public int getRubLevel() {
                return rubLevel;
            public void setCrossRef(String strCrossRef) {
                this.strCrossRef = strCrossRef;
            public String getCrossRef() {
                return strCrossRef ;
            public void setRemedyList(List remedyList) {
                this.remedyList = remedyList;
            public List getRemedyList() {
                return remedyList;
            public void setAuthor(String Author) {
                this.Author = Author;
            public String getAuthor() {
                return Author;
            public void setChildren(List list) {
                this.children = list;
            public List getChildren() {
                return children;
            public void setOrder(int o){
                this.order = o;
            public int getOrder(){
                return order;
            public void setNumberOfRemedies(int no)
                this.noRem = no;
            public int getNumberOfRemedies()
                return noRem;
            public String toString() {
                String value="";
                value=strRubricName+ " ("+abbr+")";
                return value;
            public Object clone(){
                Test rubric = new Test();
                rubric.Author = Author;
                rubric.children = children;
                rubric.order = order;
                rubric.parent = parent;
                rubric.remedyList = remedyList;
                rubric.rubLevel = rubLevel;
                rubric.strCrossRef = strCrossRef;
                rubric.strParentID = strParentID;
                rubric.strRubricID = strRubricID;
                rubric.strRubricName = strRubricName;
                rubric.strSectionID = strSectionID;
                return rubric;
         @Override
         public TreeNode getChildAt(int paramInt) {
              if (this.children == null) {
                   throw new ArrayIndexOutOfBoundsException("node has no children");
              final TreeNode node = (TreeNode) children.get(paramInt);
              return node;
         @Override
         public int getChildCount() {
              if (this.children == null) {
                   return 0;
              return children.size();
         @Override
         public int getIndex(TreeNode paramTreeNode) {
              // TODO Auto-generated method stub
              return 0;
         @Override
         public boolean getAllowsChildren() {
              return true;
         @Override
         public boolean isLeaf() {
              return children.isEmpty();
         @Override
         public Enumeration children() {
              if (this.children == null) {
                   return EMPTY_ENUMERATION;
              Vector v = new Vector(this.children);
              return v.elements();
         @Override
         public void insert(MutableTreeNode newChild, int paramInt) {
              if (newChild == null) {
                   throw new IllegalArgumentException("new child is null");
              MutableTreeNode oldParent = (MutableTreeNode) newChild.getParent();
              if (oldParent != null) {
                   oldParent.remove(newChild);
              newChild.setParent(this);
              if (children == null) {
                   children = new ArrayList();
              children.add(paramInt, newChild);
         @Override
         public void remove(int childIndex) {
              MutableTreeNode child = (MutableTreeNode) getChildAt(childIndex);
              children.remove(childIndex);
              child.setParent(null);
         @Override
         public void remove(MutableTreeNode aChild) {
              if (aChild == null) {
                   throw new IllegalArgumentException("argument is null");
              if (!isNodeChild(aChild)) {
                   throw new IllegalArgumentException("argument is not a child");
              remove(getIndex(aChild)); // linear search
         public boolean isNodeChild(TreeNode aNode) {
              boolean retval;
              if (aNode == null) {
                   retval = false;
              } else {
                   if (getChildCount() == 0) {
                        retval = false;
                   } else {
                        retval = (aNode.getParent() == this);
              return retval;
         @Override
         public void setUserObject(Object paramObject) {
              // TODO Auto-generated method stub
         @Override
         public void removeFromParent() {
              MutableTreeNode parent = (MutableTreeNode) getParent();
              if (parent != null) {
                   parent.remove(this);
         @Override
         public void setParent(MutableTreeNode paramMutableTreeNode) {
              parent = (Test) paramMutableTreeNode;
          * Returns the path from the root, to get to this node. The last element in
          * the path is this node.
          * @return an array of TreeNode objects giving the path, where the first
          *         element in the path is the root and the last element is this
          *         node.
         public TreeNode[] getPath() {
              return getPathToRoot(this, 0);
          * Builds the parents of node up to and including the root node, where the
          * original node is the last element in the returned array. The length of
          * the returned array gives the node's depth in the tree.
          * @param aNode
          *            the TreeNode to get the path for
          * @param depth
          *            an int giving the number of steps already taken towards the
          *            root (on recursive calls), used to size the returned array
          * @return an array of TreeNodes giving the path from the root to the
          *         specified node
         protected TreeNode[] getPathToRoot(TreeNode aNode, int depth) {
              TreeNode[] retNodes;
               * Check for null, in case someone passed in a null node, or they passed
               * in an element that isn't rooted at root.
              if (aNode == null) {
                   if (depth == 0)
                        return null;
                   else
                        retNodes = new TreeNode[depth];
              } else {
                   depth++;
                   retNodes = getPathToRoot(aNode.getParent(), depth);
                   retNodes[retNodes.length - depth] = aNode;
              return retNodes;
        }

    You have an O(N**2) algorithm at the end that is rather ill-considered. It seems to me at first glance that it could be combined int the previous loop.

  • Not getting response from Client Proxy

    Hi,
    We are developing a scenario - File->PI->Proxy using ABAP Proxies.We are posting a file thru PI 7.0 to R/3 .In R/3 the server proxy(Inbound Asynchronous) will receive the message and BAPI will be called. The response from the BAPI will be reaching the server proxy and passed to the client proxy(Outbound Asynchronous).
       Server Proxy(request) --> BAPI --> Server Proxy(response) --> Client Proxy(response)
    The response from the client proxy has to be send to PI and a file will be generated as the output.
    Can anyone provide me suggestions to call client proxy from a server proxy by passing the response message to client proxy???
    Thanks in advance.
    Regards,
    Dibyajyoti

    Hi,
    I hope, you are done till the Implementation of Server Proxy, where you are calling a Bapi and passing the Input variables the Interface received and BAPI is giving a response back.
    Now your question, how to send the response back Asynchronously.
    I think, you have to do the same, what you do for a client proxy  and at last  call the method EXECUTE_ASYNCHRONOUS before the Final Commit Staement. I think this should work.
    But using Synchronous Interface in such cases is always a handy and easier option.
    Regards,
    Subhendu

  • Edge Animate - Sending To Then Getting Response From Server (XML)

    Hi,
    I’m very new to Edge animate, and I’m trying to send some things to a server, which would send a response back. XML.
    I’m trying:
    jQuery.ajax({
        type: "POST",
        datatype: "xml",
        url: "http://www.pandorabots.com/pandora/talk-xml",
        data: {botid: 'cb1f78b4fe36bf6d', input: 'test'},
        success: function(xml) {
             //jQuery(xml).find('result').each(function(){
                      //var tts = jQuery(this).find('that').text();
                      sym.$("xmlOutput").html('Pandorabot success.');    
        error: function() {
            sym.$("xmlOutput").html('Pandorabot error.');
    But can’t seem to get it working.
    The logs indicate that it does send, but I don’t receive an answer.
    What am I doing wrong, and where should I start?
    Thanks for any help, or links.

    Did you put  some trace or alert in your success function and check if its hit?

  • Error in Getting Response From Server

    Hi,
    I am getting the following error when i call a remote method of java class using lcd's:
    RPC Fault faultString="[MessagingError
    message='Destination 'loginService' either does not
    exist or the destination has no channels defined(and the
    application does not define any default channels.)']"
    faultCode="InvokeFailed" faultDetail="Couldn't establish
    a connection to 'loginServlet'"
    Can anybody resolve this problem.
    Regards,
    Naveen.

    Hi,
    I am getting the following error when i call a remote method of java class using lcd's:
    RPC Fault faultString="[MessagingError
    message='Destination 'loginService' either does not
    exist or the destination has no channels defined(and the
    application does not define any default channels.)']"
    faultCode="InvokeFailed" faultDetail="Couldn't establish
    a connection to 'loginServlet'"
    Can anybody resolve this problem.
    Regards,
    Naveen.

  • Socket Problem, Problem about printing the response from server

    Or even I am not sure if there is a response from server. My code is like that
                   //Connection between, httpProxy and target adress
                   Socket clientSocket= new Socket("some host", 80);
                   DataOutputStream outToServer= new DataOutputStream(clientSocket.getOutputStream());
                   BufferedReader inFromServer= new BufferedReader(new     InputStreamReader(clientSocket.getInputStream()));
                   //The first way
                   //outToServer.writeBytes("GET http://www.somehost.com/ HTTP/1.1"+ '\n');
                   //System.out.println("FROM SERVER: "+inFromServer.readLine());
                   //The second way
                   PrintWriter out_writer = new PrintWriter(outToServer, false);
                   out_writer.println("GET http://www.somehost.com/ HTTP/1.1");
                   out_writer.println("Host: localhost:80");
                   out_writer.println("Connection: Close");
                   out_writer.println();
                                        //The second way cont.
                   String s = null;
                   while ((s = inFromServer.readLine()) != null)
                   System.out.println(s);
                   inFromServer.close();There are the two ways that I tried, and both of them didn't work. Why they are not working ? How can I solve it ?

    problem is solved, the reason it doesn't work is i didn't write the parts correctly. I mean it should be exactly the same packetIf you mean that the entire request must be sent in a single IP packet, this isn't true.
    and host name must also be exactly sent to server.Of course.
    They must be like in the wireshark.No. The actual data you send must be the same, but the server has no way of telling about what the IP packet looks like or how many there were.
    One of your problems is that newlines in HTTP are defined as \r\n. In one case you're just using \n and in the other case you're using whatever the platform line terminator is. Neither is correct.

  • Could not get IOR from Domino Server while provisioning Lotus Notes

    Hi all,
    There are two servers that have OIM installed, development server and test server. From development server, we can
    provision to Lotus Notes just fine. But for test server everytime when
    provision to Lotus Notes. There will be an exception
    NotesException: Could not get IOR from Domino Server: http://10.3.100.61:63148/diiop_ior.txt
    From test server
    I can access the URL http://10.3.100.61:63148/diiop_ior.txt using Internet Explorer
    I can telnet to 10.3.100.61 63148
    I can use connector testing program and it work fine
    All configuration and jar files are the same as development server
    There is no firewall or antivirus running in both systems.
    Both server is virtual server using VMWare.
    OS: Windows2003R2 Enterprise
    DB: Oracle 10gR2 10.2.0.2
    AS: Oracle AS 10g 10.1.3.3.0
    OIM 9.1.0
    Lotus Notes Connector 9.0.4.2
    Thank you.
    Satit
    The error is as below
    =================================================
    INFO,11 Nov 2008 11:24:26,109,[ADAPTER.LOTUSNOTES],LotusNotesProvision::init
    INFO,11 Nov 2008 11:24:26,109,[ADAPTER.LOTUSNOTES],LotusNotesProvision::init
    DEBUG,11 Nov 2008 11:24:26,109,[ADAPTER.LOTUSNOTES],LotusNotesProvision::init : Host 10.3.100.61
    DEBUG,11 Nov 2008 11:24:26,109,[ADAPTER.LOTUSNOTES],LotusNotesProvision::init : Port 63148
    DEBUG,11 Nov 2008 11:24:26,109,[ADAPTER.LOTUSNOTES],LotusNotesProvision::init : Admin Pongtape Ungkawanish/Telecom./Central Support/Fin./KK_Bangkok/TH
    DEBUG,11 Nov 2008 11:24:26,109,[ADAPTER.LOTUSNOTES],LotusNotesProvision::init : Certifier OU
    DEBUG,11 Nov 2008 11:24:26,109,[ADAPTER.LOTUSNOTES],LotusNotesProvision::init : Before session
    08/11/11 11:24:26 Running setTimeoutParameters
    08/11/11 11:24:26 Running Connect
    INFO,11 Nov 2008 11:24:26,109,[ADAPTER.LOTUSNOTES],LNotesConnectionUtil::getSession
    INFO,11 Nov 2008 11:24:26,109,[ADAPTER.LOTUSNOTES],LNotesConnectionUtil::getSession : ***Non-Secure Mode
    ERROR,11 Nov 2008 11:24:26,109,[ADAPTER.LOTUSNOTES],LNotesConnectionUtil::getSession : ***Connection refused to Lotus Notes......
    NotesException: Could not get IOR from Domino Server: http://10.3.100.61:63148/diiop_ior.txt
         at lotus.domino.NotesFactory.requestIORPlain(Unknown Source)
         at lotus.domino.NotesFactory.requestIORUsingArgs(Unknown Source)
         at lotus.domino.NotesFactory.getIOR(Unknown Source)
         at lotus.domino.NotesFactory.createSessionUP(Unknown Source)
         at lotus.domino.NotesFactory.createSession(Unknown Source)
         at com.thortech.xl.Integration.HostAccess.LNotesConnectionUtil.getSession(Unknown Source)
         at com.thortech.xl.Integration.HostAccess.LotusNotesProvision.connect(Unknown Source)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.thortech.xl.adapterGlue.ScheduleItemEvents.adpLNCREATEUSER.CONNECT(adpLNCREATEUSER.java:449)
         at com.thortech.xl.adapterGlue.ScheduleItemEvents.adpLNCREATEUSER.implementation(adpLNCREATEUSER.java:160)
         at com.thortech.xl.client.events.tcBaseEvent.run(Unknown Source)
         at com.thortech.xl.dataobj.tcDataObj.runEvent(Unknown Source)
         at com.thortech.xl.dataobj.tcScheduleItem.runMilestoneEvent(Unknown Source)
         at com.thortech.xl.dataobj.tcScheduleItem.eventPostInsert(Unknown Source)
         at com.thortech.xl.dataobj.tcDataObj.insert(Unknown Source)
         at com.thortech.xl.dataobj.tcDataObj.save(Unknown Source)
         at com.thortech.xl.ejb.beansimpl.tcProvisioningOperationsBean.retryTasks(Unknown Source)
         at com.thortech.xl.ejb.beans.tcProvisioningOperationsSession.retryTasks(Unknown Source)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl.invoke(EJBJoinPointImpl.java:35)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.TxRequiredInterceptor.invoke(TxRequiredInterceptor.java:50)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.SecurityRoleInterceptor.invoke(SecurityRoleInterceptor.java:47)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.InvocationContextPool.invoke(InvocationContextPool.java:55)
         at com.evermind.server.ejb.StatelessSessionEJBObject.OC4J_invokeMethod(StatelessSessionEJBObject.java:87)
         at tcProvisioningOperations_RemoteProxy_6ocop18.retryTasks(Unknown Source)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.rmi.RmiMethodCall.run(RmiMethodCall.java:53)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)
    Caused by: java.lang.NullPointerException
         at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:781)
         at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:669)
         at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:913)
         ... 45 more
    INFO,11 Nov 2008 11:24:26,109,[ADAPTER.LOTUSNOTES],Unable to connect to the target. Attempting to reconnect after delay of 2000ms.......
    INFO,11 Nov 2008 11:24:28,110,[ADAPTER.LOTUSNOTES],LNotesConnectionUtil::getSession
    INFO,11 Nov 2008 11:24:28,110,[ADAPTER.LOTUSNOTES],LNotesConnectionUtil::getSession : ***Non-Secure Mode
    ERROR,11 Nov 2008 11:24:28,110,[ADAPTER.LOTUSNOTES],LNotesConnectionUtil::getSession : ***Connection refused to Lotus Notes......
    NotesException: Could not get IOR from Domino Server: http://10.3.100.61:63148/diiop_ior.txt
         at lotus.domino.NotesFactory.requestIORPlain(Unknown Source)
         at lotus.domino.NotesFactory.requestIORUsingArgs(Unknown Source)
         at lotus.domino.NotesFactory.getIOR(Unknown Source)
         at lotus.domino.NotesFactory.createSessionUP(Unknown Source)
         at lotus.domino.NotesFactory.createSession(Unknown Source)
         at com.thortech.xl.Integration.HostAccess.LNotesConnectionUtil.getSession(Unknown Source)
         at com.thortech.xl.Integration.HostAccess.LNotesConnectionUtil.getSession(Unknown Source)
         at com.thortech.xl.Integration.HostAccess.LotusNotesProvision.connect(Unknown Source)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.thortech.xl.adapterGlue.ScheduleItemEvents.adpLNCREATEUSER.CONNECT(adpLNCREATEUSER.java:449)
         at com.thortech.xl.adapterGlue.ScheduleItemEvents.adpLNCREATEUSER.implementation(adpLNCREATEUSER.java:160)
         at com.thortech.xl.client.events.tcBaseEvent.run(Unknown Source)
         at com.thortech.xl.dataobj.tcDataObj.runEvent(Unknown Source)
         at com.thortech.xl.dataobj.tcScheduleItem.runMilestoneEvent(Unknown Source)
         at com.thortech.xl.dataobj.tcScheduleItem.eventPostInsert(Unknown Source)
         at com.thortech.xl.dataobj.tcDataObj.insert(Unknown Source)
         at com.thortech.xl.dataobj.tcDataObj.save(Unknown Source)
         at com.thortech.xl.ejb.beansimpl.tcProvisioningOperationsBean.retryTasks(Unknown Source)
         at com.thortech.xl.ejb.beans.tcProvisioningOperationsSession.retryTasks(Unknown Source)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl.invoke(EJBJoinPointImpl.java:35)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.TxRequiredInterceptor.invoke(TxRequiredInterceptor.java:50)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.SecurityRoleInterceptor.invoke(SecurityRoleInterceptor.java:47)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.InvocationContextPool.invoke(InvocationContextPool.java:55)
         at com.evermind.server.ejb.StatelessSessionEJBObject.OC4J_invokeMethod(StatelessSessionEJBObject.java:87)
         at tcProvisioningOperations_RemoteProxy_6ocop18.retryTasks(Unknown Source)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.rmi.RmiMethodCall.run(RmiMethodCall.java:53)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)
    Caused by: java.lang.NullPointerException
         at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:781)
         at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:669)
         at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:913)
         ... 46 more

    check if DIIOP service is turned on at the Lotus Domino side...
    Oleg.

  • Getting response from a server

    im working on a simple smtp mail sender and i want to get responses to the commands that i post to the DataOutputStream. in all examples on java.sun.com and the net, there is a while block used for reading response from the server.
    while((c=is.read()) != -1)
    sb.append((char)c);
    this code did not work on my application, i changed a bit like below:
    /**Get a response from server */
    private String getResponse() throws IOException {
    int CR = 0, LF = 0;
    int c;
    char ch;
    int count = 0;
    StringBuffer sb = new StringBuffer();
    while (true) {
    c = is.read();
    count++;
    ch = (char) c;
    if (c == -1) {
    break;
    else if (ch == '\r') {
    CR = count;
    else if (ch == '\n') {
    LF = count;
    if (LF - 1 == CR) { //CRLF seen
    sb.append(ch);
    break;
    sb.append(ch);
    return sb.toString();
    and i use this function in my code as
    os.write( ("QUIT\r\n").getBytes());
    System.out.println("QUIT : " + getResponse());
    this works, because it returns a single line that has a CRLF at the and of line, but if i want to read multi-line responses like greeting messages, i tried to change the code as on the examples like:
    /**Get a response from server */
    private String getResponse() throws IOException {
    int c;
    StringBuffer sb = new StringBuffer();
    while((c=is.read()) != -1)
    sb.append((char)c);
    return sb.toString();
    this code does not work, because i cannot reach the end of stream. i want to post one command and get one response for that command.
    how an algorithm i can develop to solve this problem?
    thanks for all help.

    i changed the code and it's working well now:
    /**Get a response from server */
    private String getResponse() throws IOException {
    int c;
    if((c=is.read()) != -1) {
    byte[] b = new byte[is.available()];
    StringBuffer sb = new StringBuffer();
    is.read(b);
    sb.append((char)c);
    for(int i=0; i<b.length; i++) {
    sb.append((char)b);
    return sb.toString();
    return "";
    if you directly use is.available() when there is no response currently available, it returns 0. we wait for the first character of server response, and then use is.available(). thanks to Kay_Kadner for the idea.
    (im a newbie, and dont know how to convert byte[] to String, tried b.toString() but only got meaningless values)

  • Hello my name is leandro from months ago and am trying to connect with my apple id but informs me that it is wrong and I can not buy or upgrade my mac from the official website of apple can go with my ide but can not get response technical support'm from

    hello my name is leandro from months ago and am trying to connect with my apple id but informs me that it is wrong and I can not buy or upgrade my mac from the official website of apple can go with my ide but can not get response technical support'm from Argentina someone could help me

    Apple ID security issues -
    Call Apple Care and ask for the Account Security Team. They can assist you with your issue.

  • Issue: Not getting response when the document is having special chars

    Please help following issue: Not getting response when the document is having special chars(Use any doc with special char(ex: &, $, <, >,.....) TestErrorFour.doc
    Error message:
    System.FormatException: Invalid length for a Base-64 char array. at
    System.Convert.FromBase64String(String s) at
    Summarize.Summarizer.AccumulateBroadcast(String filedata, String givenWords) in
    c:\DocumentSummarizer\App_Code\Summarizer.cs:line 66
    Code:
    File 1:
    import java.io.BufferedReader;
    import java.io.FileInputStream;
    import java.io.FileNotFoundException;
    import java.io.FileReader;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.io.OutputStream;
    import java.net.HttpURLConnection;
    import java.net.URL;
    import java.net.URLConnection;
    import java.util.Properties;
    import org.apache.poi.poifs.filesystem.POIFSFileSystem;
    import org.apache.poi.hwpf.*;
    import org.apache.poi.hwpf.extractor.*;
    import com.lowagie.text.Document;
    import com.lowagie.text.pdf.PRTokeniser;
    import com.lowagie.text.pdf.PdfReader;
    public class DocumentSummarizerClient {
         static Properties loadProperties() {
              Properties prop = new Properties();
              try {
                   prop.load(DocumentSummarizerClient.class.getClassLoader().getResourceAsStream("vep.properties"));
              } catch (Exception ioe) {
                   ioe.printStackTrace();
              return prop;
         public String getSummary(String fileName,String noOfWordsOrPercentage ){
              String summaryInputData ="";
              String summarizedData="";
              String summarizerURL = loadProperties().getProperty("Summarizer.serviceURL");
              try {
                   String fileExtension=fileName.substring(fileName.lastIndexOf(".")+1, fileName.length());
                   if (fileExtension.equalsIgnoreCase("doc")|| fileExtension.equalsIgnoreCase("txt")|| fileExtension.equalsIgnoreCase("pdf")) {
                                  if (fileExtension.equalsIgnoreCase("txt")) {
                                       BufferedReader bufferedReader = new BufferedReader(
                                                 new FileReader(fileName));
                                       String line = null;
                                       while ((line = bufferedReader.readLine()) != null) {
                                            summaryInputData += line;
                                  if(fileExtension.equalsIgnoreCase("doc")){
                                       POIFSFileSystem fs = null;
                                        fs = new POIFSFileSystem(new FileInputStream(fileName));
                                         HWPFDocument doc = new HWPFDocument(fs);
                                         WordExtractor we = new WordExtractor(doc);
                                         String[] paragraphs = we.getParagraphText();
                                         for( int i=0; i<paragraphs .length; i++ ) {
                                            paragraphs[i] = paragraphs.replaceAll("\\cM?\r?\n","");
                                  summaryInputData+= paragraphs[i];
                                  if(fileExtension.equalsIgnoreCase("pdf")){
                                       Document document = new Document();
                   document.open();
                   PdfReader reader = new PdfReader(fileName);
                   int pageCount =reader.getNumberOfPages();
                        for(int i=1;i<=pageCount;i++){
                                  byte[] bytes = reader.getPageContent(i);
                                  PRTokeniser tokenizer = new PRTokeniser(bytes);
                                  StringBuffer buffer = new StringBuffer();
                                  while (tokenizer.nextToken()) {
                                  if (tokenizer.getTokenType() == PRTokeniser.TK_STRING) {
                                  buffer.append(tokenizer.getStringValue());
                                  summaryInputData += buffer.toString();
                   else{
                        System.out.println("This is Invalid document. Presntly we support only text,word and PDF documents ");
                   // String encoded =new String (summaryInputData.getBytes("ISO-8859-1"),"UTF-8");
                        String encoded=Base64Utils.base64Encode(summaryInputData.getBytes());
                   // encoded =new String (summaryInputData.getBytes("ISO-8859-1"),"UTF-8");
                        String parameters= "base64String="+encoded+"&noOfWordsOrPercentage="+noOfWordsOrPercentage;
                        summarizedData= postRequest(parameters,summarizerURL);
                        String slength= "<string xmlns=\"http://tempuri.org/\">";
                        if(summarizedData.contains("</string>")){
                        summarizedData= summarizedData.substring(summarizedData.indexOf(slength)+slength.length(),summarizedData.indexOf("</string>"));
                        summarizedData = replaceVal(summarizedData);
                        //System.out.println("<?xml version=\"1.0\" encoding=\"utf-8\"?><![CDATA["+summarizedData+"]]>");
                        // System.out.println("Summarized data "+summarizedData);
                        if(summarizedData.contains("Please enter the percentage")){
                             summarizedData="Data given cannot be summarized further";
                   else{
                        System.out.println("Data given cannot be summarized further");
                        summarizedData="";
              } catch (FileNotFoundException e) {
                   return("The File is not found \n\n"+e.toString());
              } catch (IOException e) {
                   return("The File is already in use \n\n"+e.toString());
              } catch (Exception e) {
                   return(e.toString());
              return summarizedData;
         public static String postRequest(String parameters,String webServiceURL) throws Exception{
              Properties systemSettings = System.getProperties();
              systemSettings.put("http.proxyHost", loadProperties().getProperty("proxyHost"));
         systemSettings.put("http.proxyPort", loadProperties().getProperty("proxyPort"));
         System.setProperties(systemSettings);
              String responseXML = "";
              try {
                   URL url = new URL(webServiceURL);
                   URLConnection connection = url.openConnection();
                   HttpURLConnection httpConn = (HttpURLConnection) connection;
                   byte[] requestXML = parameters.getBytes();
                   httpConn.setRequestProperty("Content-Length", String
                             .valueOf(requestXML.length));
                   httpConn.setRequestProperty("Content-Type",
                             "application/x-www-form-urlencoded");
                   httpConn.setRequestMethod("POST");
                   httpConn.setDoOutput(true);
                   httpConn.setDoInput(true);
                   OutputStream out = httpConn.getOutputStream();
                   out.write(requestXML, 0, requestXML.length);
                   out.close();
                   InputStreamReader isr = new InputStreamReader(httpConn
                             .getInputStream());
                   BufferedReader br = new BufferedReader(isr);
                   String temp;
                   String tempResponse = "";
                   while ((temp = br.readLine()) != null)
                        tempResponse = tempResponse + temp;
                   responseXML = tempResponse;
                   br.close();
                   isr.close();
              } catch (java.net.MalformedURLException e) {
                   System.out
                             .println("Error in postRequest(): Secure Service Required");
              } catch (Exception e) {
                   System.out.println("Error in postRequest(): " + e.getMessage());
              return responseXML;
         public String replaceVal(String value) {
                   if (value == null) {
                        value = "";
                   value = value.replace("&lt;", "<");
                   value = value.replace("&gt;", ">");
                   value = value.replace("&amp;", "&");
                   return value;
              public static void main(String[] args) {  
                   DocumentSummarizerClient testdoc=new DocumentSummarizerClient();
                   System.out.println("hello");               
                   testdoc.getSummary("C:\\working_folder\\vep\\UnitTestCases\\VEP1.0\\DocumentSummarizerTestData\\TestErrorFour.doc","100%");     
    Note: Use any doc with special char(ex: &, $, <, >,.....) TestErrorFour.doc
    File 2:
    ---------public class Base64Utils {
    private static byte[] mBase64EncMap, mBase64DecMap;
    * Class initializer. Initializes the Base64 alphabet (specified in RFC-2045).
    static {
    byte[] base64Map = {
    (byte)'A', (byte)'B', (byte)'C', (byte)'D', (byte)'E', (byte)'F',
    (byte)'G', (byte)'H', (byte)'I', (byte)'J', (byte)'K', (byte)'L',
    (byte)'M', (byte)'N', (byte)'O', (byte)'P', (byte)'Q', (byte)'R',
    (byte)'S', (byte)'T', (byte)'U', (byte)'V', (byte)'W', (byte)'X',
    (byte)'Y', (byte)'Z',
    (byte)'a', (byte)'b', (byte)'c', (byte)'d', (byte)'e', (byte)'f',
    (byte)'g', (byte)'h', (byte)'i', (byte)'j', (byte)'k', (byte)'l',
    (byte)'m', (byte)'n', (byte)'o', (byte)'p', (byte)'q', (byte)'r',
    (byte)'s', (byte)'t', (byte)'u', (byte)'v', (byte)'w', (byte)'x',
    (byte)'y', (byte)'z',
    (byte)'0', (byte)'1', (byte)'2', (byte)'3', (byte)'4', (byte)'5',
    (byte)'6', (byte)'7', (byte)'8', (byte)'9', (byte)'+', (byte)'/'};
    mBase64EncMap = base64Map;
    mBase64DecMap = new byte[128];
    for (int i=0; i<mBase64EncMap.length; i++)
    mBase64DecMap[mBase64EncMap[i]] = (byte) i;
    * This class isn't meant to be instantiated.
    private Base64Utils() {
    * Encodes the given byte[] using the Base64-encoding,
    * as specified in RFC-2045 (Section 6.8).
    * @param aData the data to be encoded
    * @return the Base64-encoded <var>aData</var>
    * @exception IllegalArgumentException if NULL or empty array is passed
    public static String base64Encode(byte[] aData) {
    if ((aData == null) || (aData.length == 0))
    throw new IllegalArgumentException("Can not encode NULL or empty byte array.");
    byte encodedBuf[] = new byte[((aData.length+2)/3)*4];
    // 3-byte to 4-byte conversion
    int srcIndex, destIndex;
    for (srcIndex=0, destIndex=0; srcIndex < aData.length-2; srcIndex += 3) {
    encodedBuf[destIndex++] = mBase64EncMap[(aData[srcIndex] >>> 2) & 077];
    encodedBuf[destIndex++] = mBase64EncMap[(aData[srcIndex+1] >>> 4) & 017 |
    (aData[srcIndex] << 4) & 077];
    encodedBuf[destIndex++] = mBase64EncMap[(aData[srcIndex+2] >>> 6) & 003 |
    (aData[srcIndex+1] << 2) & 077];
    encodedBuf[destIndex++] = mBase64EncMap[aData[srcIndex+2] & 077];
    // Convert the last 1 or 2 bytes
    if (srcIndex < aData.length) {
    encodedBuf[destIndex++] = mBase64EncMap[(aData[srcIndex] >>> 2) & 077];
    if (srcIndex < aData.length-1) {
    encodedBuf[destIndex++] = mBase64EncMap[(aData[srcIndex+1] >>> 4) & 017 |
    (aData[srcIndex] << 4) & 077];
    encodedBuf[destIndex++] = mBase64EncMap[(aData[srcIndex+1] << 2) & 077];
    else {
    encodedBuf[destIndex++] = mBase64EncMap[(aData[srcIndex] << 4) & 077];
    // Add padding to the end of encoded data
    while (destIndex < encodedBuf.length) {
    encodedBuf[destIndex] = (byte) '=';
    destIndex++;
    String result = new String(encodedBuf);
    return result;
    * Decodes the given Base64-encoded data,
    * as specified in RFC-2045 (Section 6.8).
    * @param aData the Base64-encoded aData.
    * @return the decoded <var>aData</var>.
    * @exception IllegalArgumentException if NULL or empty data is passed
    public static byte[] base64Decode(String aData) {
    if ((aData == null) || (aData.length() == 0))
    throw new IllegalArgumentException("Can not decode NULL or empty string.");
    byte[] data = aData.getBytes();
    // Skip padding from the end of encoded data
    int tail = data.length;
    while (data[tail-1] == '=')
    tail--;
    byte decodedBuf[] = new byte[tail - data.length/4];
    // ASCII-printable to 0-63 conversion
    for (int i = 0; i < data.length; i++)
    data[i] = mBase64DecMap[data[i]];
    // 4-byte to 3-byte conversion
    int srcIndex, destIndex;
    for (srcIndex = 0, destIndex=0; destIndex < decodedBuf.length-2;
    srcIndex += 4, destIndex += 3) {
    decodedBuf[destIndex] = (byte) ( ((data[srcIndex] << 2) & 255) |
    ((data[srcIndex+1] >>> 4) & 003) );
    decodedBuf[destIndex+1] = (byte) ( ((data[srcIndex+1] << 4) & 255) |
    ((data[srcIndex+2] >>> 2) & 017) );
    decodedBuf[destIndex+2] = (byte) ( ((data[srcIndex+2] << 6) & 255) |
    (data[srcIndex+3] & 077) );
    // Handle last 1 or 2 bytes
    if (destIndex < decodedBuf.length)
    decodedBuf[destIndex] = (byte) ( ((data[srcIndex] << 2) & 255) |
    ((data[srcIndex+1] >>> 4) & 003) );
    if (++destIndex < decodedBuf.length)
    decodedBuf[destIndex] = (byte) ( ((data[srcIndex+1] << 4) & 255) |
    ((data[srcIndex+2] >>> 2) & 017) );
    return decodedBuf;
    issue 2: Exception when passing 2MB .txt file
    Steps to reproduce:
    Call getSummary() with 2MB .txt file
    Actual:
    The following exception has occured:
    1. Error in postRequest(): Unexpected end of file from server
    java.lang.NullPointerException
    Please provide your precious feedback/suggestions.
    Thanks in advance…..
    Edited by: EJP on 15/03/2011 16:52: added code tags. Please use them. Code is unreadable otherwise.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Thanks for your response….
    This is enhancement project and some one develops long back.
    Regarding point (b) You should be using the java.net.URLEncoder to encode URL parameters, not a base64 encoder.
    DocumentSummarizerClient.java I am using base64
    Ex:
    // String encoded =new String (summaryInputData.getBytes("ISO-8859-1"),"UTF-8");
                        String encoded=Base64Utils.base64Encode(summaryInputData.getBytes());
                   // encoded =new String (summaryInputData.getBytes("ISO-8859-1"),"UTF-8");
                        String parameters= "base64String="+encoded+"&noOfWordsOrPercentage="+noOfWordsOrPercentage;
                        summarizedData= postRequest(parameters,summarizerURL);
                        String slength= "<string xmlns=\"http://tempuri.org/\">";
                        if(summarizedData.contains("</string>")){
                        summarizedData= summarizedData.substring(summarizedData.indexOf(slength)+slength.length(),summarizedData.indexOf("</string>"));
                        summarizedData = replaceVal(summarizedData);
                        //System.out.println("<?xml version=\"1.0\" encoding=\"utf-8\"?><![CDATA["+summarizedData+"]]>");
                        System.out.println("Summarized data "+summarizedData);
                        if(summarizedData.contains("Please enter the percentage")){
                             summarizedData="Data given cannot be summarized further";
    Above specific please I need to modify to resolve above issue.
    Could you please suggest me what changes I need to do.
    Waiting for positive response.

  • Missing version field in response from server when accessing resource

    HY
    I have a problem to use the version option of the webstart. All files are included into a war file (created with jar cvf xx.war *). This file is in the webapps folder of the Tomcat 5. The jar files from the dev. kit (jnlp-servlet.jar, jaxp.jar, parser.jar are in the WEB-INF/lib folder).
    Every time I get the same message:
    Category: Download Error
    Missing version field in response from server when accessing resource: (http://localhost:8080/version/ademo.jar, 1.1)
    Do I need a aditional file or must Iwrite a servlet???
    Whats wrong
    my JNLP file
    <?xml version="1.0" encoding="utf-8"?>
    <!-- JNLP File fuer HJP3 WebStart Demo-Applikation -->
    <jnlp codebase="http://localhost:8080/version/" href="wstest.jnlp">
    <information>
    <title>HJP3 WebStart Demo Application</title>
    <vendor>Guido Krueger</vendor>
    <homepage href="http://www.javabuch.de"/>
    <description>HJP3 WebStart Demo Application</description>
    <icon href="wstest.gif"/>
    <offline-allowed/>
    </information>
    <information locale="de">
    <description>HJP3 WebStart Demo-Applikation</description>
    <offline-allowed/>
    </information>
    <security>
    <!-- <all-permissions/> //-->
    </security>
    <resources>
    <j2se version="1.4+"/>
    <jar href="ademo.jar" version="1.1"/>
    </resources>
    <application-desc main-class="Listing3813"/>
    </jnlp>
    my version.xml file
    <jnlp-versions>
    <resource>
    <pattern>
    <name>ademo.jar</name>
    <version-id>1.1</version-id>
    </pattern>
    <file>application.jar</file>
    </resource>
    </jnlp-versions>
    my web.xml file
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
         <servlet>
              <servlet-name>JnlpDownloadServlet</servlet-name>
              <servlet-class>com.sun.javaws.servlet.JnlpDownloadServlet</servlet-class>
         </servlet>
         <servlet-mapping>
              <servlet-name>JnlpDownloadServlet</servlet-name>
              <url-pattern>*.jnlp</url-pattern>
         </servlet-mapping>
    </web-app>

    The log file (jnlpdownloadservlet.log) would show the calls for the jar files if the servlet is called for the jar files (did you correct the url mapping ?). Here are a few lines from a log file
    JnlpDownloadServlet(4): Initializing
    JnlpDownloadServlet(3): Request: /maportal/wfe/wfeguiv.jnlp
    JnlpDownloadServlet(3): User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040206 Firefox/0.8
    JnlpDownloadServlet(4): DownloadRequest[path=/wfe/wfeguiv.jnlp isPlatformRequest=false]
    JnlpDownloadServlet(4): Basic Protocol lookup
    JnlpDownloadServlet(4): JnlpResource: JnlpResource[WAR Path: /wfe/wfeguiv.jnlp lastModified=Tue Mar 23 17:06:56 CET 2004]]
    JnlpDownloadServlet(3): Resource returned: /wfe/wfeguiv.jnlp
    JnlpDownloadServlet(4): lastModified: 1080058016000 Tue Mar 23 17:06:56 CET 2004
    JnlpDownloadServlet(3): Request: /maportal/wfe/wfegui.gif
    JnlpDownloadServlet(3): User-Agent: JNLP/1.0.1 javaws/1.4.2_03 (b02) J2SE/1.4.2_03
    JnlpDownloadServlet(4): DownloadRequest[path=/wfe/wfegui.gif isPlatformRequest=false]
    JnlpDownloadServlet(3): Request: /maportal/wfe/wfegui.jar
    JnlpDownloadServlet(3): User-Agent: JNLP/1.0.1 javaws/1.4.2_03 (b02) J2SE/1.4.2_03
    JnlpDownloadServlet(4): DownloadRequest[path=/wfe/wfegui.jar isPlatformRequest=false]
    JnlpDownloadServlet(4): Basic Protocol lookup
    JnlpDownloadServlet(4): JnlpResource: JnlpResource[WAR Path: /wfe/wfegui.jar lastModified=Tue Mar 23 17:06:30 CET 2004]]
    JnlpDownloadServlet(3): Resource returned: /wfe/wfegui.jarYou should see all the resources (including jar files) being requested, and whether a specific version was requested or not (in above sample, not).
    I put my problems down to my application server (Orion) as other people seem to have this working. The deployment in Orion keeps the original timestamps of the jars, so I explicitly set the timestamps in my build so that the unchanged jars do not have to be downloaded all the time. This is not really a good solution, so maybe someone else can give further advice.
    Brendan

  • RFC problem: could not get functionname from XML requst (sic)

    I'm developing an interface that attempts to call a receiver RFC on an SAP 4.6c system.  It's a very small simple interface, and it's all working until it tries to call the RFC.  The error is
    Exception caught by adapter framework: error while processing message to remote system:com.sap.aii.af.rfc.core.client.RfcClientException: could not get functionname from XML requst: com.sap.aii.af.rfc.RfcAdapterException: failed to read funtionname from XML document: missing namespace declara
    I've created an RFC channel, which is green in the adapter monitoring.  The RFC imports without a problem, and appears in my interface mapping.  My mapping program converts to the RFC message type (as evidenced in sxmb_moni.  I have a receiver agreement referencing the interface mapping, which must be working as the mapping is called. 
    Could anyone point me to what else I could check?  I saw a post about the same error message, where the respondent found something in the logs which helped them  Could you expand on what you found, and in which log please?  Any pointers as to which logging options I could switch on and check would be gratefully received.
    Regards
    Alan Graham

    Thanks for the responses.
    I set up a communications channel of type RFC, which is
    showing green in the adapter monitor.  If I deliberately
    break it, eg by changing the password, the adapter shows
    as red in the monitor.  I assume therefore that the
    adaptor settings are correct.
    The XML going to the adapter looks correct AFAIK.  My problem is that I don't know enough about the requied XML to know if what I'm seeing in the logs is sufficient.  In SXMB_MONI, in the 'call adapter' section of a failed message, the outbound binding includes
    <SAP:ToInterfaceNamespace>urn:sap-com:document:sap:rfc:functions</SAP:ToInterfaceNamespace>/code]
    Also, the interface determination SOAP header, in the MAIN section includes
    [code]<SAP:Receiver>
      <SAP:Party agency="" scheme="" />
      <SAP:Service>D04</SAP:Service>
      <SAP:Interface namespace="urn:sap-com:document:sap:rfc:functions">Z_MPU_3PSCE_FREIGHT_UPLOAD</SAP:Interface>
      </SAP:Receiver>
    These are the correct values for the RFC name and the namespace, AFAIK.
    I'm using an interface mapping (which uses and ABAP class as the mapping program) which references the interface of the RFC.  The logs tell me this works, ie, the class is called and the resulting XML appears in the payload of the response.
    Alan

Maybe you are looking for