Synchronous File Read on Invoke Problem

I am trying to invoke file adapter to read the file once(Synchronous File Read) as described in Bpeltechadapter guide.
Read about Synchronous File Reading Capability here download.oracle.com/otndocs/products/bpel/bpeltechadp.pdf
Also read this: Re: Help! Three questions about FileAdapater. .
I get this process generation failed when i try to build it. The Empty_msg in inputvariable of invoke works but problem is with Charges_msg in output variable.
I am sure its something to do with ns but not getting it to work.
PL_FileInbound.WSDL code*********************
<definitions
name="PL_FileInbound"
targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/file/PL_FileInbound/"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:tns="http://xmlns.oracle.com/pcbpel/adapter/file/PL_FileInbound/"
xmlns:plt="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
xmlns:jca="http://xmlns.oracle.com/pcbpel/wsdl/jca/"
xmlns:imp1="http://TargetNamespace.com/FA_ReadFile"
xmlns:hdr="http://xmlns.oracle.com/pcbpel/adapter/file/"
>
<import namespace="http://xmlns.oracle.com/pcbpel/adapter/file/" location="fileAdapterOutboundHeader.wsdl"/>
<types>
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/file/PL_FileInbound/">
<import namespace="http://TargetNamespace.com/FA_ReadFile" schemaLocation="PipeDelimitedNIX_Charges.xsd" />
<element name="empty"><complexType/></element>
</schema>
</types>
<message name="Chargesheet_msg">
<part name="Chargesheet" element="impl:Chargesheet"/>
</message>
<message name="Empty_msg">
<part name="Empty" element="tns:empty"/>
</message>
<portType name="SynchronousRead_ptt">
<operation name="SynchronousRead">
<input message="tns:Empty_msg"/>
<output message="tns:Chargesheet_msg"/>
</operation>
</portType>
<binding name="SynchronousRead_binding" type="tns:SynchronousRead_ptt">
<jca:binding />
<operation name="SynchronousRead">
<jca:operation
PhysicalDirectory="C:\Incoming"
InteractionSpec="oracle.tip.adapter.file.outbound.FileReadInteractionSpec"
FileName="abcl.txt"
DeleteFile="false"
OpaqueSchema="false">
</jca:operation>
<input>
<jca:header message="hdr:OutboundHeader_msg" part="outboundHeader"/>
</input>
</operation>
</binding>
<service name="PL_FileInbound">
<port name="SynchronousRead_pt" binding="tns:SynchronousRead_binding">
<jca:address location="eis/FileAdapter" />
</port>
</service>
<plt:partnerLinkType name="Read_plt" >
<plt:role name="Read_role" >
<plt:portType name="tns:SynchronousRead_ptt" />
</plt:role>
</plt:partnerLinkType>
</definitions>
BPEL Source ******************************************
<!--
// Oracle JDeveloper BPEL Designer
// Created: Sat Apr 29 16:52:43 CDT 2006
// Author: dpatel
// Purpose: Synchronous BPEL Process
-->
<process name="SynchronousFileRead"
targetNamespace="http://xmlns.oracle.com/SynchronousFileRead"
xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20"
xmlns:ns1="http://xmlns.oracle.com/pcbpel/adapter/file/PL_FileInbound/"
xmlns:ldap="http://schemas.oracle.com/xpath/extension/ldap"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:bpelx="http://schemas.oracle.com/bpel/extension"
xmlns:client="http://xmlns.oracle.com/SynchronousFileRead"
xmlns:ora="http://schemas.oracle.com/xpath/extension"
xmlns:orcl="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc">
<!-- ================================================================= -->
<!-- PARTNERLINKS -->
<!-- List of services participating in this BPEL process -->
<!-- ================================================================= -->
<partnerLinks>
<!--
The 'client' role represents the requester of this service. It is
used for callback. The location and correlation information associated
with the client role are automatically set using WS-Addressing.
-->
<partnerLink name="client" partnerLinkType="client:SynchronousFileRead"
myRole="SynchronousFileReadProvider"/>
<partnerLink myRole="Read_role" name="PL_FileInbound"
partnerRole="Read_role" partnerLinkType="ns1:Read_plt"/>
</partnerLinks>
<!-- ================================================================= -->
<!-- VARIABLES -->
<!-- List of messages and XML documents used within this BPEL process -->
<!-- ================================================================= -->
<variables>
<!-- Reference to the message passed as input during initiation -->
<variable name="inputVariable"
messageType="client:SynchronousFileReadRequestMessage"/>
<!--
Reference to the message that will be returned to the requester
-->
<variable name="outputVariable"
messageType="client:SynchronousFileReadResponseMessage"/>
<variable name="Invoke_1_SynchronousRead_InputVariable"
messageType="ns1:Empty_msg"/>
<variable name="Invoke_1_SynchronousRead_OutputVariable"
messageType="ns1:Chargesheet_msg"/>
</variables>
<!-- ================================================================= -->
<!-- ORCHESTRATION LOGIC -->
<!-- Set of activities coordinating the flow of messages across the -->
<!-- services integrated within this business process -->
<!-- ================================================================= -->
<sequence name="main">
<!-- Receive input from requestor.
Note: This maps to operation defined in SynchronousFileRead.wsdl
-->
<receive name="receiveInput" partnerLink="client"
portType="client:SynchronousFileRead" operation="process"
variable="inputVariable" createInstance="yes"/>
<!-- Generate reply to synchronous request -->
<invoke name="Invoke_1" partnerLink="PL_FileInbound"
portType="ns1:SynchronousRead_ptt" operation="SynchronousRead"
inputVariable="Invoke_1_SynchronousRead_InputVariable"
outputVariable="Invoke_1_SynchronousRead_OutputVariable"/>
<!--outputVariable="Invoke_1_SynchronousRead_OutputVariable"-->
<reply name="replyOutput" partnerLink="client"
portType="client:SynchronousFileRead" operation="process"
variable="outputVariable"/>
</sequence>
</process>
I would really appreciate your help here.

