Nonblocking channel serialization

Hi!! I try to send an object (a class that I created) using nonblocking Java 1.4.1 channels, but when I create the ImputObjectStream for deserialize, an interruption (IllegalBlockingMode) is throws. Why? How I use serialization method (like InputObjectStream.read()) with nonblocking channels and serversockets?

Hello U063667, I'm read the post, but I don't understand very well how to do that. Can you send me a working example? Post it or send me an mail. My e-mail is [email protected] Thanks in advance.

Similar Messages

  • Nonblocking I/O  & serialization

    Hi!! I try to send an object (a class that I created) using nonblocking Java 1.4.1 channels, but when I create the ImputObjectStream for deserialize, an interruption (IllegalBlockingMode) is throws. Why? How I use serialization method (like InputObjectStream.read()) with nonblocking channels and serversockets?

    write the object in a bytearrayoutputstream
    put the data with toByteArray in a ByteBuffer and use
    socketchannel.send(bytebuffer)Yes - it's difficult to see how a solution for the output side is going to have any impact on the problem faced on the input side.
    Even if he uses a similar approach on the input side, the OP is constructing a byte array containing serialized data, but he doesn't know when it's complete.
    Sylvia.

  • IDOC serialization

    Hi Experts,
    I am doing the scenario file->PI->ECC.
    I would like to know how can we do the IDOC serialization (Object channel serialization) .
    In my case we need to ensures that documents are processed in the receiving system in exactly the same sequence in which they were created in the sending system.
    As per the note 752194 the Object channel serialization will best suite my requirement.But how can i achieve when i am sending the IDOC xml from PI--> ECC.
    I want to know what are the settings we need to do in XI and ECC??
    Do we need to generate channel number in XI..?? if so how??
    If i want to do for orders IDOC...what we need to do BD105 and BD104 transactions.??
    Where we need to call ALE_SERIAL_KEY2CHANNEL function module..??
    Note: I dont want the serialization for ECC--> XI

    Please post this in PI forums
    Anil

  • Trigger IDOC ACC_DOCUMENT

    Hi all,
    i trying to set up an Outbound scenario for Accounting documents.The idea is to send to an external system the idoc ACC_DOCUMENT03 that is associated to message type ACC_DOCUMENT.
    When configuring the ALE distribution model (BD64) i tried to add the message type ACC_DOCUMENT but that not possible since this kind of information should be done using BAPI and not message type (SAP message information).
    So, did all the customizing needed for associate the correct BO (correspondent Bussiness Object BUS6035) and the method POST.Also customized the obj. channel serialization
    Still, at this moment my dificulty is to trigger the IDOC creation. Is there any way of doing it automatically? Our i need to use a developed abap program (BADI or user-exit) or even workflow? I'm trying to avoid writting code for this scenario. I was hopping that something like the Change Pointers exist's for this kind of information/scenario.
    Can any one give a suggestion??
    Thanks for your time,
    Best Regards,
    Pedro

    It seems that SAP does not provide outbound ACC_DOCUMENT03. In [this thread|Example program - posting accounting document,  Idoc ( ACC_DOCUMENT );, Miroslaw shows an abap program which generates the ACC_DOCUMENT03 idoc. If it works, also reply to him.

  • NIO first problems

    Hi guys,
    I experience very strange problem. Once a new connection is established and the key for the channel is registered for READ operations, the selector starts to continuosly provide me with the key having OP_READ set up:
    if (selector.select() == 0)
        continue;
    Iterator<SelectionKey> it = selector.selectedKeys().iterator();
    while (it.hasNext())
        SelectionKey key = (SelectionKey) it.next();
        // Accept new connection
        if (key.isAcceptable())
            ServerSocketChannel server = (ServerSocketChannel) key.channel();
            SocketChannel channel = server.accept();
            if (channel == null)
                continue;
            // Set the new channel nonblocking
            channel.configureBlocking(false);
            // Register it with the selector
            SelectionKey newKey = channel.register(selector, SelectionKey.OP_READ);
            // initialization of attachment ...
        if (key.isReadable())
            System.out.print("session index = "  +((ConnectionDescriptor)key.attachment()).session.sessionIndex);+
    +System.out.print(", counter "+  ++counter);+
    +System.out.println(", ops="+  key.readyOps());                   
            // read the data from channel
            if( counter == 10 ) {
                setEnabled(false);
                break;
        it.remove();
    }I use a python script in order to test the server:
    import socket
    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    s.connect("localhost", 28000)
    s.send(b'\x00\x01')
    s.close()When I run the script I see the following output from the server:
    session index = 1, counter 1, ops=1
    session index = 1, counter 2, ops=1
    session index = 1, counter 3, ops=1
    header limit = 2
    body limit = 0
    process message 1
    session index = 1, counter 4, ops=1
    session index = 1, counter 5, ops=1
    session index = 1, counter 6, ops=1
    session index = 1, counter 7, ops=1
    session index = 1, counter 8, ops=1
    session index = 1, counter 9, ops=1
    session index = 1, counter 10, ops=1some parts of the code are omitted in order to keep it clear. If I do not stop it at 10th iteration it runs into endless loop.
    Why the key always says that the channel is "ready" to be read while I actually have already read the data?
    Thanks a lot in advance.
    Edited by: coderman on Jan 28, 2010 5:44 AM

    This is an example class you can reproduce the issue with:
    import java.io.IOException;
    import java.net.InetSocketAddress;
    import java.net.ServerSocket;
    import java.nio.ByteBuffer;
    import java.nio.channels.ClosedChannelException;
    import java.nio.channels.SelectionKey;
    import java.nio.channels.Selector;
    import java.nio.channels.ServerSocketChannel;
    import java.nio.channels.SocketChannel;
    import java.util.Collection;
    import java.util.Iterator;
    public class MyServer
        private Selector selector;
        private int sessionSequence;
        public MyServer() throws IOException
            final ServerSocketChannel mainServerChannel = ServerSocketChannel.open();
            ServerSocket mainSocket = mainServerChannel.socket();
            mainSocket.bind(new InetSocketAddress(28000));
            mainServerChannel.configureBlocking(false);
            selector = Selector.open();
            mainServerChannel.register(selector, SelectionKey.OP_ACCEPT);
            int counter = 0;
            while (true)
                if (selector.select(1000) == 0)
                    continue;
                Iterator<SelectionKey> it = selector.selectedKeys().iterator();
                while (it.hasNext())
                    SelectionKey key = (SelectionKey) it.next();
                    if (key.isAcceptable())
                        ServerSocketChannel server = (ServerSocketChannel) key.channel();
                        SocketChannel channel = server.accept();
                        if (channel == null)
                            continue;
                        channel.configureBlocking(false);
                        SelectionKey newKey = channel.register(selector, SelectionKey.OP_READ );
                    if (key.isReadable())
                        System.out.print("counter " + counter);
                        System.out.print(", ops=" + key.readyOps());
                        ByteBuffer header = ByteBuffer.allocateDirect(10);
                        try
                            ((SocketChannel) key.channel()).read(header);
                        } catch (ClosedChannelException cce)
                            // the channel has been closed by the server
                        } catch (IOException ex)
                            // networking problem. Might be also connection lost.
                        header.flip();
                        System.out.println(", header limit = " + header.limit());
                        if (++counter == 15)
                            System.exit(0);
                    it.remove();
        public static void main(String[] argv)
            try
                new MyServer();
            } catch (IOException ex)
                ex.printStackTrace();
    }Here is the python script:
    import socket
    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    s.connect(("localhost", 28000))
    s.send(b'\x00\x01\x02')
    s.shutdown(1)This is what I get on my computer:
    counter 0, ops=1, header limit = 3
    counter 1, ops=1, header limit = 0
    counter 2, ops=1, header limit = 0
    counter 3, ops=1, header limit = 0
    counter 4, ops=1, header limit = 0
    counter 5, ops=1, header limit = 0
    counter 6, ops=1, header limit = 0
    counter 7, ops=1, header limit = 0
    counter 8, ops=1, header limit = 0
    counter 9, ops=1, header limit = 0
    counter 10, ops=1, header limit = 0
    counter 11, ops=1, header limit = 0
    counter 12, ops=1, header limit = 0
    counter 13, ops=1, header limit = 0
    counter 14, ops=1, header limit = 0

  • Serialization + Non-blocking IO + Channels ?

    Hi,
    I use a lot of object serialization. The serialized objects can be big. I would like to transform my server to make it non-blocking so that I don't have to use one thread per connection.
    Do I have to use channels if I want non-blocking IO?
    If yes, how can I achieve object serialization?
    The code below seems to work for small objects, but not for bigger ones (5 Kb, for example). I believe it is due to the fact that the whole object is not read at once by the channel. If so, how can I determine that an object is fully read before desializing it?
    Should I take another appoach?
    Thnaks.
    byte[] byts = new byte[ buffer.remaining() ];
    buffer.get( byts );
    ByteArrayInputStream bais = new ByteArrayInputStream( byts );
    ObjectInputStream ois = new ObjectInputStream( bais );
    Object myObject = ois.readObject();

    Hi,
    It might be a good solution to zip the ObjectStream and the UnZip it when you read from the stream.
    This will decrease the size of the objects alot.
    /Richard

  • Session Replication doesn't work when using a custom Unicast Channel

    Hello!
    After configure a WLS Cluster for an WebApp with session replication support enabled I faced some issues with cluster configuration.
    My LAB env used for this configurations is:
    One Solaris 10 SPARC box.
    -- One WLS 11g (10.3.6) domain with:
    ---- 4 Managed servers:
    ---- Admin server
    ---- server-1
    ---- server-2
    ---- Proxy Server (HttpClusterServlet)
    --- 1 Cluster composed by:
    ---- server-1
    ---- server-2In that setup I noticed if I define a custom network channel for servers ( server>protocols>channels ) in the cluster and set Cluster Messaging Mode as Unicast* in the Cluster config ( Cluster>Configuration>Messaging>Messaging Mode ), so the session state replication does not work.
    When I enable the cluster replication debug for managed servers the following messages appears:
    <> <> <1358966729933> <BEA-000000> <[roid:-1772481434088297851] Creating primary for application key /webapp>
    ####<Jan 23, 2013 4:45:29 PM BRST> <Debug> <ReplicationDetails> <de25503> <server-1> <[ACTIVE] ExecuteThread: '5' for queue: > 'weblogic.kernel.Default (self-tuning)'> <<ano
    nymous>> <> <> <1358966729958> <BEA-000000> *<Has secondary servers? false>*
    ####<Jan 23, 2013 4:45:29 PM BRST> <Debug> <ReplicationDetails> <de25503> <server-1> <[ACTIVE] ExecuteThread: '5' for queue: >'weblogic.kernel.Default (self-tuning)'> <<ano
    nymous>> <> <> <1358966729959> <BEA-000000> *<Current secondary server? null>*
    ####<Jan 23, 2013 4:45:29 PM BRST> <Debug> <Replication> <de25503> <server-1> <[ACTIVE] ExecuteThread: '5' for queue: >'weblogic.kernel.Default (self-tuning)'> <<anonymous>
    <> <> <1358966729959> <BEA-000000> <[roid:-1772481434088297851] Unable to create secondary on null>
    ####<Jan 23, 2013 4:45:31 PM BRST> <Debug> <ReplicationDetails> <de25503> <server-1> <[ACTIVE] ExecuteThread: '5' for queue: >'weblogic.kernel.Default (self-tuning)'> After eliminate all possible issues with my webapp (serialization, weblogic descriptor configuration, etc) and try many cluster network configurations I noticed that this problem only occurs when I use Unicast for Cluster's Messaging.
    At the end of the day I really would like to understand why the session replication only works for Cluster's Messaging using Multicast mode. I read a lot the WLS docs (specifically the cluster/network topics) [1][2], but I can't find an official explanation about this.
    Can someone help me understand this behavior?
    Many thanks.
    [1] http://docs.oracle.com/cd/E15523_01/web.1111/e13701/network.htm
    [2] http://docs.oracle.com/cd/E15523_01/web.1111/e13709/setup.htm

    I have Fluxbox started with Slim and .xinitrc. Dbus works only with:
    exec ck-launch-session startfluxbox
    you need run Openbox with ck-launch-session:
    exec ck-launch-session openbox-session
    Bye!!

  • How to use channel with sockets?

    Hello
    i am impleme3nted a sinple client/server application. The serv handles multiple connection via multithread(one thread per connection). Here is my code
    private void listen(int port) throws IOException {
    ss = new ServerSocket(port); // Create the ServerSocket
    System.out.println("Listening on " + ss);
    while (true) {
    Socket s = ss.accept(); // Grab the next incoming connection
    //s.setKeepAlive(true);
    System.out.println("Connection from " + s);
    // Create a DataOutputStream for writing data to the other side
    //dout = new ObjectOutputStream(s.getOutputStream());
    // dout.useProtocolVersion(ObjectOutputStream.PROTOCOL_VERSION_1);
    Thread clientThread =new ServerThread(s); // Create a new thread for this
    clientThread.start();
    // connection
    My client and server exchange object(serializable). How can i change this in order to add the ServerSocketChannel feature so that one thread deals with many connection?
    thanks a lot
    sebastien

    Hi, yes i have seen that document
    but i don't really know how i cna use it to update my code with channel feature.
    how can we do, please provide me an update of my previously posted code. I would be so thankful.
    thanks a lot
    sebastien

  • What is the serialization concept in ALE/IDOC?

    what is the serialization concept in ALE/IDOC?

    Hi Srinu ,
    IDoc Serialization means, sending/posting the idocs in sequence.
    We serialize IDocs in the following cases:
    · If you want the Integration Server to process the corresponding IDoc XML messages in the same sequence that it receives them from the IDoc adapter at the inbound channel.
    · If you want the receiver to receive the IDocs in the same sequence that the IDoc adapter sends them at the Integration Server outbound channel.
    The sequence at the Integration Server inbound or outbound channel can only be guaranteed if only IDocs are processed, and not if different protocols (for example, IDocs and proxies) are processed together.
    Do not confuse IDoc serialization using the IDoc adapter with the ALE serialization of IDocs.
    Prerequisites
    · The quality of service EOIO (Exactly Once In Order) must be specified in the message header.
    · The receiver system or the sender system must be based on SAP Web Application Server 6.40 or higher. If this is not the case, the quality of service is automatically changed to EO for compatibility reasons and the message is processed accordingly.
    Procedure
    If you want the Integration Server to process the IDoc XML messages created by the IDoc adapter in the same sequence that the IDocs are sent by your application, proceed as follows:
    · Enter a queue name in your application. You can use 16 alphanumeric characters. The prefix SAP_ALE_ is then added.
    The IDoc adapter checks the prefix and replaces it with the prefix of the corresponding Integration Server inbound queue (for example, XBQI0000).
    If you want the receiver to receive the IDocs in the same sequence that they are sent by the Integration Server using the IDoc adapter, proceed as follows:
    · In the communication channel, select the check box Queue processing for the receiver.
    The IDoc adapter replaces the prefix of the outbound queue (XBQO) with the prefix SAP_ALE_.
    You can display the individual messages in the qRFC monitor of the outbound queue. To do this, do one of the following:
    ¡ Use the queue ID in the list of displayed messages in the monitor for processed XML messages.
    ¡ Use the transaction ID in the list of displayed XML messages in the IDoc adapter.
    ¡ Call the transaction qRFC Monitor (Outbound Queue)(SMQ1).
    To navigate directly to the display of messages in the IDoc adapter, double click the transaction ID of a message in the outbound queue.
    To do this, you must have registered the display program IDX_SHOW_MESSAGE for the outbound queue in the qRFC administration (transaction SMQE) beforehand.
    In both cases, the function module IDOC_INBOUND_IN_QUEUE is called, which enables EOIO processing of the messages. The processing sequence is determined by the sequence of the function module calls.
    Unlike the other function modules (interface versions from the communication channel), with this function module you have to transfer segment types rather than segment names in the data records.
    Serialization of Messages
    Use
    Serialization plays an important role in distributing interdependent objects, especially when master data is being distributed.
    IDocs can be created, sent and posted in a specified order by distributing message types serially.
    Errors can then be avoided when processing inbound IDocs.
    Interdependent messages can be serially distributed in the following ways:
    Serialization by Object Type
    Serialization by Message Type
    Serialization at IDoc Level
    (not for IDocs from generated BAPI-ALE interfaces)
    Serialization at IDoc Level
    Use
    Delays in transferring IDocs may result in an IDoc containing data belonging to a specific object arriving at its destination before an "older" IDoc that contains different data belonging to the same object. Applications can use the ALE Serialization API to specify the order IDocs of the same message type are processed in and to prevent old IDocs from being posted if processing is repeated.
    SAP recommends that you regularly schedule program RBDSRCLR to clean up table BDSER (old time stamp).
    Prerequisites
    IDocs generated by BAPI interfaces cannot be serialized at IDoc level because the function module for inbound processing does not use the ALE Serialization API.
    Features
    ALE provides two function modules to serialize IDocs which the posting function module has to invoke:
    · IDOC_SERIALIZATION_CHECK
    checks the time stamps in the serialization field of the IDoc header.
    · IDOC_SERIAL_POST
    updates the serialization table.
    Check the following link:
    http://help.sap.com/saphelp_nw04s/helpdata/en/0b/2a66d6507d11d18ee90000e8366fc2/frameset.htm
    http://help.sap.com/saphelp_nw04s/helpdata/en/78/2175a751ce11d189570000e829fbbd/frameset.htm
    Ex: ADRMAS, DEBMAS(customer)
    ADRMAS, CREMAS(Vendor)
    In this case, Before posting Customer Data or Vendor Data it requires Address Data.
    Rgds
    Sree m

  • Specifying queue name in SOAP sender channel

    Hi
      We are on XI 3.0 SP18 - I have a requirement in which a soap webservice exposed out of the XI box - is to be called in an asynchronous mode - the webservice posts - document onto R/3 using an ABAP server proxy.
    Now, there is also a need to post documents onto R3 - by serializing through an object key - material number ( say updates to a material ). I saw that there is a queue name in the soap sender channel setting when I choose eoio - qos . Is this queue name static ?
    Also, any suggestions on how I can serialize the calls to the webservice based on an object key ( material number is supplied by the soap client ) all the way to R3 ( I am using a ABAP server proxy on the R3 side )

    Ravi
           I am looking for way to specify a non-static queue name here - so that I could establish a queue based on an object key from the source - web service client all the way to R3 - I wanted to know the options available on specifying the queue name in the communication channel -
    Thanks...

  • Publishing my flex application in external server (Channel.Security.Error error Error #2048)

    when i publish my flex application in an external server i get that error if my flash builder beta 2 is closed in my system , i did configure an endpoint to the dataservice to point to the external server and if i run my flash builder and any body browser the site it open and they can access the data from my application but if i close my flash builder we have this error all of us
    Send failed
    Channel.Security.Error error Error #2048: Security sandbox violation:
    http://www.dcecrak.com/Maine.swf cannot load data from
    http://localhost:37813/flex2gateway/?hostport=www.dcecrak.com&https=N&id=-1. url:
    'http://www.dcecrak.com/flex2gateway/'
    i created a crossdomain.xml file and put it in the web root , if i try to open the link http://www.dcecrak.com/flex2gateway  it open with blank page this means that every thing is oky , my service-config file looks like that :
    <?xml version="1.0" encoding="UTF-8"?>
    <services-config>
        <services>
            <service-include file-path="remoting-config.xml" />
            <service-include file-path="proxy-config.xml" />
            <service-include file-path="messaging-config.xml" />
        </services>
        <security>
            <login-command class="flex.messaging.security.JRunLoginCommand" server="JRun"/>
            <!-- Uncomment the correct app server
            <login-command class="flex.messaging.security.TomcatLoginCommand" server="Tomcat"/>
            <login-command class="flex.messaging.security.WeblogicLoginCommand" server="Weblogic"/>
            <login-command class="flex.messaging.security.WebSphereLoginCommand" server="WebSphere"/>
            -->
            <!--
            <security-constraint id="basic-read-access">
                <auth-method>Basic</auth-method>
                <roles>
                    <role>guests</role>
                    <role>accountants</role>
                    <role>employees</role>
                    <role>managers</role>
                </roles>
            </security-constraint>
            -->
        </security>
        <channels>
            <!--  CF Based Endpoints -->
    <channel-definition id="dcecrak" class="mx.messaging.channels.AMFChannel">
                <endpoint uri="http://www.dcecrak.com/flex2gateway/" class="coldfusion.flash.messaging.CFAMFEndPoint"/>
                <properties>
                      <add-no-cache-headers>false</add-no-cache-headers>
                            <polling-interval-seconds>8</polling-interval-seconds>
                            <serialization>
                                  <enable-small-messages>false</enable-small-messages>
                            </serialization>
                            <coldfusion>
                                <!-- define the resolution rules and access level of the cfc being invoked -->
                                  <access>
                                        <!-- Use the ColdFusion mappings to find CFCs-->
                                        <use-mappings>true</use-mappings>
                                        <!-- allow "public and remote" or just "remote" methods to be invoked -->
                                        <method-access-level>remote</method-access-level>
                                  </access>
                                  <!-- Whether the Value Object CFC has getters and setters. Set the value of use-accessors to true if there are getters and setters in the Value Object CFC. -->
                                  <use-accessors>true</use-accessors>
                                  <!--Set the value of use-structs to true if you don't require any translation of ActionScript to CFCs. The assembler can still return structures to Flex, even if the value is false. The default value is false.-->
                                  <use-structs>false</use-structs>
                        <property-case>
                            <!-- cfc property names -->
                            <force-cfc-lowercase>false</force-cfc-lowercase>
                            <!-- Query column names -->
                            <force-query-lowercase>false</force-query-lowercase>
                            <!-- struct keys -->
                            <force-struct-lowercase>false</force-struct-lowercase>
                        </property-case>
                            </coldfusion>
                </properties>
            </channel-definition>
            <channel-definition id="cf-polling-amf" class="mx.messaging.channels.AMFChannel">
                <endpoint uri="http://{server.name}:{server.port}{context.root}/flex2gateway/cfamfpolling" class="coldfusion.flash.messaging.CFAMFEndPoint"/>
                <properties>
                    <polling-enabled>true</polling-enabled>
                    <polling-interval-seconds>8</polling-interval-seconds>
                            <serialization>
                                  <enable-small-messages>false</enable-small-messages>
                            </serialization>
                            <coldfusion>
                                <!-- define the resolution rules and access level of the cfc being invoked -->
                                  <access>
                                        <!-- Use the ColdFusion mappings to find CFCs-->
                                        <use-mappings>true</use-mappings>
                                        <!-- allow "public and remote" or just "remote" methods to be invoked -->
                                        <method-access-level>remote</method-access-level>
                                  </access>
                                  <!-- Whether the Value Object CFC has getters and setters. Set the value of use-accessors to true if there are getters and setters in the Value Object CFC. -->
                                  <use-accessors>true</use-accessors>
                                  <!--Set the value of use-structs to true if you don't require any translation of ActionScript to CFCs. The assembler can still return structures to Flex, even if the value is false. The default value is false.-->
                                  <use-structs>false</use-structs>
                        <property-case>
                            <!-- cfc property names -->
                            <force-cfc-lowercase>false</force-cfc-lowercase>
                            <!-- Query column names -->
                            <force-query-lowercase>false</force-query-lowercase>
                            <!-- struct keys -->
                            <force-struct-lowercase>false</force-struct-lowercase>
                        </property-case>
                            </coldfusion>
                </properties>
            </channel-definition>
            <channel-definition id="my-cfamf-secure" class="mx.messaging.channels.SecureAMFChannel">
                <endpoint uri="https://{server.name}:{server.port}{context.root}/flex2gateway/cfamfsecure" class="coldfusion.flash.messaging.SecureCFAMFEndPoint"/>
                <properties>
                    <polling-enabled>false</polling-enabled>
                            <add-no-cache-headers>false</add-no-cache-headers>
                            <serialization>
                                  <enable-small-messages>false</enable-small-messages>
                            </serialization>
                            <coldfusion>
                                <!-- define the resolution rules and access level of the cfc being invoked -->
                                  <access>
                                        <!-- Use the ColdFusion mappings to find CFCs-->
                                        <use-mappings>true</use-mappings>
                                        <!-- allow "public and remote" or just "remote" methods to be invoked -->
                                        <method-access-level>remote</method-access-level>
                                  </access>
                                  <!-- Whether the Value Object CFC has getters and setters. Set the value of use-accessors to true if there are getters and setters in the Value Object CFC. -->
                                  <use-accessors>true</use-accessors>
                                  <!--Set the value of use-structs to true if you don't require any translation of ActionScript to CFCs. The assembler can still return structures to Flex, even if the value is false. The default value is false.-->
                                  <use-structs>false</use-structs>
                                  <property-case>
                            <!-- cfc property names -->
                            <force-cfc-lowercase>false</force-cfc-lowercase>
                            <!-- Query column names -->
                            <force-query-lowercase>false</force-query-lowercase>
                            <!-- struct keys -->
                            <force-struct-lowercase>false</force-struct-lowercase>
                        </property-case>
                            </coldfusion>
                </properties>
            </channel-definition>
            <!--  Java Based Endpoints -->
            <channel-definition id="java-amf" class="mx.messaging.channels.AMFChannel">
                <endpoint uri="http://{server.name}:{server.port}{context.root}/flex2gateway/amf" class="flex.messaging.endpoints.AMFEndpoint"/>
            </channel-definition>
            <channel-definition id="java-secure-amf" class="mx.messaging.channels.SecureAMFChannel">
                <endpoint uri="https://{server.name}:{server.port}{context.root}/flex2gateway/amfsecure" class="flex.messaging.endpoints.SecureAMFEndpoint"/>
            </channel-definition>
            <channel-definition id="java-polling-amf" class="mx.messaging.channels.AMFChannel">
                <endpoint uri="http://{server.name}:{server.port}{context.root}/flex2gateway/amfpolling" class="flex.messaging.endpoints.AMFEndpoint"/>
                <properties>
                    <polling-enabled>true</polling-enabled>
                    <polling-interval-seconds>8</polling-interval-seconds>
                </properties>
            </channel-definition>
            <!--
            <channel-definition id="java-http" class="mx.messaging.channels.HTTPChannel">
                <endpoint uri="http://{server.name}:{server.port}{context.root}/flex2gateway/http" class="flex.messaging.endpoints.HTTPEndpoint"/>
            </channel-definition>
            <channel-definition id="java-secure-http" class="mx.messaging.channels.SecureHTTPChannel">
                <endpoint uri="https://{server.name}:{server.port}{context.root}/flex2gateway/httpsecure" class="flex.messaging.endpoints.SecureHTTPEndpoint"/>
            </channel-definition>
            -->
        </channels>
        <logging>
            <target class="flex.messaging.log.ConsoleTarget" level="Error">
                <properties>
                    <prefix>[BlazeDS] </prefix>
                    <includeDate>false</includeDate>
                    <includeTime>false</includeTime>
                    <includeLevel>false</includeLevel>
                    <includeCategory>false</includeCategory>
                </properties>
                <filters>
                    <pattern>Endpoint.*</pattern>
                    <pattern>Service.*</pattern>
                    <pattern>Configuration</pattern>
                    <pattern>Message.*</pattern>
                </filters>
            </target>
        </logging>
        <system>
            <manageable>false</manageable>
            <!--
            <redeploy>
                <enabled>true</enabled>
                <watch-interval>20</watch-interval>
                <watch-file>{context.root}/WEB-INF/flex/services-config.xml</watch-file>
                <watch-file>{context.root}/WEB-INF/flex/proxy-config.xml</watch-file>
                <watch-file>{context.root}/WEB-INF/flex/remoting-config.xml</watch-file>
                <watch-file>{context.root}/WEB-INF/flex/messaging-config.xml</watch-file>
                <watch-file>{context.root}/WEB-INF/flex/data-management-config.xml</watch-file>
                <touch-file>{context.root}/WEB-INF/web.xml</touch-file>
            </redeploy>
             -->
        </system>
    </services-config>
    and my crossdomain.xml looks like that :
    <cross-domain-policy>
    <site-control permitted-cross-domain-policies="all"/>
    <allow-access-from domain="localhost" to-ports="*" secure="false"/>
    <allow-access-from domain="*" to-ports="*" secure="false"/>
    <allow-http-request-headers-from domain="*"/>
    </cross-domain-policy>
    really its strange only the site works if my flash builder is running , please help

      Thanks all for your attention, i have solved my problem and i think its a bug in the flash builder , the problem was that when you compile the application and you enabling Network Monitoring , the communication of the AMF channels done throw the  http://localhost:37813/flex2gateway/
    and that was the problem if you close the flash builder on your system that getaway dose not exist and on the hosted server there is no such address localhost by this port also so the client application witch is catch in you system try to access your localhost and that cause a security error and the address is also not exist .
    so the solution or we have to compile the project after we disable the Network Monitoring in flash builder .

  • Large files are not getting transferred through file channel

    Hi
    the below code works fine for files upto 32 mb, but if the file size is more like 141MB, 250MB then the transfer starts but it doesnot get complete. the destination pdf is not opening and acrobat reader says that the pdf has been corrupted
    import java.beans.*;
    import java.io.Serializable;
    import java.io.*;
    import java.io.File.*;
    import java.util.zip.*;
    import java.nio.*;
    import java.nio.channels.*;
    public class Transfer
       public static void main(String args[]){
         String srcFile = "C:\\\\144 mb.pdf";
         String dstFile = "F:\\144 mb.pdf";
         try{
         FileInputStream in = new FileInputStream(srcFile);
            FileOutputStream out = new FileOutputStream(dstFile);
            FileChannel fcin = in.getChannel();
            FileChannel fcout = out.getChannel();
            long size = fcin.size();
            fcin.transferTo(0, size, fcout);
         }catch(Exception e){
    }//close of classwhat could be the reason

    below is the code that executes as Task1 when triggered as a thread from Class B
    public class C implements Runnable{
        String srcFile = "";
        String dstFile = "";   
        public C (String srcFile,String dstFile){
           this.dstFile =  dstFile;
           this.srcFile =  srcFile;
    public void run() {              
    try
           FileInputStream in = new FileInputStream(srcFile);
           FileOutputStream out = new FileOutputStream(dstFile);
            FileChannel fcin = in.getChannel();
            FileChannel fcout = out.getChannel();          
            int maxCount = 32 * 1024 * 1024;
            long size = fcin.size();
            long position = 0;
            while (position < size) {
                position += fcin.transferTo(position, maxCount,fcout);
              fcin.close();
              fcout.close();
    }catch(IOException ioe)
              System.out.println("FIECOPY SQL ERROR:"+ioe);
    catch(Exception e)
              System.out.println("FIECOPY  ERROR IN TRANSFER FILE:"+e);
    }below is the code that executes as Task2 when triggered as a thread from Class B
    public class D implements Runnable{
        String srcFile="";
        String dstFile="";
        String moveCategory="";
        public  D(String srcFile,String dstFile,String moveCategory){
           this.dstFile =  dstFile;
           this.srcFile =  srcFile;
           this.moveCategory = moveCategory;
    public void run(){
    try
           FileInputStream in = new FileInputStream(srcFile);
           FileOutputStream out = new FileOutputStream(dstFile);
            FileChannel fcin = in.getChannel();
            FileChannel fcout = out.getChannel();
         int maxCount = 32 * 1024 * 1024;
            long size = fcin.size();
            long position = 0;
            while (position < size) {
                position += fcin.transferTo(position, maxCount,fcout);
              fcin.close();
              fcout.close();
    }catch(IOException ioe)
              System.out.println("FIECOPY SQL ERROR:"+ioe);
    catch(Exception e)
              System.out.println("FIECOPY  ERROR IN TRANSFER FILE:"+e);
    }

  • Serialization issue with Java 5 enum

    Hi,
    In one of my DTO class, i have used an enum as an instance variable. But I am getting a serialization error during RMI call.
    Caused by: org.omg.CORBA.MARSHAL: Mismatched serialization UIDs : Source (RepId RMI:com.nokia.oss.interfaces.usermanagement.dtos.UMStatusDTO:1191975053A2D5C1:0000000000000001) = 0000000000000001 whereas Target (RepId RMI:com.nokia.oss.interfaces.usermanagement.dtos.UMStatusDTO:7F5FECD5609C39F7:6318A841C6045391) = 6318A841C6045391  vmcid: IBM  minor code: 8B1  completed: No
         at com.ibm.rmi.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:467)
         at com.ibm.rmi.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:209)
         at com.ibm.rmi.iiop.CDRInputStream.read_value(CDRInputStream.java:1638)
         at com.ibm.rmi.util.ProxyUtil.copyObject(ProxyUtil.java:450)
         at com.ibm.rmi.util.ProxyUtil.invokeWithClassLoaders(ProxyUtil.java:754)
         at com.ibm.CORBA.iiop.ClientDelegate.invoke(ClientDelegate.java:1161)
         at $Proxy322.createUserProfiles(Unknown Source)
         at com.nokia.oss.interfaces.usermanagement.ejb.useradministration._UMUserAdministration_Stub.createUserProfiles(Unknown Source)
         at com.nokia.oss.tmf615.uamadapters.connectors.UMAPI$2$1.run(UMAPI.java:187)
         at com.nokia.oss.tmf615.uamadapters.connectors.UMAPI$2$1.run(UMAPI.java:186)
         at java.security.AccessController.doPrivileged(AccessController.java:246)
         at com.nokia.oss.tmf615.uamadapters.connectors.UMAPI$2.run(UMAPI.java:184)
         at com.nokia.oss.tmf615.uamadapters.connectors.UMAPI$2.run(UMAPI.java:182)
         at java.security.AccessController.doPrivileged(AccessController.java:279)
         at javax.security.auth.Subject.doAs(Subject.java:573)
         at com.ibm.websphere.security.auth.WSSubject.doAs(WSSubject.java:168)
         at com.nokia.oss.tmf615.uamadapters.connectors.UMAPI.createUserProfiles(UMAPI.java:179)
         at com.nokia.oss.tmf615.uamadapters.operations.impl.UserManagerImpl.createUserProfile(UserManagerImpl.java:148)
         at com.nokia.oss.tmf615.uamadapters.operations.impl.UserManagerImpl.createUser(UserManagerImpl.java:81)
         at com.nokia.oss.tmf615.requesthandler.factory.ManageUAMImpl.createUser(ManageUAMImpl.java:103)
         at com.nokia.oss.tmf615.requesthandler.operations.RequestProcessor.addUserRequest(RequestProcessor.java:342)
         at urn.oasis.names.tc.SPML._2._0.wsdl.SPMLRequestPortTypeImpl.spmlAddRequest(SPMLRequestPortTypeImpl.java:1028)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
         at java.lang.reflect.Method.invoke(Method.java:618)
         at com.sun.xml.ws.api.server.InstanceResolver$1.invoke(InstanceResolver.java:246)
         at com.sun.xml.ws.server.InvokerTube$2.invoke(InvokerTube.java:146)
         at com.sun.xml.ws.server.sei.EndpointMethodHandler.invoke(EndpointMethodHandler.java:257)
         at com.sun.xml.ws.server.sei.SEIInvokerTube.processRequest(SEIInvokerTube.java:93)
         at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:595)
         at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:554)
         at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:539)
         at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:436)
         at com.sun.xml.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:243)
         at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:444)
         at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:244)
         at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:135)
         at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doGet(WSServletDelegate.java:129)
         at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doPost(WSServletDelegate.java:160)
         at com.sun.xml.ws.transport.http.servlet.WSServlet.doPost(WSServlet.java:75)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1146)
         at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:593)
         at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:533)
         at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3548)
         at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:269)
         at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:818)
         at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1478)
         at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:125)
         at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:458)
         at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:387)
         at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:267)
         at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
         at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
         at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
         at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
         at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
         at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
         at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:196)
         at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:751)
         at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:881)
         at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1497)My environment has WebSphere Application Server 6.1.
    Earlier, I had used serialVersionUID generated by Eclipse, but to debug I changed it to 1L. But still I am facing the same issue. Any help in solving this issue is greatly appreciated.
    Thanks.

    Caused by: org.omg.CORBA.MARSHAL: Mismatched serialization UIDs : Source (RepId RMI:com.nokia.oss.interfaces.usermanagement.dtos.UMStatusDTO:1191975053A2D5C1:0000000000000001) = 0000000000000001 whereas Target (RepId RMI:com.nokia.oss.interfaces.usermanagement.dtos.UMStatusDTO:7F5FECD5609C39F7:6318A841C6045391) = 6318A841C6045391  vmcid: IBM  minor code: 8B1  completed: NoEarlier, I had used serialVersionUID generated by Eclipse, but to debug I changed it to 1L.Why? To debug what? How would that help? This is exactly the problem that the exception message (above) is reporting. Change it back to 6318A841C6045391L.

  • Channel contract mismatch when implementing ISerializable

    Hello,
    I am trying to retrieve an object via an OperationContract Channel
    but when I try to implement ISerializable for that class, I receive a CommunicationException client side. The serialization and deserialization work fine server side. 
    The exception additional information says: "the server did not provide a meaningful reply; this might be caused by a contract mismatch, a premature session shutdown or an internal server error.
    Basically, I am using a WCF service (self-hosted) very similar to what is described here:
    https://msdn.microsoft.com/en-us/library/ms731758(v=vs.110).aspx
    In my case, the operation contract expose is a get property that returns an object A (a container of data really). One of the fields of this object is also an object, B. Now, B is a very simple class that contains only three jagged arrays, and three get properties
    that transform the jagged arrays to multidimensional arrays.
    Serialization, deserialization and operation contract work fine in this setup. When class B implements ISerializable, the channel returns the exception. ISerializable is implemented in the following way:
    constructor: (not sure the details are important but nevertheless) reads the entries in Serialization info and if the serialized file contains the jagged arrays it just makes the assignment, if it contains the multidimensional arrays, it converts them
    to jagged and makes the assignment.
    GetObjectData: only adds to SerializationInfo the jagged arrays.
    If you are wondering, this is done to keep retro-compatibility with an old version of class B (serialization is not only used by Channel, I also use it to save data). 
    Thanks,
    Leo

    Hi LeoBrl,
    >>the server did not provide a meaningful reply; this might be caused by a contract mismatch, a premature session shutdown or an internal server error.
    For your issue, it will be better if you can try to post a simple reproduce project in here.
    Besides, for troubleshooting this issue, please try to enable the WCF Tracing to help get more detailed error information.
    #How to configure WCF Tracing:
    https://msdn.microsoft.com/en-us/library/ms733025(v=vs.110).aspx .
    Best Regards,
    Amy Peng
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Is close() blocking in nonblocking SocketChannel?

    Hi
    I'm writing a socket server based on the NIO package.
    I saw in several NIO code samples that the SocketChannel close() method is invoked inside the NIO select loop, which should only contain nonblocking calls.
    However, I couldn't find any documentation item where it is clearly stated that the SocketChannel close() method is indeed nonblocking (at least when the channel is in nonblocking mode).
    Could someone help me, please?
    Dario

    * Socket channels could conceivably take a
    significant amount of time to close depending on the
    system's networking implementation. Some network
    protocol stacks may block a close while output is
    drained. Your mileage may vary."With all due respect to Hitchens, the behaviour is reasonably well specified for both BSD Sockets and WINSOCK, which are the vast majority of Java sockets platforms. In both cases they only block trying to drain the output if there is output to drain and the linger timeout has been set to non-zero, which is not the default. There may be mainframe or J2ME implementations of TCP which don't comply.

Maybe you are looking for