Regarding exception while reading with socketchannel class

Hi all,
I am facing a problem, Exception is not getting generated while reading from socket channel(SocketChannel::read()) when the TCP connection is dropped at the client side in case of informally exit (eg. when net connection is dropped or net cable is unplugged). Please note that the server and client are running in diffrent LANs in this case.

I dont want to use read timeout concept because it makes server to slowOnly if you implement it incorrectly. In non-blocking mode the correct technique is to use Selector.select(timeout), and any SocketChannels whose selectionOps are OP_READ and which weren't ready when select() returned have timed out.
You only have these two weapons: read timeouts and write exceptions. That's it. TCP/IP doesn't provide anything else.

Similar Messages

  • Exception while working with Tibco adapter for Tuxedo!!

    Dear friends,:-)
    Greetings!
    I am facing an exception while working with "Tuxedo Adapter".
    I have installed TIBCO Adapter for Tuxedo on my machine which has both bea_Client and Server. I am trying to do a PurchaseOrder POC, which is already given in our TIBCO Adapter directory (C:\TIBCO\adapter\adtuxedo\5.3\examples\AgentBased\PurchaseOrder).
    The scenario goes like this, a request is sent from the Tuxedo client called clt, which invokes the Tuxedo service, which in turn sends a request to the adapter (“PublicationService”) through the adapter agent, and then the adapter publishes the data to the TIBCO environment. TIBCO BW receives the data using “Adapter Subscriber” and writes them to an XML output file named Get_output.xml.
    Problem in starting the Adapter - :(
    When I tried to RUN the make.bat which is placed at the “C:\TIBCO\adapter\adtuxedo\5.3\examples\AgentBased\PurchaseOrder” folder, it throws me the error.
    At the time of executing this script, “buildclient -o clt -f client.c”, it says that I don’t have a valid “TUXEDO SDK LICENSE”. The thrown exception is, "TUXNT_CAT:101: ERROR: You do not have a valid TUXEDO SDK license".
    Please tell me, is license Required to run the tux_client?
    also,please clarify, while configuring “tibco.env.WSNADDR”(i.e., Workstation Address of the Tuxedo server to connect to) I have given my machine IP ADDRESS with a unique port. i.e., //10.103.18.120:4020. I am not sure with this step. Please advice me!
    It would be great if you could please solve this issue.
    Thanks in Advance,
    Best Regards,
    Venkatesh Rajendran.

    Hi Venkatesh,
    Please see comments in line.
    Wayne
    <venkatesh rajendran> wrote in message news:[email protected]...
    Dear Wayne,
    Thanks a ton for your reply.
    Please clarify,
    buildclient is a Tuxedo command which is used to generate the Tuxedo client
    application. It needs Tuxedo SDK license, so you need to make sure the
    license is installed properly.
    Can you please let me know from where i can get the License? Can we download
    it online?
    [W] BEA provide a trial license in the product donwload site, but I am not
    sure Tuxedo 8.0 is provide or not. If you or your customer has Tuxedo
    installation, the license should alread be ready. It is located at
    $TUXDIR/udataobj/lic.txt.
    Running tuxedo client does not require SDK license.
    I am not sure how to start it. I am actually running the BAT file which has
    the following scripts,
    set TUXDIR=C:\bea\tuxedo8.0
    set WSNADDR=//10.103.18.120:4020
    set TUX_ADAPTER_HOME=C:\TIBCO\adapter\adtuxedo\5.3
    set TIBCO_RV_HOME=C:\TIBCO\TIBRV
    set APPDIR=%TUX_ADAPTER_HOME%\examples\AgentBased\PurchaseOrder
    set
    PATH=%TUXDIR%\bin;%APPDIR%;%PATH%;%TUX_ADAPTER_HOME%\hotfix\lib;%TUX_ADAPTER_HOME%\lib;%TIBCO_RV_HOME%/bin
    set TUXCONFIG=%APPDIR%\tuxconfig
    set ULOGPFX=%APPDIR%\ulog
    buildclient -o clt -f client.c
    buildserver -o server -f server.c -s POINFO -l
    %TUX_ADAPTER_HOME%\lib\agent.lib
    tmloadcf -y ubbagent
    tmboot ¨Cy
    Up to my knowledge, I hope TIBCO TUXEDO
    (ie.,TIB_adtuxedo-simple_5.3.0_w32_tuxedo80) acts as a TUXEDO_Server which
    receives the Request from TUX_BEA Client(Ex: C:\bea\tuxedo8.0).
    Or, does Tuxedo have a seperate Server installed on the machine other than
    TIBCO? please clarify.
    [W] I don't know the detail about TIBCO Tuxedo adaptor. Following
    clarifications for your reference,
    1. Tuxedo is an application infrastructure with framework for server and
    client. buildclient is used to generate the client binary and buildserver is
    used for application server linkage.
    2. I guess the TIBCO Tuxedo adaptor is a Tuxedo application client(or
    server?) which acts as a proxy process between TIBCO system and Tuxedo
    applications. So it receives request from TIBCO system and transform the
    requet to native Tuxedo data buffers and make the Tuxedo calls, then relay
    the reply back. So first you have to figure out the exact working model of
    it and check your Tuxedo applications.
    Your reply would be appreciated!
    Thanks a ton in Advance!
    Best Regards,
    Venkatesh Rajendran.

  • BPEL interface migration to 11g : EXception while reading partner links.

    Hi All,
    I am migrating 10g BPEL interfaces to 11g using Jdev 11.1.1.4 Jdeveloper.
    After migrating an interface having partnerlink in to 11.1.1.4 Jdev , if I try to open any partner link it causes error: Failed to read the WSDL or Http Connection Error code 407 in the partner links.
    If we try to open Invoke_variables it gives error like which could not work :
    "Exception while reading schema " or "Exception - Could not retrieve message parts ."
    Note : Those partner links are already deployed on server and at the moment of this error if I try to reach these PartnerLinks through browser i am able to reach.
    I had tried following ways to come over it :
    1. changing the URL to a valid IP Address and check if you still has the issues.
    2. Bu using Abstract wsdl's in place of concrete wsdl. Make a local copy of the wsdl file and try to import the wsdl into JDev.
    3. By unchecking the Proxy Server
    JDeveloper -> Tools -> Preferences -> Web Browser and Proxy -> Uncheck "Use HTTP Proxy Server"
    Is there any way to get over this issue?
    any suggestion regarding this will be so helpful !
    Thanks & Regards,
    Nupur

    Hi folks,
    is there any solution for this error ??
    WSDL which we are trying to load is in server in US , so is there any posiblity of this error due to network latency between
    laptop (client m/c running JDEV) and the server (hosting wsdl)?
    Thanks ,
    Nupur

  • I/O exception while reading

    I got an error I/O exception while reading : E:\SampleCheckboxes2.html (The system can not find the file specified )
    What does it mean ??? what should I do ? I am very new in Java

    It means the file is not there. Check to make sure the file is in the specified location, if it is, check the spelling.

  • RunTime Exception while reading the file

    Hi,
    I am using aixs1.0 for my current project. I have uploading an image file. if the file is in c: drive then upload successfully. if the file is in desktop it gives socket connection exception. while the desktop name is with .v example.c:\documents and settings\srinivas.v\desktop\image2.gif when I amreding this file from the project it gives the following error. can u please help in this regard
    10/10 18:33:12 error [axis] java.io.IOException:
    java.net.SocketException: Software caused connection abort: socket write error
    at java.net.SocketOutputStream.socketWrite0(Native Method)
    at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
    at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
    at java.io.BufferedOutputStream.write(BufferedOutputStream.java:106)
    at sun.nio.cs.StreamEncoder$CharsetSE.writeBytes(StreamEncoder.java:336)
    at sun.nio.cs.StreamEncoder$CharsetSE.implWrite(StreamEncoder.java:395)
    at sun.nio.cs.StreamEncoder.write(StreamEncoder.java:136)
    at java.io.OutputStreamWriter.write(OutputStreamWriter.java:191)
    at java.io.BufferedWriter.flushBuffer(BufferedWriter.java:111)
    at java.io.BufferedWriter.write(BufferedWriter.java:206)
    at java.io.Writer.write(Writer.java:126)
    at org.apache.axis.SOAPPart.writeTo(SOAPPart.java:277)
    at org.apache.axis.Message.writeTo(Message.java:440)
    at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.ja
    va:466)
    at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:122)
    at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrateg
    y.java:71)
    at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:150)
    at org.apache.axis.SimpleChain.invoke(SimpleChain.java:120)
    at org.apache.axis.client.AxisClient.invoke(AxisClient.java:180)
    at org.apache.axis.client.Call.invokeEngine(Call.java:2564)
    at org.apache.axis.client.Call.invoke(Call.java:2553)
    at org.apache.axis.client.Call.invoke(Call.java:2248)
    at org.apache.axis.client.Call.invoke(Call.java:2171)
    at org.apache.axis.client.Call.invoke(Call.java:1691)
    at com.stellent.www.CheckIn.CheckInSoapStub.checkInUniversal(CheckInSoap
    Stub.java:210)
    at jrun__Product_Info__CompetitiveProductConfirmation2ejsp30._jspService
    (jrun__Product_Info__CompetitiveProductConfirmation2ejsp30.java:266)
    at jrun.jsp.runtime.HttpJSPServlet.service(HttpJSPServlet.java:43)
    at jrun.jsp.JSPServlet.service(JSPServlet.java:119)
    at jrun.servlet.FilterChain.doFilter(FilterChain.java:86)
    at jrun.servlet.security.StandardSecurityFilter.doFilter(StandardSecurit
    yFilter.java:103)
    at jrun.servlet.FilterChain.doFilter(FilterChain.java:94)
    at jrun.servlet.FilterChain.service(FilterChain.java:101)
    at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:91)
    at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
    at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:
    249)
    at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:
    527)
    at jrun.servlet.http.WebService.invokeRunnable(WebService.java:168)
    at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPoo
    l.java:348)
    at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.j
    ava:451)
    at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.
    java:294)
    at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
    10/10 18:39:47 error
    java.lang.NullPointerException
    at jrun__Home__Home2ejspe._jspService(jrun__Home__Home2ejspe.java:182)
    at jrun.jsp.runtime.HttpJSPServlet.service(HttpJSPServlet.java:43)
    at jrun.jsp.JSPServlet.service(JSPServlet.java:119)
    at jrun.servlet.FilterChain.doFilter(FilterChain.java:86)
    at jrun.servlet.security.StandardSecurityFilter.doFilter(StandardSecurit
    yFilter.java:103)
    at jrun.servlet.FilterChain.doFilter(FilterChain.java:94)
    at jrun.servlet.FilterChain.service(FilterChain.java:101)
    at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:91)
    at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
    at jrun.servlet.JRunRequestDispatcher.invokeNext(JRunRequestDispatcher.j
    ava:447)
    at jrun.servlet.JRunRequestDispatcher.forwardInvoke(JRunRequestDispatche
    r.java:417)
    at jrun.servlet.JRunRequestDispatcher.forward(JRunRequestDispatcher.java
    :175)
    at jrun.servlet.file.FileServlet.service(FileServlet.java:306)
    at jrun.servlet.FilterChain.doFilter(FilterChain.java:86)
    at jrun.servlet.security.StandardSecurityFilter.doFilter(StandardSecurit
    yFilter.java:103)
    at jrun.servlet.FilterChain.doFilter(FilterChain.java:94)
    at jrun.servlet.FilterChain.service(FilterChain.java:101)
    at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:91)
    at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
    at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:
    249)
    at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:
    527)
    at jrun.servlet.http.WebService.invokeRunnable(WebService.java:168)
    at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPoo
    l.java:348)
    at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.j
    ava:451)
    at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.
    java:294)
    at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
    ThankYou
    Srinivas Vakkalanka

    Hi,
    check the MOS Note: readDomain() on UnPacked WLS 12c Domain will Fail with com.oracle.cie.common.CommonException: fail to load domain from directory. (Doc ID 1681602.1)
    https://support.oracle.com/epmos/faces/DocContentDisplay?id=1681602.1
    Borys

  • Filtering of data while reading with "RSDRI_INFOPROV_READ" from infocube.

    Hi all,
    I am working with a function module "rsdri_infoprov_read" to read data from multi provider. Here i am facing a problem with the parameter 'i_t_range' - select options, I have filled elements of this parameter, but regardless of my selection it brings some more data from cube. It would be so helpful for me if somebody can can have a look at it. The value apppending to i_t_range is as shown below,
    plant is the selectio screen input.
    LOOP AT s_plant.
          g_s_range-chanm    = 'GCSLOCT'.
          g_s_range-sign      = 'I'.
          g_s_range-compop    = 'EQ'.
          g_s_range-low      = s_plant-low.
          APPEND g_s_range TO g_t_range.
        ENDLOOP.
    material  is the selectio screen input for which product.
    LOOP AT i_t_materials.
          g_s_range-chanm    = 'GCSMATE'.
          g_s_range-sign      = 'I'.
          g_s_range-compop    = 'EQ'.
          g_s_range-low      = i_t_materials-sub_type.
          APPEND g_s_range TO g_t_range.
        ENDLOOP.
    version is the planning book version constant.
          g_s_range-chanm    = 'GCSPLVER'.
          g_s_range-sign      = 'I'.
          g_s_range-compop    = 'EQ'.
          g_s_range-low      = version.
          APPEND g_s_range TO g_t_range.
        ENDLOOP.
    week  is the selectio screen input for period.
      g_s_range-chanm    = '0CALWEEK'.
      g_s_range-sign      = 'I'.
      g_s_range-compop    = 'BT'.
      g_s_range-low      = s_period-low.
      g_s_range-high      = s_period-high.
      APPEND g_s_range TO g_t_range.
    It should fetch data for the plant which i given in s_plant-low(select option) only but it returns other plants too in the output internal table e_t_data.So it effects the perfomance and here i need to fliter the other plants while reading itself.
    This is for plant, but coming to other inputs like material,version and period into the i_t_range table and for which it returns the corrct values only.The problem's with the plant input selection only.
    I hpe you guys can easilyhelp me with this,,
    thanks in advance for all.
    Regards
    ashir ck

    Just as double check, 
    Put in a breakpoint after it gets out of the Loop at S_plant and check what is in table g_t_range.   Maybe something there is a value in there that you are not expecting.
    plant is the selectio screen input.
    LOOP AT s_plant.
    g_s_range-chanm = 'GCSLOCT'.
    g_s_range-sign = 'I'.
    g_s_range-compop = 'EQ'.
    g_s_range-low = s_plant-low.
    APPEND g_s_range TO g_t_range.
    ENDLOOP.
    PUT A BREAKPOINT HERE

  • Null Pointer Exception while reading inbox

    Hi Experts
    I am getting the Null Pointer Exception when I execute the following code. Can anybody please suggest where i am going wrong.
      public void readInbox( )
        //@@begin readInbox()
         while (! wdContext.nodeEmail().isEmpty()) {
              wdContext.nodeEmail().removeElement(wdContext.nodeEmail().getElementAt(0) );
         wdContext.nodeEmail().invalidate();   
         Message[] message = new Message[1000];
         IPublicEmailInteractiveFormComp.IEmailElement newEmailNodeElement;
         //Set properties
         // @TODO Enter your email server address here by replacing the text in angle brackets.
         String host = "otemail.otegroup.com";
         // @TODO Enter your email account here by replacing the text in angle brackets.
         String username = "[email protected]";
         // @TODO Enter your email account password here by replacing the text in angle brackets.
         String password = "password";
         Properties props = new Properties();     
         props.put("mail.smtp.host", host);
         //Set Session
         Session session = Session.getInstance(props, null);
         //Set the store
         try {
              Store store = session.getStore("imap");
              store.connect(host,username,password);
              //Get folder
              Folder folder = store.getFolder("INBOX");
              folder.open(Folder.READ_ONLY);
              //Get Mails
              message = folder.getMessages();
              //Fill table with mails
              for (int i = 0; i < message.length; i++)
                   if (message<i>.isSet(Flags.Flag.SEEN) == false)
                        if (message<i>.getSubject().equals("Travel Request Form"))
                             newEmailNodeElement = wdContext.createEmailElement();                 
                             newEmailNodeElement.setFrom(message<i>.getFrom()[0].toString());
                             newEmailNodeElement.setSubject(message<i>.getSubject());
                             newEmailNodeElement.setSentDate(message<i>.getSentDate().toString());
                             //Check for right Attachment
                             Object content = message<i>.getContent();
                             if ( content != null  && content instanceof Multipart)
                                  for (int j = 0 , n = ((Multipart)content).getCount(); j < n; j++)
                                       Part part = ((Multipart)content).getBodyPart(j);
                                       String disposition = part.getDisposition();
                                       if ( disposition != null && (disposition.equals(Part.ATTACHMENT) || disposition.equals(Part.INLINE)))
                                            if (part.getFileName().equals("TravelRequest.pdf"))
                                                 newEmailNodeElement.setAttachment(true);
                                                 newEmailNodeElement.setContentType(part.getContentType().toString());
                                                 InputStream is = part.getInputStream();
                                                 ByteArrayOutputStream bo = new ByteArrayOutputStream();                                                                                
                                                 int c;
                                                 while ((c = is.read()) > -1) bo.write(c);
                                                 byte[] pdfSource = bo.toByteArray();
                                                 newEmailNodeElement.setPdfSource(pdfSource);
                                                 break;     
                                            else
                                                 newEmailNodeElement.setAttachment(false);     
                             wdContext.nodeEmail().addElement(newEmailNodeElement);
              //Close connection
              folder.close(true);
              store.close();          
         catch (MessagingException e)
              wdComponentAPI.getMessageManager().reportSuccess(e.getMessage());
              e.printStackTrace();
         catch (IOException e)
              wdComponentAPI.getMessageManager().reportSuccess(e.getMessage());
              e.printStackTrace();
         catch (NullPointerException e)
              wdComponentAPI.getMessageManager().reportSuccess(e.getMessage());
              e.printStackTrace();
        //@@end
    Regards
    Abdullah

    The error was caused when the subject used to return null

  • Exception while reconciliation with child table attributes

    I developed scheduler task that take information about users and create reconciliation event with multi valued field "Roles" that consist of "Role" field and "App" fields. Primary reconciliation work fine and resource added to user, but when i update user in target system and run my scheduler task - exception occured:
    oracle.iam.reconciliation.exception.ModifyAccountException: java.lang.Exception: Error occurred in XL_SP_RECONCHILDMATCH While processing Event No 3523 One or more input parameter passed as null at oracle.iam.reconciliation.impl.AccountHandler.modify(AccountHandler.java:361) at oracle.iam.reconciliation.impl.AccountHandler.applyRule(AccountHandler.java:243) at oracle.iam.reconciliation.impl.AccountHandler.process(AccountHandler.java:205) at oracle.iam.reconciliation.impl.ActionEngine.processEvent(ActionEngine.java:197) at oracle.iam.reconciliation.impl.ReconOperationsServiceImpl.processReconciliationEvent(ReconOperationsServiceImpl.java:982) at oracle.iam.reconciliation.api.ReconOperationsServiceEJB.processReconciliationEventx(Unknown Source) at sun.reflect.GeneratedMethodAccessor707.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310) at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131) at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119) at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at
    Here is code from scheduler task:
    try{ if(!reconOperations.ignoreEvent(objectName, attrs))
    long eventId = reconOperations.createReconciliationEvent(objectName, attrs, eventAttributes);
    List<HashMapWrapper> childList = port.getRolesForUser((String)attrs.get("Identity"),resourceProperties.get(LOGIN_RESOURCE_PROPERTY),
    resourceProperties.get(PASSWORD_RESOURCE_PROPERTY));
    if(childList!=null && !childList.isEmpty())
    for(int k=0;k<childList.size();k++)
    HashMap<String,String> child = new HashMap<String, String>();
    HashMapWrapper childWrapper = childList.get(k);
    HashMapWrapper.Map childMap = childWrapper.getMap();
    List<HashMapWrapper.Map.Entry> childEntry = childMap.getEntry();
    for(int f=0;f<childEntry.size();f++)
    HashMapWrapper.Map.Entry childParam = childEntry.get(f);
    child.put(childParam.getKey(),childParam.getValue());
    reconOperations.addMultiAttributeData(eventId,"Roles",child);
    reconOperations.providingAllMultiAttributeData(eventId,"Roles",true);
    reconOperations.finishReconciliationEvent(eventId);
    reconOperations.processReconciliationEvent(eventId);
    LOG.fine("created : " + eventId);
    Help to solve this issue!

    First make one of the child form fields as Key Field!!!
    List<HashMapWrapper> childList = port.getRolesForUser((String) attrs.get("Identity"), resourceProperties.get(LOGIN_RESOURCE_PROPERTY),
    resourceProperties.get(PASSWORD_RESOURCE_PROPERTY));
    HashMap[] childs = null;
    if (childList != null && !childList.isEmpty()) {
    childs = new HashMap[childList.size()];
    for (int k = 0; k < childList.size(); k++) {
    HashMap<String, String> child = new HashMap<String, String>();
    HashMapWrapper childWrapper = childList.get(k);
    HashMapWrapper.Map childMap = childWrapper.getMap();
    List<HashMapWrapper.Map.Entry> childEntry = childMap.getEntry();
    for (int f = 0; f < childEntry.size(); f++) {
    HashMapWrapper.Map.Entry childParam = childEntry.get(f);
    child.put(childParam.getKey(), childParam.getValue());
    childs[k] = child;
    if (!reconOperations.ignoreEventAttributeData(objectName, attrs, "Roles", childs)) {
    long eventId = reconOperations.createReconciliationEvent(objectName, attrs, eventAttributes);
    if (childs != null && childs.length != 0) {
    for (int f = 0; f < childs.length; f++) {
    reconOperations.providingAllMultiAttributeData(eventId, "Roles", true);
    reconOperations.addDirectMultiAttributeData(eventId, "Roles", childs[f]);
    reconOperations.finishReconciliationEvent(eventId);
    LOG.debug("created: " + eventId);
    } else {
    LOG.debug("ignored: " + attrs.get("LoginName"));
    }

  • Exception while Read very large file 300 MB

    Hi
    I want to read a file which has size of more than 300 MB.
    While i m executing my code, i m getting
    Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
    Below is my code
    1. FileChannel fc = new FileInputStream(fFile).getChannel();
    2.CharBuffer chrBuff = Charset.forName("8859_1").newDecoder().decode(fc.map(FileChannel.MapMode.READ_ONLY, 0, fc.size()));
    3.fc.close();Im getting the exception in the line 2.
    Even though i increased the Heap space up to 900 Mb, i m getting this error.
    (FYI)
    I executed in command prompt like below,
    java -Xms128m -Xmx1024m readLargeFile
    Kindly give a solution for this. is there any other best way to read large text file ??
    I m waiting for your reply..
    Thanks in advance

    Thanks for your reply.
    My task is to open a large file in READ&WRITE mode and i need to search some portion of text in that file by searching starting and end point.
    Then i need to write that searched area of text to a new file and delete that portion from the original file.
    The above process i will do more times.
    So I thought that for these process, it will be easy by loading the file into memory by CharBuffer and can search easily by MATCHER class.
    Above is my task, then now suggest me some efficient ways.
    Note that my file size will be more and using JAVA only i've to do these things.
    Thanks in Advance...

  • Authentication Failed Exception while reading mail using POP

    Hi,
    I am using POP3 for reading mails from mail id. When I try to read the mail from Microsoft Exchange server 2007, it is a success. But same code is giving "Authentication Failed Exception" with Microsoft Exchange server 2010.
    One more difference, I figured out. Microsoft Exchange server 2007 is having NTLM as LoginType and code works fine with it. Where as Microsoft Exchange server 2010 is having TLS as LoginType and code is giving "Authentication Failed Exception".
    Line of code which is giving exception is...
    store = session.getStore(providerPOP3);
    store.connect(host, user, password); //throws exception
    Please advice how this code can work with Microsoft Exchange server 2010 having TLS as LoginType.
    Regards,

    Thanks for your reply.
    Yes, I am using javamail 1.4.3. My code is working fine with Exchange server 2007 having NTLM.
    But when I changed the credentials as per mail id configured on Exchange Server 2010 having TLS support, it did not work. Can you please help what code change would be required to read mails from mail id configured on Exchage Server 2010 having TLS support.
    Sorry, if my point seems not understandable as I am as new with these terminologies (mail server and all) as baby with world. :)
    Thanks for supprt.

  • Out of memory exception while reading the records in crystal report

    hi..
    im using sap crystal report version 13.0.2000.0.
    i've 27,000 records to be printed but when i run my application
    the exception error is displayed "Out Of Memory"..
    i've my appliation in VS2010 and OS is server 64bit
    and 4GB RAM..
    i dont know what to do ...

    Ok. So this is a brand new report created in CRVS2010(?).
    I'd like you to go to the database menu and select "Set Data Source Location". Expand the "Poperties" node and tell me what you see next to "Database Type"
    Also, I've also got a bit of a confusion on my part. In the inital post you say:
    i've 27,000 records to be printed but when i run my application
    the exception error is displayed "Out Of Memory"..
    But a bit later on you say:
    if there are 8000 records it'll take around 2 minutes
    to display the records..
    but there are 27000 records it will take more
    amount of time and the browser hangsup..
    So, is the issue when printing, or viewing?
    - Ludek

  • While reading from the pl/sql cursor i got "Invalid column index" exception

    Hi,
    I got the "Invalid column index" exception while reading from the cursor.
    Please advice.
    Thanks in advance
    siva

    I suppose one (or more) index in your query is in a bad state.
    Possible solutions: rebuild (with 'ALTER INDEX <index> REBUILD ...')
    drop and recreate (it's the same as above, but a little more long)

  • Error while reading objects from a file

    Below is a short code to explain the problem i am facing
    i have been working on the same for past one week i am facing exceptions while reading a file containing more than one objects
    import java.io.BufferedInputStream;
    import java.io.BufferedOutputStream;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.io.ObjectInputStream;
    import java.io.ObjectOutputStream;
    import java.io.Serializable;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    * @author sakshi
    public class Storingobject implements Serializable{
        int x,y;
        public void addObject()
            //Storingobject temp;
            ObjectOutputStream objOut=null;
            try {
                objOut = new ObjectOutputStream(new BufferedOutputStream(new FileOutputStream("temp.dat")));//if i pass true as parameter in FileOutputStream it gives Stream Corrupted exception
            } catch (IOException ex) {
                Logger.getLogger(Storingobject.class.getName()).log(Level.SEVERE, null, ex);
            try {
                // while((temp=objOut.writeObject(o))!=null)
                objOut.writeObject(this);
                System.out.println("Saved..");
                objOut.close();
            } catch (IOException ex) {
                Logger.getLogger(Storingobject.class.getName()).log(Level.SEVERE, null, ex);
        public void readobject()
            int i=1;
            Storingobject temp;
            ObjectInputStream objIn=null;
            try {
                objIn = new ObjectInputStream(new BufferedInputStream(new FileInputStream("temp.dat")));
            } catch (IOException ex) {
                Logger.getLogger(Storingobject.class.getName()).log(Level.SEVERE, null, ex);
            try {
                while ((temp = (Storingobject) objIn.readObject()) != null) {
                    System.out.println("VAlues of object i++ :");
                    System.out.println("X: "+temp.x+"Y: "+temp.y);
            } catch (IOException ex) {
                Logger.getLogger(Storingobject.class.getName()).log(Level.SEVERE, null, ex);
            } catch (ClassNotFoundException ex) {
                Logger.getLogger(Storingobject.class.getName()).log(Level.SEVERE, null, ex);
        public static void main(String args[])
            Storingobject o1=new Storingobject();
            o1.x=10;o1.y=15;
            o1.addObject();
            o1.readobject();
    }

    //if i pass true as parameter in FileOutputStream it gives Stream Corrupted exceptionI agree. You can't append to a file written with an ObjectOutputStream. You would have to read it all in, write it all out again and write the new object. You're better off keeping the file open while you still have objects to write to it.
    while ((temp = (Storingobject) objIn.readObject()) != null) {ObjectInputStream.readObject() only returns null if you wrote a null. If you're not writing nulls, the correct technique is to loop until you get an EOFException. I don't favour explicitly writing a null just to get around this as suggested above, as it means you can never write a null for any other purpose.

  • Message failing in SXMB_moni----Error while reading from the secure store

    Hi,
    The scenario is as below
    A file is picked up from a folder and processed to enrich it.This enriched file is then written back in a different folder.
    The message is failing in sxmb_moni while trying to write the file in the folder.
    The PI system is a system copy of another system and few of the configuration objects are transported through a tpz file to this PI system.The file receiver channel used to write this file is also transported through this tpz file.
    Below is the error seen in moni.:
    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?><!-- Call Adapter --> <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1"><SAP:Category>XIServer</SAP:Category><SAP:Code area="INTERNAL">AE_DETAILS_GET_ERROR</SAP:Code><SAP:P1/><SAP:P2/><SAP:P3/><SAP:P4/><SAP:AdditionalText>Error while reading from the secure store: ERROR_U: No service user password found for Adapter Engine</SAP:AdditionalText><SAP:Stack>Error while reading access data (URL, user, password) for the Adapter Engine
    </SAP:Stack><SAP:Retry>M</SAP:Retry></SAP:Error>
    Below is Trace log:
    <Trace level="1" type="B" name="PLSRV_CALL_ADAPTER"></Trace><!-- ************************************ -->
    <Trace level="1" type="B" name="CL_XMS_MAIN-CALL_PLSRV"></Trace><!-- ************************************ -->
    <Trace level="1" type="B" name="CL_XMS_MAIN-CALL_PLSRV_LOCAL"></Trace><!-- ************************************ -->
    <Trace level="1" type="B" name="CL_XMS_PLSRV_IE_ADAPTER-ENTER_PLSRV">
    <Trace level="1" type="B" name="CL_XMS_PLSRV_CALL_XMB-CALL_XMS_HTTP"></Trace><!-- ************************************ -->
    <Trace level="1" type="T">error reading secstore:Error while reading from the secure store: ERROR_UNKNOWN: System-dependent data for entry  changed:  / (SECSTORE,031) </Trace>
    <Trace level="1" type="System_Error">Error while reading access data (URL, user, password) for the Adapter Engine  </Trace>
    </Trace>
    </Trace>
    <Trace level="1" type="System_Error">Error exception return from pipeline processing! </Trace>
    <Trace level="1" type="B" name="CL_XMS_MAIN-WRITE_MESSAGE_TO_PERSIST"></Trace><!-- ************************************ -->
    Is this because  PI system is a system copy of another system ?
    Regards,
    Sneha

    Error while reading access data (URL, user, password) for the Adapter Engine
    Check out Michal's reply:
    Re: URL for Central Adapter Engine
    As you said there was a system copy it may be the case that some things were not configured properly

  • IOException while reading the the InputStream

    Hi,
    I am running into an issue where I am encounter an IOException while reading the InputStream. The URL sends back XML and is NOT Malformed. What would be causing the IOException?
    URL server = new URL(url);
    HttpURLConnection connection = (HttpURLConnection)server.openConnection();
    connection.setRequestMethod("GET");
    try{
         connection.connect();
         InputStream in= connection.getInputStream();
    }catch(IOException e){
    //Exception while reading the InputStream
    any hints would be greatly appreciated. thanks,
    M

    Here is what I get
    java.io.IOException: Server returned HTTP response code: 505 for URL:
    http://cheese.ddc.dal.earthlink.net/sa/search?upc=0088698190142&mfn="Hewlett-Packard"&producttitle="HP LaserJet 5000 - Printer - B/W - laser - A3 - 1200 dpi x 1200 dpi - up to 16 ppm - capacity: 350 sheets - Parallel, Serial"&partnumber=C4110A&XSL_TEMPLATE=sample.xsl&RESULTS=PARTNERS
    But the URL is Ok. I can see XML being returned in the browser.
    505 The HTTP protocol you are asking for is not supported.
    Now, why would that be?
    Thanks a lot for the help.
    M

Maybe you are looking for