I face the same issue and I have given all permissions to the folder for OS user.
Because of this error my server is not starting up . Is there any way I can undeploy this composite to get my server running.
I cant do this from EM because SOA server is failing to start up.
I have tried removing it from $DOMAIN_HOME/deployed-composites but still when i try restarting the soa server the composite comes up there. Do we need to delete the entry some where else too. Kindly help.
Thanks,
Sri.

Similar Messages

  • Issue in Synchronous File Read in clustered environment

    Hi,
    We are using clustered environment (4 managed servers) in Unix. In a OSB 11gR3 proxy service we are using Synchronous File Read. Randomly we are getting the below error. Let us know what could cause the issue. But the same code is working fine in a single stand-alone server configuration.
    Error Code : BEA-380002 , Error Reason : Invoke JCA outbound service failed with connection error, exception: com.bea.wli.sb.transports.jca.JCATransportException: oracle.tip.adapter.sa.api.JCABindingException: oracle.tip.adapter.sa.impl.fw.ext.org.collaxa.thirdparty.apache.wsif.WSIFException: servicebus:/WSDL/wsdlPathAndName [ SynchRead_ptt::SynchRead(Empty,body) ] - WSIF JCA Execute of operation 'SynchRead' failed due to: No Data to process.
    No Data to process.
    File /root/oracle/domains/osb/11.1.1.4/cluster/data/osb2/FolderName/Filename.txt to be processed was not found or not available or has no content ; nested exception is:
    BINDING.JCA-11007
    No Data to process.
    No Data to process.
    File /root/oracle/domains/osb/11.1.1.4/cluster/data/osb2/FolderNamer/Filename.txt to be processed was not found or not available or has no content Please make sure that the file exists in the specified directory.
    com.bea.wli.sb.transports.jca.JCATransportException: oracle.tip.adapter.sa.api.JCABindingException: oracle.tip.adapter.sa.impl.fw.ext.org.collaxa.thirdparty.apache.wsif.WSIFException: servicebus:/WSDL/wsdlPathAndName [ SynchRead_ptt::SynchRead(Empty,body) ] - WSIF JCA Execute of operation 'SynchRead' failed due to: No Data to process.
    No Data to process.
    File /root/oracle/domains/osb/11.1.1.4/cluster/data/osb2/FolderName/Filename.txt to be processed was not found or not available or has no content ; nested exception is:
    BINDING.JCA-11007
    No Data to process.
    No Data to process.
    File /root/oracle/domains/osb/11.1.1.4/cluster/data/osb2/FolderName/Filename.txt to be processed was not found or not available or has no content Please make sure that the file exists in the specified directory.
    at com.bea.wli.sb.transports.jca.binding.JCATransportOutboundOperationBindingServiceImpl.invoke(JCATransportOutboundOperationBindingServiceImpl.java:153)
    at com.bea.wli.sb.transports.jca.JCATransportEndpoint.sendRequestResponse(JCATransportEndpoint.java:209)
    at com.bea.wli.sb.transports.jca.JCATransportEndpoint.send(JCATransportEndpoint.java:170)
    at com.bea.wli.sb.transports.jca.JCATransportProvider.sendMessageAsync(JCATransportProvider.java:598)
    at sun.reflect.GeneratedMethodAccessor1115.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.bea.wli.sb.transports.Util$1.invoke(Util.java:83)
    at $Proxy142.sendMessageAsync(Unknown Source)
    at com.bea.wli.sb.transports.LoadBalanceFailoverListener.sendMessageAsync(LoadBalanceFailoverListener.java:148)
    at com.bea.wli.sb.transports.LoadBalanceFailoverListener.sendMessageToServiceAsync(LoadBalanceFailoverListener.java:603)
    at com.bea.wli.sb.transports.LoadBalanceFailoverListener.sendMessageToService(LoadBalanceFailoverListener.java:538)
    at com.bea.wli.sb.transports.TransportManagerImpl.sendMessageToService(TransportManagerImpl.java:558)
    at com.bea.wli.sb.transports.TransportManagerImpl.sendMessageAsync(TransportManagerImpl.java:426)
    at com.bea.wli.sb.pipeline.PipelineContextImpl.doDispatch(PipelineContextImpl.java:670)
    at com.bea.wli.sb.pipeline.PipelineContextImpl.dispatchSync(PipelineContextImpl.java:551)
    at stages.transform.runtime.WsCalloutRuntimeStep$WsCalloutDispatcher.dispatch(WsCalloutRuntimeStep.java:1391)
    at stages.transform.runtime.WsCalloutRuntimeStep.processMessage(WsCalloutRuntimeStep.java:236)
    at com.bea.wli.sb.stages.StageMetadataImpl$WrapperRuntimeStep.processMessage(StageMetadataImpl.java:346)
    at com.bea.wli.sb.stages.impl.SequenceRuntimeStep.processMessage(SequenceRuntimeStep.java:33)
    at com.bea.wli.sb.pipeline.PipelineStage.processMessage(PipelineStage.java:84)
    at com.bea.wli.sb.pipeline.PipelineContextImpl.execute(PipelineContextImpl.java:1055)
    at com.bea.wli.sb.pipeline.Pipeline.processMessage(Pipeline.java:141)
    at com.bea.wli.sb.pipeline.PipelineContextImpl.execute(PipelineContextImpl.java:1055)
    at com.bea.wli.sb.pipeline.PipelineNode.doRequest(PipelineNode.java:55)
    at com.bea.wli.sb.pipeline.Node.processMessage(Node.java:67)
    at com.bea.wli.sb.pipeline.PipelineContextImpl.execute(PipelineContextImpl.java:1055)
    at com.bea.wli.sb.pipeline.Router.processMessage(Router.java:214)
    at com.bea.wli.sb.pipeline.MessageProcessor.processRequest(MessageProcessor.java:96)
    at com.bea.wli.sb.pipeline.RouterManager$1.run(RouterManager.java:593)
    at com.bea.wli.sb.pipeline.RouterManager$1.run(RouterManager.java:591)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
    at com.bea.wli.sb.security.WLSSecurityContextService.runAs(WLSSecurityContextService.java:55)
    at com.bea.wli.sb.pipeline.RouterManager.processMessage(RouterManager.java:590)
    at com.bea.wli.sb.transports.TransportManagerImpl.receiveMessage(TransportManagerImpl.java:375)
    at com.bea.wli.sb.transports.jca.binding.JCATransportInboundOperationBindingServiceImpl$4.run(JCATransportInboundOperationBindingServiceImpl.java:415)
    at com.bea.wli.sb.transports.jca.binding.JCATransportInboundOperationBindingServiceImpl$4.run(JCATransportInboundOperationBindingServiceImpl.java:413)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
    at weblogic.security.Security.runAs(Security.java:61)
    at com.bea.wli.sb.transports.jca.binding.JCATransportInboundOperationBindingServiceImpl.sendMessage(JCATransportInboundOperationBindingServiceImpl.java:413)
    at com.bea.wli.sb.transports.jca.binding.JCATransportInboundOperationBindingServiceImpl.invokeOneWay(JCATransportInboundOperationBindingServiceImpl.java:126)
    at com.bea.wli.sb.transports.jca.binding.JCAInboundRequestListener.post(JCAInboundRequestListener.java:39)
    at oracle.tip.adapter.sa.impl.inbound.JCAInboundListenerImpl.onMessage(JCAInboundListenerImpl.java:170)
    at oracle.tip.adapter.fw.jca.messageinflow.MessageEndpointImpl.onMessage(MessageEndpointImpl.java:502)
    at oracle.tip.adapter.file.inbound.Publisher.onMessageDelegate(Publisher.java:493)
    at oracle.tip.adapter.file.inbound.Publisher.publishMessage(Publisher.java:419)
    at oracle.tip.adapter.file.inbound.InboundTranslatorDelegate.xlate(InboundTranslatorDelegate.java:484)
    at oracle.tip.adapter.file.inbound.InboundTranslatorDelegate.doXlate(InboundTranslatorDelegate.java:121)
    at oracle.tip.adapter.file.inbound.ProcessorDelegate.doXlate(ProcessorDelegate.java:388)
    at oracle.tip.adapter.file.inbound.ProcessorDelegate.process(ProcessorDelegate.java:174)
    at oracle.tip.adapter.file.inbound.ProcessWork.run(ProcessWork.java:349)
    at weblogic.work.ContextWrap.run(ContextWrap.java:41)
    at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:528)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:176)
    Caused by: oracle.tip.adapter.sa.api.JCABindingException: oracle.tip.adapter.sa.impl.fw.ext.org.collaxa.thirdparty.apache.wsif.WSIFException: servicebus:/WSDL/wsdlPathAndName [ SynchRead_ptt::SynchRead(Empty,body) ] - WSIF JCA Execute of operation 'SynchRead' failed due to: No Data to process.
    No Data to process.
    File /root/oracle/domains/osb/11.1.1.4/cluster/data/osb2/FolderName/Filename.txt to be processed was not found or not available or has no content ; nested exception is:
    BINDING.JCA-11007
    No Data to process.
    No Data to process.
    File /root/oracle/domains/osb/11.1.1.4/cluster/data/osb2/FolderName/Filename.txt to be processed was not found or not available or has no content Please make sure that the file exists in the specified directory.
    at oracle.tip.adapter.sa.impl.JCABindingReferenceImpl.request(JCABindingReferenceImpl.java:259)
    at com.bea.wli.sb.transports.jca.binding.JCATransportOutboundOperationBindingServiceImpl.invoke(JCATransportOutboundOperationBindingServiceImpl.java:150)
    ... 56 more
    Caused by: oracle.tip.adapter.sa.impl.fw.ext.org.collaxa.thirdparty.apache.wsif.WSIFException: servicebus:/WSDL/wsdlPathAndName [ SynchRead_ptt::SynchRead(Empty,body) ] - WSIF JCA Execute of operation 'SynchRead' failed due to: No Data to process.
    No Data to process.
    File /root/oracle/domains/osb/11.1.1.4/cluster/data/osb2/FolderName/Filename.txt to be processed was not found or not available or has no content ; nested exception is:
    BINDING.JCA-11007
    No Data to process.
    No Data to process.
    File /root/oracle/domains/osb/11.1.1.4/cluster/data/osb2/FolderName/Filename.txt to be processed was not found or not available or has no content Please make sure that the file exists in the specified directory.
    at oracle.tip.adapter.sa.impl.fw.wsif.jca.WSIFOperation_JCA.performOperation(WSIFOperation_JCA.java:662)
    at oracle.tip.adapter.sa.impl.fw.wsif.jca.WSIFOperation_JCA.executeOperation(WSIFOperation_JCA.java:353)
    at oracle.tip.adapter.sa.impl.fw.wsif.jca.WSIFOperation_JCA.executeRequestResponseOperation(WSIFOperation_JCA.java:312)
    at oracle.tip.adapter.sa.impl.JCABindingReferenceImpl.invokeWsifProvider(JCABindingReferenceImpl.java:350)
    at oracle.tip.adapter.sa.impl.JCABindingReferenceImpl.request(JCABindingReferenceImpl.java:253)
    ... 57 more
    Caused by: BINDING.JCA-11007
    No Data to process.
    No Data to process.
    File /root/oracle/domains/osb/11.1.1.4/cluster/data/osb2/FolderName/Filename.txt to be processed was not found or not available or has no content Please make sure that the file exists in the specified directory.
    at oracle.tip.adapter.file.outbound.FileReader.readFile(FileReader.java:277)
    at oracle.tip.adapter.file.outbound.FileReader.executeFileRead(FileReader.java:181)
    at oracle.tip.adapter.file.outbound.FileInteraction.executeFileRead(FileInteraction.java:331)
    at oracle.tip.adapter.file.outbound.FileInteraction.execute(FileInteraction.java:395)
    at oracle.tip.adapter.sa.impl.fw.wsif.jca.WSIFOperation_JCA.performOperation(WSIFOperation_JCA.java:529)
    ... 61 more
    Edited by: 842347 on Jul 6, 2011 3:11 AM

    I face the same issue and I have given all permissions to the folder for OS user.
    Because of this error my server is not starting up . Is there any way I can undeploy this composite to get my server running.
    I cant do this from EM because SOA server is failing to start up.
    I have tried removing it from $DOMAIN_HOME/deployed-composites but still when i try restarting the soa server the composite comes up there. Do we need to delete the entry some where else too. Kindly help.
    Thanks,
    Sri.

  • Synchronous File Read in a High Availability Scenario

    Hi All,
    We have Oracle SOA Suite 10.1.3.4 which is a High Availability instance. As per Oracle's doc Id 730515.1 we have edited the bpel.xml file with the property for Adapter cluster only in the cases where a BPEL process was polling for a file and instantiating the process to avoid the race around condition.
    However, we have not made this change for BPEL process which contain a synchronous read. As I understand, such processes(which contain a synchronous read) are already instantiated before the file is read and hence the race around scenario does not exist.
    Please correct me if my understanding is incorrect. Also, will I need to make any changes for the process in such a case.
    Thanks and regards.

    Hi Marcio,
    The Oracle Document I mentioned available on Metalink states:
    +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    Applies to:
    Oracle9i AS Integration Platform - Version: 10.1.3.3
    Information in this document applies to any platform.
    Goal
    You have installed BPEL cluster. However, you expect that adapters doing the same work on two different nodes might encounter a race condition. So you would like to configure a singleton adapter. This note describes how to do it.
    Solution
    1. In collaxa-config.xml change from
    <property id="clusterName">
    <name>Cluster Id</name>
    <value>machine_name:port</value>
    <comment>
    to
    <property id="clusterName">
    <name>Cluster Id</name>
    <value>bpelCluster</value>
    <comment>
    The value: 'bpelCluster'
    can be anything but has to be the same on both instances.
    2. Multicast host and port in jgroups-properties.xml have to be same on both instances.
    3. To enable a singleton adapter add the following property in bpel.xml of the process using the adapter in question:
    <property name="clusterGroupId">adapterCluster</property>
    where the actual value - 'adapterCluster' in this case can be anything but has to be different from the value used before (bpelCluster) when configuring BPEL cluster. The reason for that is that BPEL engine and an adapter will use different communication channels.
    +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    I would Like to know if this is applicable incase we have a BPEL Process which contains a synchronous read.
    Thanks and Regards.

  • Text file reading and writing problem

    Hello ! i am working on an electronic diary project and i am using Netbeans for that... i have finished all the rest but i am stuck into the saving of the appointments which i have been making.. i am using text files to save the entries ...what i am doing currently is that i am creating a file of every date which a user selects in the combobox.but if i want to add more appointment on the same date , then it overwries the previous one. i need to write something which can store multiple appointments in the same file.
    the writing code is:
    try {
    String aa = jTextField1.getText();
    String ab = jTextField2.getText();
    String ac =(String)jComboBox2.getSelectedItem();
    String ad =(String)jComboBox3.getSelectedItem();
    String ae = jTextField5.getText();
    String af =(String)jComboBox1.getSelectedItem();
    String ag = jTextArea1.getText();
    String outputFileName = ab+ac+ad+".txt";
    FileWriter outputFileReader = new FileWriter(outputFileName);
    PrintWriter outputStream = new PrintWriter(outputFileReader);
    PrintWriter outputStream1 = new PrintWriter(outputFileReader);
    PrintWriter outputStream2 = new PrintWriter(outputFileReader);
    PrintWriter outputStream22 = new PrintWriter(outputFileReader);
    PrintWriter outputStream3 = new PrintWriter(outputFileReader);
    outputStream.write(aa);
    outputStream1.write(ae);
    outputStream2.write(af);
    outputStream3.write(ag);
    outputStream.close();
    } catch (IOException e) {
    System.out.println("IOException:");
    e.printStackTrace();
    when i read the code , it doesnot reads the one which i store the text in new line...
    thanks

    Hi Dear
    Actually apending in your file is False so that it is overwriting this. do one thing open append option then it will add your data. for this just user true as the parameter with file name as i write in the below line. bedefault overwriting is false. you have to make this true.
    BufferedWriter out = new BufferedWriter(new FileWriter("Out.csv",true));
    try this your problem will solve.

  • Dynamic file path with Synchonous File Read

    Hello,
    I have a scenario where there are multiple files in multiple directories that I need to read in using a synchonous file read. The directory paths are all different, but the files are all .txt files.
    1. How can I filter (i.e. *.txt) the files using a synchronous file read. It doesn't give me that option in the wizard.
    2. I already have the directory paths, but I need to assign that path string to the file adapter call out. The wizard states that I have to specify the path. Can this be done using an assign or something like that? Inbound Header? And if so how?
    Any help is greatly appreciated.

    Hi,
    1 - if not possible....you cannot set filter for synchronous read.
    2 - you can create outbound header for file adapters, change the outbound header xsd to include one more element "directory".
    close bpel project re-open it and you can then assign it runtime. That should work. I am quite positve about this.
    Dipal

  • Problem With File Reading And Sorting

    I'm having problems with a particular task. Here is what I have to do:
    Write a program which reads 100 integers from a file. Store these integers
    in an array in the order in whcih they are read. Print them to the screen.
    Sort the integers in place using bubble sort. Print the sorted array to the
    screen. Now implement the sieve of Eratosthenes to place all prime numbers
    in an ArrayList. Print that list to the screen.
    Here is the code I have so far:
    import java.util.ArrayList;
    import java.io.*;
    public class Eratosthenes
        private ArrayList numbers;
        private String inputfile1 = "numbers.txt";
        public Eratosthenes()
            numbers = new ArrayList();
        public void readData()
            try {
                BufferedReader reader = new BufferedReader(new FileReader(inputfile1));
                for(int i = 1; i <= 100; i++) {
                    String temp = reader.readLine();
                    numbers.add();
            catch(Exception e)
    This is the file reading part I have done but it doesn't recognise the line numbers.add() . It brings up the error - 'Cannot resolve symbol - method add(). Thats the first problem I have, can anyone see any way to fix it and to achieve the task. Also can someone help with the structure of a bubble sort method and a sieve of Eratosthenes method as I have no clue whatsoever. Any help will be greatly appreciated.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Ok, I've done that but I'm having another problem. When I'm printing an output to the screen, it prints 100 lines of integers and not 1 line of 100 integers. Can you see the problem in the code that is doing this?
    import java.util.ArrayList;
    import java.io.*;
    public class Eratosthenes
        private ArrayList numbers;
        private String inputfile1 = "numbers.txt";
        public Eratosthenes()
            numbers = new ArrayList();
        public void readData()
            try {
                BufferedReader reader = new BufferedReader(new FileReader(inputfile1));
                for(int i = 1; i <= 100; i++) {
                    String temp = reader.readLine();
                    numbers.add(temp);
                    System.out.println(numbers);
            catch(Exception e)
    }

  • Invoking Composite from BPMN with file read operation

    hello,
    I have a composite which does a simple file read and dumps data to database using mediator.
    right now composite gets kicked off by presence of a file in a directory.
    I would like to invoke this composite from a BPMN process, unfortunately because of nature of file adapter created through composite, jdeveloper doesn't expose the FileAdapter read operation as WSDL so I cannot create a service task out of it.
    How can I invoke composite directly without having to create a file adapter at the BPMN level and take care of transforming the records to DB adapter?
    thanks.

    As you guess, it is stored in the PSD, but only with the Maximise Compatibility switch. Without that switch, a dummy image is stored which has the text "This layered Photoshop file was not saved with a composite image.", in English, German, Japanese and French.
    My program
    psdparse extracts each layer in an 8-bit file as a PNG, and the merged image for both 8- and 16-bit files. That link is to a Subversion repository containing source code.

  • Simple File Reading problem

    hi guys,
    i have a GUI that executes a certain program based on user inputs. In order to execute the program, the GUI has to edit a text file with a single line in it. the line is provided by user thru GUI. the executable program uses this text file as input, call it input.txt. When I run the program once, everything works fine. But if i use the same GUI to run the program again (without closing the GUI window) with different user input, the program does not run. I check input.txt and I find that the GUI was succesfully able to make the changes the user wanted. I use the simple readline method to read the file as follows:
    BufferedReader reader = new BufferedReader(new FileReader("input.txt"));
    String curStr = null;
    while ((curStr = reader.readLine()) != null) {
      String url = curStr.trim();
      if (addPage(url))
        blah
      else
        blah             
    }addPage(url) complains that the string url is null! Does anyone know what could be the problem.

    You aren't executing that code.
    It is impossible to enter the while-loop if curStr is
    null, because the loop condition says not to. And
    since curStr is not null, then curStr.trim() cannot be
    null either.hmmmm .... the problem is that the print statements indicate that addPage is executed for sure!!! the addPage function does this:
    if (url != null)
      do something
      return true;
    return false;as far as adding more print statements is concerned I can't do that cuz I do not have access to certain source files needed for compiling this one. (I already have the pre-compiled version of this file).

  • Problem in java.io.file reading

    Hi
    I have a servlet and it calls some classes which are kept in a jar file in WEB-INF/lib directory. With in one of the classes there is a IO file read happening. How should i read the file and what path should i put if the file is in WEB-INF/resources
    my jar files are in web-inf/lib directory. How will i read the file and what should be the patch to be given
    regards,
    Sujesh

    Hi Sujesh,
    you can use getResource(path) or getResourceAsStream, see http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/ServletContext.html
    See http://www.slamb.org/projects/axamol/sql-library/manual/ch01s03.html for an example.
    Hope it helps
    Detlev

  • FileLock vs. synchronized(file)

    Hi,
    In a web app I have a servlet that writes several files to disk if they don't already exist--a cache. I have enclosed the write operation in a synchronized block like the following to prevent collisions:
    File outFile = new File("file.txt");
    FileOutputStream out;
    synchronized (outFile) {
    out = new FileOutputStream(outFile);
    [write stuff to stream];
    out.close();
    It dawned on me that maybe I should be locking the file instead of using the synchronized block, however, no other application, or servlet for that matter, would ever write these files. Also, the way my web app is structured, it's impossible that another servlet would try to read the files unless they already have been written (otherwise the writing servlet is invoked and the worst case is that the second, slightly later thread, re-writes the exact same file--not really a problem).
    What are the considerations?
    At what moment would a test for the existence of the file from another thread return true--at the completion of "out.close();"? I hope so, or that will be a problem for threads trying to read the incomplete file.
    Thanks.

    Hiya. What I would do is have a counter
    int read_access_count; // This would be 0 or higher.
    boolean file_blocked // true or false
    Every time someone opens the file for reading the read_access_count gets incremented by one, and when someone finishes reading the file it goes down by one.
    So when someone wants to write to the file they first make sure read_access_count is 0. If read_access_count is say for example 5, then the thread marks the file_blocked as true and waits for the read_access_count to go to 0. Once 0 it opens the file and writes to it. Then it finishes and sets file_blocked to false. Now all the files waiting to read can read and increment read_access_count by one again.
    A thread that wants to read the file must check file_blocked to make sure it isn't true. This prevents reading incomplete files and all sorts of situations.
    And you are correct to use synchronization in the methods controlling these variables, read_access_count and file_blocked.

  • Mdworker deny file-read-data, what does it really mean?

    I get numerous log posts like this:
    3/17/14 7:22:57.561 AM sandboxd[5688]: ([4412]) mdworker(4412) deny file-read-data /Volumes/Time Machine Backups/Backups.backupdb/Jack Shelton’s iMac/2014-03-17-042247/JackHD/System/Library/Fonts/TimesLTMM (import fstype:hfs fsflag:4809018 flags:48200000056 diag:0 uti:com.apple.font-suitcase plugin:/Library/Spotlight/Font.mdimporter - find suspect file using: sudo mdutil -t 235288)
    My questiions are:
    What is being sandboxed, the mdworker or the file Times LTMM or the mdimporter?
    Which one has the sudo command in it?
    What does the -t flag/option mean?  Looking it up via man mdutil in the terminal, it does't exist.
    I saw this type of post quite frequently in Mavericks so much so that I decided to start over from scratch.  I wiped the HD including the HD Recovery partition and installed OS X 10.6.8.  I am now in Mountain Lion and have reinstalled MS Office 2011 and loaded the main identity data from my recovered files.  I did not see any adverse log posts until I ran the first time machine backup.
    I hope someone can clear the air for me with perhaps a way to fix it.

    Thank you Baltwo.  It's a major relief to know that the sudo command is being used by an Apple app/process and not by a file that's not supposed to have it..  However a few more questions if you don't mind.
    Is the font file the suspect file or is it this particular mdworker?
    If the font file is the suspect file will a process or app that calls for it be allowed to use it?
    Which process/app/file invoked the sandbox and deny file-read-data?
    What is the role of the mdimporter?
    These questions are part of my attempt to understand how a large part of the files on my computer and Time Machine become corrupted when I first installed Mavericks.  Mainly .plist (and other plain text files), .png, jpeg (and other picture types) and pkg info bundles would have thier icons and file Kind changed to Unix Executable files, spreadssheets and doc/docx would become genrandom (or something similar).  I became aware of this when my machine began freezing up.  I made several clean reinstalls and the problems would reoccur on plugging in the Time Machine.  I eventually recovered the files I wanted from the Time Machine but I had to use another iMac with an older OS X.  I repartitioned my machine and rebuilt it to Mountain Lion and i'm in the process of reloading with what I hope are non corrupted files. Although I still see log posts like "Locum[6230]: Connection with distnoted server was invalidated" every time I paste a folder or file.  I don't know what that means but it doesn't seem to cause any further reaction or posts.
    My apologizes for bothering you with alll this and thanks for your insight.

  • I am using itunes 10 and trying to consolidate my files.  I keep getting the error "Copying files failed.  The file name was invalid or too long".  How can I indentify what file is causing this problem or resolve this issue?

    I am using itunes 10 and trying to consolidate my files.  I keep getting the error "Copying files failed.  The file name was invalid or too long".  How can I indentify what file is causing this problem or resolve this issue?

    BUMP
    Yes, I just get that message. I don't see how I could investigate this problem.
    I didn't mention that this happened when I was consolidating my library, not copying files to another computer.
    In other words, I'm using a "normal" itunes procedure, itunes won't complete it, and won't tell me exactly why or how to figure out how to fix it...
    Is there at least some easy way to tell which files were successfully copied to my itunes music folder so I can work on moving the uncopied files?
    Can anybody help me?

  • When i try to install iPlanet App Server on NT, I do not get screen to enter license key valid for evaluation. --- " cache File Read error"

    When i try to install iPlanet App Server on NT, I do not get screen to enter license key valid for evaluation.
    Also during installation screens an error window is displayed saying "cache File Read error -- Could not read ProductKey entry from the cache file "

    Hi,
    I also get the following message:
    "Could not read ProductKey entry from the cache file"
    I have no idea how to provide the installation software with the key. I also tried "keycheck.exe"
    Do you have a solution for this problem? Did you finish the installation?
    Christian

  • Dear ladies and gentlemen! I recently received on my notebook, operating system 8.1, the message "Adobe Acrobat is no longer working properly". I also found myself that I can copy from einerPDF file excerpts not without problems in another document. My Ad

    Dear ladies and gentlemen!
    I recently received on my notebook, operating system 8.1, the message "Adobe Acrobat is no longer working properly". I also found myself that I can copy from einerPDF file excerpts not without problems in another document. My Adobe Acrobat 9 Pro has released version 9.0.0. Two updates this version is not listed. Please inform me how I can fix this problem.
    Sincerely, Walter Hacksteiner
    mailto: [email protected]

    The first thing I would try is to update Acrobat 9 to the latest version 9.5.5
    The next thing would be to run Acrobat 9 in Windows 7 or Vista or XP Compatibility Mode.

  • A serious issue with excel file read in ODI

    hi gurus,
    Issue with excel file read is that we can read only one file by setting the path from ODBC Data Source Administrator-->System DNS -->Select Work book
    what i want to read the dynamic path(Every time I cant go back and set the Work book to select the excel file..
    So i came up with a solution to write a Vbscript that convert the excel to csv my problem got solved for dynamic paths the script is as follow:
    Set objArgs = WScript.Arguments
    For I = 0 to objArgs.Count - 1
    FullName = objArgs(I)
    FileName = Left(objArgs(I), InstrRev(objArgs(I), ".") )
    Set objExcel = CreateObject("Excel.application")
    set objExcelBook = objExcel.Workbooks.Open(FullName)
    objExcel.application.visible=false
    objExcel.application.displayalerts=false
    objExcelBook.SaveAs FileName & "csv",23
    objExcel.Application.Quit
    objExcel.Quit
    Set objExcel = Nothing
    set objExcelBook = Nothing
    Next
    Now this script convert the xls file to csv with comma seprated values
    e.g in excel sheet if data is ABC XYZ PQR
    csv will come with ABC,XYZ,PQR
    here the delimiter is , i want the delimiter as pipe | who's ascii code is 124
    but if i change 23 with 124 its not working i getting the error cannot save as...
    can anyone tell me that what should be the correct code for pipe
    so that the output is ABC|XYZ|PQR
    AS WE CAN USE THE SCRIPTS IN TOOLS
    Edited by: 789141 on Sep 14, 2010 11:33 PM

    I dont have the answer for your question but i have different approach in handling multiple Excel File.
    Step 1. Copy a sample source Excel File and Call it Final.xls .
    Step 2. Map this Final.xls to DSN and in Topology call this Final.xls
    Step 3. Do the Reversing and Map and test the Interface . Once its done.
    Step 4. Create a Package and using a http://odiexperts.com/?p=1426 get the list of all the Excel File
    Step 5 . Using this http://odiexperts.com/?p=273 create a Loop to Read the Excel File name
    Step 6 . Copy using OdiFileCopy to Final.xls and run your interface .
    Step 7. Increment the Loop and copy your next File for Final and run the interface
    Step 8 . Finally you will be able to read all the Excel File .
    Step 9 . Delete the source file [ Optional ]
    Hope this helps.

Maybe you are looking for