A Method to Send Messages on Demand

Hi,
I have been looking at the simplemessage-app-client, which sends messages to a queue to be processed by a message bean. I have been trying to set up an app-client so that other classes in the app can call a method that will send a message to the queue but i dont know how to get it to work.
The connection, session and messageProducer are all set up in a try block of the main method, which then calls a method to start the rest of the application. I need to allow classes in the rest of the application to call a method sendMessage which will initalise and send the message.
Hopefully i've explained this well enough, any suggestions would be great,
Thanks for your time,
atriedes7887

Fairly sure i've sussed this one just by initialising the connection/session ect. as private static before the main method so that it can all be accessed by another method.

Similar Messages

  • Send message with abap proxy client

    I'm trying to send message to XI, but no message in sxmb_moni.
    I have created logical port with LPCONFIG.
    ABAP code
    REPORT  Z_HTTP_SEND.
    DATA:
    * Reference variables for proxy and exception class
      lo_clientProxy     TYPE REF TO ZPCO_MI_COMPANY_OB,
      lo_sys_exception   TYPE REF TO cx_ai_system_fault,
    * Structures to set and get message content
       ls_request         TYPE ZPMT_COMPANY_ID,
       ls_response        TYPE ZPMT_COMPANY_DETAILS.
    *Complete the structure ls_request for the request message.
    *DATA: zmt_id type ZPMT_COMPANY_ID,
    *zdt_id type ZPDT_COMPANY_ID,
    *z_id_tab type ZPCOMPANY_ID_TAB,
    *z_id type ZPCOMPANY_ID.
    *z_id-COMPANY_ID = '3000'.
    *append  z_id to z_id_tab.
    *  zdt_id-RECORD = z_id_tab.
    *zmt_id-MT_COMPANY_ID = zdt_id.
    DATA tab TYPE ZPCOMPANY_ID_TAB WITH HEADER LINE.
    tab-COMPANY_ID = '3000'.
    APPEND tab.
    ls_request-MT_COMPANY_ID-RECORD = tab[].
    TRY.
    * create proxy client
    *CREATE OBJECT lo_clientProxy( u2018LOGICAL_PORT_NAMEu2019 ).
        CREATE OBJECT lo_clientProxy.
    * do synchronous client proxy call
        CALL METHOD lo_clientProxy->execute_synchronous
                 EXPORTING output  = ls_request
                 IMPORTING input   = ls_response.
        CATCH cx_ai_system_fault INTO lo_sys_exception.
    *   Error handling
    ENDTRY.
    Any ideas? Thanks very much,

    Hi,
    Proxies communicate with the XI server by means of native SOAP calls over HTTP .RFC does not, so you have to convert from SOAP to RFC calls and vice versa. So XML conversion is required.
    ABAP Proxies uses Webservice and Http Protocols. And if you use RFC it is mainly meant for Sync. call. But Proxies is used for both Sync and Async.
    If you use ABAP Proxy , you can reduce the overhead calling the function again and again.
    How do you activate ABAP Proxies? - Activate Proxy
    ABAP Server Proxies - ABAP Server Proxy
    ABAP Proxies in XI(Client Proxy) - ABAP Client Proxy
    Re: JDBC Sender select/update problem
    If u generate proxy for outbound interface then its client proxy and for inbound interface its server proxy.
    In client proxy u can call the method to send messages but u can't modify it but in server proxy its possible to write a user code within the method to execute proxy.
    CLIENT PROXY:
    A WSDL description from a UDDI server (or an Internet page) is usually used to make a service executable in the Internet and to describe the interface of this service. You require a client proxy and not a server proxy to call this service by using the Web service infrastructure.
    SERVER PROXY:
    You can only generate ABAP server proxies from a WSDL description if they originate in the Integration Repository.You can also generate server proxies for Java and client proxies for ABAP from message interfaces.
    s refer these doc about ABAP proxy ..
    How do you activate ABAP Proxies? - Activate Proxy
    ABAP Server Proxies - ABAP Server Proxy
    ABAP Proxies in XI(Client Proxy) - ABAP Client Proxy
    Re: JDBC Sender select/update problem
    ABAP Server Proxies
    How do you activate ABAP Proxies?
    ABAP Proxies in XI(Client Proxy)
    File to R/3 via ABAP Proxy
    http://help.sap.com/saphelp_nw2004s/helpdata/en/48/d5a1fe5f317a4e8e35801ed2c88246/frameset.htm
    http://help.sap.com/saphelp_nw04s/helpdata/en/ba/f21a403233dd5fe10000000a155106/frameset.htm
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/41e08c90-0201-0010-9197-d8774336ea78
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f0ae9874-109c-2910-f48a-e91f0cdd1c81
    Smarter Approach for coding ABAP Proxies
    regards,
    Surya

  • Error when sending message: Method not implemented

    Hi, All:
    We have newly setup system and when we test sending test message from RWB, (RWB-Component Monitoring-Integration Engine-Test Tab), we got following error:
    "Error when sending message: Method not implemented", I know this is related to post configuration issue, I just know someone has come cross the situation and how it was resolved.
    Thanks
    Liang

    HI Liang
    Yes it looks like post installation problem. I have not come across this but i think you should check with the RFC created for IE while installation. To connect IE & AE and even the exchange profile if something is missing
    Thanks
    Gaurav

  • Send message with the standard communication method of the vendor

    Hi,
       In the transaction XK02 I change the standard communication method to email. When I create a new PO with ME21N I want the message to be create auto. with the std. comm. method define in the XK02. I don't want to use MN05 to define for each vendor a condition record.
      I want to use it like the communication language of the vendor work.
    If you need more info. let me know.
    Best reagrds

    Hi Tim,
    Could you please tell me step by step to configure what you are saying?
    I need to send messages by standard communication informed in vendor master data.
    Many thanks
    Regards
    Patrícia

  • "Cannot send message using the server....."

    Hi all,
    Considering the nature of the problem I am about to relate I would have to say at the outset that I would be very very surprised if other people have not come across this problem, so here goes...
    We have around 60 users of Apple Mail from both 10.4 and 10.5, so varying degrees of versions of Apple Mail however most if not all are updated to 10.4.11 and 10.5.2.
    We have been plagued with people being frustrated about emails bouncing back with an immediate error which is basically the following...
    "Cannot send message using the server smtp.xxx.com:user
    Sending the message content to the server failed.
    Select a different outgoing mail server from the list below etc etc"
    I am sure a lot of you have seen this error.
    However, it is totally random but I am at the end of my tether with it. It generally revolves around emails with attachments and can be totally random. I was trying to send a screenshot today, very small screenshot, using the Apple-Shift-4 technique, sent the .png file, then saved it out as a .jpg, nothing. Tiny file, around 5k. Got the error above, took it out, sent no problem. Other similar files on the desktop refused to send but a .pdf did. I then thought it might be our server, so sent teh same attachments using my .mac account. Same result and failed to send. Reports from other users in our group show that they too get random results, maybe moving the attachment in the email makes it go, sometimes putting it before your signature, sometimes putting your signature copied and pasted in so many times makes it work, all sorts of methods but all resulting in the same conclusion, Apple Mail can be very unreliable.
    We have even migrated some users to Entourage and the problem disappears. Even to Thunderbird, but those users miss the search capability as it is quicker and more reliable. So they want to go back.
    Considering I have been struggling with this issue back in the day when we were on the Apple Mail related version in 10.4 I was hoping that the version released in 10.5 would remedy the problems. Sometimes I feel it has just got worse.
    Is anyone else experiencing this sort of difficulty in Apple Mail, I really feel isolated and at a loss with how to remedy this for so many users.
    If anyone can share their experiences and how they have got around similar issues in Mail I am all ears and open to any suggestions.
    Thanks everyone for taking the time to read through this. There is more but the experiences are so random it is not worth trying to put it all down.
    Thanks again.
    Gerry McCoy

    I went in to Connection Doctor and. oddly enough, for this Mac account it said I was on Port 25. Si I changed it to Port 587 and saved the changes.
    Still, I have the same problem with the same error messages.
    I go back to the mail preferences > Accounts > Advanced and it shows Port 143 still there grayed out.
    What about SSL - it's not checked.
    Odd that this problem only seems to be from one .mac account emailing to another .mac account. Could the server be down?

  • Auth.log - Rejected send message, 2 matched rules; type="method_call"

    Hi,
    i'm checking the /var/log/auth.log and I found out that there is this error message
    Jun 9 20:19:56 localhost polkitd(authority=local): Registered Authentication Agent for unix-session:/org/freedesktop/ConsoleKit/Session2 (system bus name :1.23 [/usr/bin/gnome-shell], object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8)
    Jun 9 20:19:57 localhost dbus[513]: [system] Rejected send message, 2 matched rules; type="method_call", sender=":1.23" (uid=1000 pid=861 comm="/usr/bin/gnome-shell ") interface="org.freedesktop.DBus.Properties" member="GetAll" error name="(unset)" requested_reply="0" destination=":1.1" (uid=0 pid=654 comm="/usr/sbin/console-kit-daemon --no-daemon ")
    Jun 9 20:19:57 localhost dbus[513]: [system] Rejected send message, 2 matched rules; type="method_call", sender=":1.23" (uid=1000 pid=861 comm="/usr/bin/gnome-shell ") interface="org.freedesktop.DBus.Properties" member="GetAll" error name="(unset)" requested_reply="0" destination=":1.1" (uid=0 pid=654 comm="/usr/sbin/console-kit-daemon --no-daemon ")
    Jun 9 20:19:57 localhost dbus[513]: [system] Rejected send message, 2 matched rules; type="method_call", sender=":1.23" (uid=1000 pid=861 comm="/usr/bin/gnome-shell ") interface="org.freedesktop.DBus.Properties" member="GetAll" error name="(unset)" requested_reply="0" destination=":1.1" (uid=0 pid=654 comm="/usr/sbin/console-kit-daemon --no-daemon ")
    if think the problem is in /etc/dbus-1/system.conf
    <deny send_type="method_call"/>
    I'm tempted to change this to allow,  but I won't as long as I don't understand why this deny-rule is implemented.
    Last edited by miky76 (2012-06-09 20:41:06)

    That deny rule is the default. Things in /etc/dbus-1/system.d override it. There's a ConsoleKit.conf file in there that describes what interaction ConsoleKit actually allows.
    That said, ConsoleKit.conf also denies this access:
    <deny send_destination="org.freedesktop.ConsoleKit"
    send_interface="org.freedesktop.DBus.Properties" />
    I don't know why this is denied - most likely it's to prevent private data from being stolen from console-kit-daemon in this way. I don't see any such private data stored in properties on ConsoleKit, though:
    $ dbus-send --print-reply --system --dest=org.freedesktop.ConsoleKit /org/freedesktop/ConsoleKit/Session1 org.freedesktop.DBus.Introspectable.Introspect
    method return sender=:1.5 -> dest=:1.14 reply_serial=2
    string "<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
    "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
    <node>
    <interface name="org.freedesktop.DBus.Introspectable">
    <method name="Introspect">
    <arg name="data" direction="out" type="s"/>
    </method>
    </interface>
    <interface name="org.freedesktop.DBus.Properties">
    <method name="Get">
    <arg name="interface" direction="in" type="s"/>
    <arg name="propname" direction="in" type="s"/>
    <arg name="value" direction="out" type="v"/>
    </method>
    <method name="Set">
    <arg name="interface" direction="in" type="s"/>
    <arg name="propname" direction="in" type="s"/>
    <arg name="value" direction="in" type="v"/>
    </method>
    <method name="GetAll">
    <arg name="interface" direction="in" type="s"/>
    <arg name="props" direction="out" type="a{sv}"/>
    </method>
    </interface>
    <interface name="org.freedesktop.ConsoleKit.Session">
    <method name="SetIdleHint">
    <arg name="idle_hint" type="b" direction="in"/>
    </method>
    <method name="GetIdleSinceHint">
    <arg name="iso8601_datetime" type="s" direction="out"/>
    </method>
    <method name="GetIdleHint">
    <arg name="idle_hint" type="b" direction="out"/>
    </method>
    <method name="Unlock">
    </method>
    <method name="Lock">
    </method>
    <method name="Activate">
    </method>
    <method name="GetCreationTime">
    <arg name="iso8601_datetime" type="s" direction="out"/>
    </method>
    <method name="IsLocal">
    <arg name="local" type="b" direction="out"/>
    </method>
    <method name="IsActive">
    <arg name="active" type="b" direction="out"/>
    </method>
    <method name="GetLoginSessionId">
    <arg name="login_session_id" type="s" direction="out"/>
    </method>
    <method name="GetRemoteHostName">
    <arg name="remote_host_name" type="s" direction="out"/>
    </method>
    <method name="GetDisplayDevice">
    <arg name="display_device" type="s" direction="out"/>
    </method>
    <method name="GetX11DisplayDevice">
    <arg name="x11_display_device" type="s" direction="out"/>
    </method>
    <method name="GetX11Display">
    <arg name="display" type="s" direction="out"/>
    </method>
    <method name="GetUnixUser">
    <arg name="uid" type="u" direction="out"/>
    </method>
    <method name="GetUser">
    <arg name="uid" type="u" direction="out"/>
    </method>
    <method name="GetSessionType">
    <arg name="type" type="s" direction="out"/>
    </method>
    <method name="GetSeatId">
    <arg name="sid" type="o" direction="out"/>
    </method>
    <method name="GetId">
    <arg name="ssid" type="o" direction="out"/>
    </method>
    <signal name="Unlock">
    </signal>
    <signal name="Lock">
    </signal>
    <signal name="IdleHintChanged">
    <arg type="b"/>
    </signal>
    <signal name="ActiveChanged">
    <arg type="b"/>
    </signal>
    <property name="idle-hint" type="b" access="readwrite"/>
    <property name="is-local" type="b" access="readwrite"/>
    <property name="active" type="b" access="readwrite"/>
    <property name="x11-display-device" type="s" access="readwrite"/>
    <property name="x11-display" type="s" access="readwrite"/>
    <property name="display-device" type="s" access="readwrite"/>
    <property name="remote-host-name" type="s" access="readwrite"/>
    <property name="session-type" type="s" access="readwrite"/>
    <property name="user" type="u" access="readwrite"/>
    <property name="unix-user" type="u" access="readwrite"/>
    </interface>
    </node>
    Note those properties at the end of that list, which are the same things you can learn by running ck-list-session.
    If you want to change the deny to allow, you may as well do it in the ConsoleKit.conf line, so it's specific to this usage, rather than allowing any method call in the world called through dbus.
    FWIW, I can reproduce this same error, trying to do it "by hand", though I don't use GNOME, as you do:
    $ dbus-send --print-reply --system --type=method_call --dest=org.freedesktop.ConsoleKit /org/freedesktop/ConsoleKit/Session1 org.freedesktop.DBus.Properties.GetAll string:org.freedesktop.ConsoleKit.Session
    Error org.freedesktop.DBus.Error.AccessDenied: Rejected send message, 2 matched rules; type="method_call", sender=":1.17" (uid=1000 pid=13892 comm="dbus-send --print-reply --system --type=method_cal") interface="org.freedesktop.DBus.Properties" member="GetAll" error name="(unset)" requested_reply="0" destination="org.freedesktop.ConsoleKit" (uid=0 pid=751 comm="/usr/sbin/console-kit-daemon --no-daemon ")

  • Have you a simple client for send message on oc4j 9.0.2.0.0 ?

    Hi to All!
    Have you a simple client to send message on a queue in OC4J 9.0.2 ?
    Can you show me how is possible to write the config file to connect to oc4j application server?
    thanks very much
    Andrea

    I added -Xcheck:jni and -Xcheck:nabounds to the command line and got this one now :
    500 Internal Server Error
    Error parsing JSP page /westflo-fsweb/main/header.jsp
    Error creating jsp-page instance: java.lang.ClassFormatError: __jspPage8_main_header_jsp (Method "pushBody" has illegal signature "()Ljavax/servonInfo.classjavax/servlet/j")
    My whole command line is :
    /usr/java130_wei/bin/java -ms128m -mx256m -Xcheck:jni -Xcheck:nabounds -Xnoclassgc -verbosegc -Duser.dir=/usr/oc4j/j2ee/home -Denvironment=DEV2GMSFS -Dwestflo.dir=/website/DEV2/GMSFS/oc4j_instance2/westflo/westflo/ -Ddeployment.dir=/website/DEV2/GMSFS/oc4j_instance2/pie/gms/ -Demissionrc.dir=/website/DEV2/GMSFS/oc4j_instance2/emissionrc/emissionrc-web/ -jar /usr/oc4j/j2ee/home/oc4j.jar -out /website/DEV2/GMSFS/oc4j_instance2/oc4j_config/log/server.log -err /website/DEV2/GMSFS/oc4j_instance2/oc4j_config/log/oc4j.err -config /website/DEV2/GMSFS/oc4j_instance2/oc4j_config/config/server.xml

  • Creating a QueueReceiver after sending message to the QueueSender

              Hi,
              I'm implementing a blocking system, sending messages to a JMS Queue.
              In a servlet, in the init method, I'm creating the QueueSender object.
              When calling the servlet, in the service method, if I need to create a new
              message to let users know
              that one primary key is blocked, I create a message with a:
                   msg.setStringProperty("MyTablePrimaryKey", "PKValue");
              Then, I send it.
              If other clients want to update that record, he creates in the servlet's service
              a QueueBrowser like this:
              QueueBrowser receptor=qsession.createBrowser (myQueue, strFilter);
              where strFilter is "MyPrimaryKey IS NOT NULL".
              If the enumeration my QueueBrowser returns hasMoreElements(), the record is
              blocked.
              To unblock a record, I fetch the message from QueueBrowser with the with Enumeration.nextElement,
              and I set:
              message.setJMSExpiration(1);
              so the message is automatically deleted from the queue.
              I tried to use QueueReceiver to implement it, but as I don't know the filter's
              name in the init method of my servlet,
              it's not possible to read messages if the QueueReceiver is created after having
              sent those messages.
              Is my implementation correct? Is the behaviour of QueueReceiver logical?
              Of course, I'm thinking of doing all these things in EJBs to use transactions
              with JTA and JMS. Can be any problem
              with it?
              Sorry for the long question, but I've started discovering JMS a few hours
              ago, and it looks so interesting... :-)
              Best Regards,
              Ignacio
              

              Ignacio Sanchez wrote:
              > Tom Barnes <[email protected]> wrote:
              >
              >>
              >>Ignacio Sanchez wrote:
              >>
              >>>Hi,
              >>>
              >>> I'm implementing a blocking system, sending messages to a JMS Queue.
              >>>
              >>> In a servlet, in the init method, I'm creating the QueueSender
              >>
              >>object.
              >>
              >>> When calling the servlet, in the service method, if I need to create
              >>
              >>a new
              >>
              >>>message to let users know
              >>>that one primary key is blocked, I create a message with a:
              >>>     msg.setStringProperty("MyTablePrimaryKey", "PKValue");
              >>> Then, I send it.
              >>>
              >>> If other clients want to update that record, he creates in the
              >>
              >>servlet's service
              >>
              >>>a QueueBrowser like this:
              >>> QueueBrowser receptor=qsession.createBrowser (myQueue, strFilter);
              >>> where strFilter is "MyPrimaryKey IS NOT NULL".
              >>> If the enumeration my QueueBrowser returns hasMoreElements(), the
              >>
              >>record is
              >>
              >>>blocked.
              >>
              >>
              >>How? The QueueBrowser supplies a snap-shot of the queue, it doesn't
              >>prevent other receivers and queue-browsers from seeing the message.
              >>
              >
              >
              > That's exactly what I want. I want concurrent queue-browsers to see the same message.
              >
              >
              >>>
              >>> To unblock a record, I fetch the message from QueueBrowser with
              >>
              >>the with Enumeration.nextElement,
              >>
              >>>and I set:
              >>
              >>> message.setJMSExpiration(1);
              >>> so the message is automatically deleted from the queue.
              >>
              >>
              >>This will have no effect. Expiration can only be set when the message
              >>is sent, and only via the producer API not the message API. The message
              >>API setter is not intended for application use (see the
              >>javax.jms.Message javadoc). To delete the message you can
              >>create a QueueReceiver with a selector based on the message's
              >>message-id, then receive and acknowledge the message.
              >>
              >
              >
              > But it works!! I've tested once and again and it works fine for me. Shouldn't
              > it???
              >
              Gah!! This behavior is not supported. Do not depend on it to
              be there in future releases or SPs. Any changes to an already
              sent message by a client should propagate to the copy that
              is on the server.
              In fact, I think this may have already been fixed. Can you
              tell me which release and SP you are using?
              >>>
              >>> I tried to use QueueReceiver to implement it, but as I don't know
              >>
              >>the filter's
              >>
              >>>name in the init method of my servlet,
              >>> it's not possible to read messages if the QueueReceiver is created
              >>
              >>after having
              >>
              >>>sent those messages.
              >>
              >>I don't understand. If you can create the QueueBrowser when you
              >>need it, why can't you just create a QueueReceiver with a new selector?
              >
              > If I create a new QueueReceiver after having sent the message using a QueueSender,
              > the
              > receiver cannot read the messages already posted, even in selector is OK. But
              > it works with
              > a QueueBrowser ¿¿??¿¿
              If a QueueBrowser can see the message so should a QueueReceiver. They
              both use the same filter/selector mechanism. It is surprising
              that one worked and the other didn't. Or are you referring to
              the normal behavior that only one QueueReceiver can "see" the message
              at a time? And that once a QueueReceiver has a message the
              QueueBrowser will not "see" it?
              > That's why I'm using QueueBrowser and not QueueReceiver.
              >
              >
              >>>
              >>> Is my implementation correct? Is the behaviour of QueueReceiver
              >>
              >>logical?
              >>
              >>>
              >>> Of course, I'm thinking of doing all these things in EJBs to use
              >>
              >>transactions
              >>
              >>>with JTA and JMS. Can be any problem
              >>> with it?
              >>>
              >>> Sorry for the long question, but I've started discovering JMS a
              >>
              >>few hours
              >>
              >>>ago, and it looks so interesting... :-)
              >>>
              >>> Best Regards,
              >>> Ignacio
              >>
              >
              

  • Problem while sending message (sms) using nokia ov...

    recently my nokia ovi suite is updated to version 3.1.1.85, Now when every i am typing to send message from nokia ovi suite's messaging section and if notification for new message is on,
    while typing if new message comes, it refreshes the screen (inbox) section and the alreday typed message disappears.
    I didnt have this problem in previous version of nokia ovi suite. and i can send / receive message at a same time. 

    hi all,
    i want to send SMS using j2me. im using netbeens IDE.
    if i put my sendSMS() method under startapp() it will work. but i want to send SMS using command button. ( when i press SEND command button i want to send my SMS)
    if u know how to do this please email me - [email protected]
    my method is given below. it's work............
    public void sendMessage(){
    String address = "sms://+5550001:1234";
    MessageConnection smsconn = null;
    try{
    smsconn = (MessageConnection)Connector.open(address);
    TextMessage txtMessage = (TextMessage)smsconn.newMessage(MessageConnection.TEXT_MESSAGE);
    txtMessage.setPayloadText("rosa");
    smsconn.send(txtMessage);
    smsconn.close();
    } catch (Exception e){
    e.printStackTrace();
    i want to send this message using command button , like this ..............
    public void commandAction(Command command,Displayable displayable)
    if (command == send)
    sendMessage();
    if i put like this it will give error
    (Running in the identified_third_party security domain
    Warning: To avoid potential deadlock, operations that may block, such as
    networking, should be performed in a different thread than the
    commandAction() handler.)
    but it's work under startapp(). any one know the answer please help me..............................
    [email protected]

  • Got error when sending message with big size

    Hello!
    I hope someone will able to help. I am facing with the size issue (I guess).
    The input file has a size of 58668 bytes. My program takes it and convert it to a TextMessage. When sending the file to the JMS queue, I got:
    javax.jms.JMSException: Failed to process message: Failed to add message=ID:f411d6c8-c1df-1004-8942-9b67f9629ee5, destination=QueueName3 (5)
            at org.exolab.jms.messagemgr.MessageMgr.add(MessageMgr.java:199)
            at org.exolab.jms.server.ServerSessionImpl.send(ServerSessionImpl.java:205)
            at org.exolab.jms.server.net.RemoteServerSession.send(RemoteServerSession.java:152)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:585)
            at org.exolab.jms.net.orb.DefaultORB$Handler.invoke(DefaultORB.java:553)
            at org.exolab.jms.net.orb.DefaultORB$1.run(DefaultORB.java:511)
            at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(Unknown Source)
            at java.lang.Thread.run(Thread.java:595)This error is generated when doing:
    if(message instanceof TextMessage)
          this.producer.send(message);
      }producer is a MessageProducer.
    I looked around and did not find any limitation on the send method :o(
    FYI I am using OpenJMS has JMS provider.
    Thx in advance

    oh I looked into OpenJMS log (I could do that from the beginning) and I saw the following message:
    17:00:11.005 ERROR [ORB-Worker-18] - Failed to process message
    javax.jms.JMSException: Failed to process message: Failed to add message=ID:f3e38ebc-c1df-1004-8ecc-3d4e4e499b90, destination=
    QueueName3 (5)
            at org.exolab.jms.messagemgr.MessageMgr.add(MessageMgr.java:199)
            at org.exolab.jms.server.ServerSessionImpl.send(ServerSessionImpl.java:205)
            at org.exolab.jms.server.net.RemoteServerSession.send(RemoteServerSession.java:152)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:585)
            at org.exolab.jms.net.orb.DefaultORB$Handler.invoke(DefaultORB.java:553)
            at org.exolab.jms.net.orb.DefaultORB$1.run(DefaultORB.java:511)
            at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(Unknown Source)
            at java.lang.Thread.run(Thread.java:595)
    17:00:41.333 ERROR [ORB-Worker-18] - Failed to process message
    org.exolab.jms.persistence.PersistenceException:
    ERROR 22001: A truncation error was encountered trying to shrink LONG VARCHAR FOR BIT DATA 'XX-RESOLVE-XX' to length 32700.
            at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
            at org.apache.derby.iapi.types.SQLBinary.checkHostVariable(Unknown Source)
            at org.apache.derby.exe.ac601a400fx0110xbb05xf3e9xffff95b19c308.e0(Unknown Source)
            at org.apache.derby.impl.services.reflect.DirectCall.invoke(Unknown Source)
            at org.apache.derby.impl.sql.execute.RowResultSet.getNextRowCore(Unknown Source)
            at org.apache.derby.impl.sql.execute.NormalizeResultSet.getNextRowCore(Unknown Source)
            at org.apache.derby.impl.sql.execute.DMLWriteResultSet.getNextRowCore(Unknown Source)
            at org.apache.derby.impl.sql.execute.InsertResultSet.open(Unknown Source)
            at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
    ...From what I understand, my issue is related to OpenJMS. Can the length be increased?

  • Send Message Client to Client Via Server

    Hi,
    I am trying to create Messenger similar to msn but very simple.
    I have managed to create some parts of it after nonstop day night reading up on sockets, and threading etc.. so so far i have a Server + ServerThread and Client class, which is capable of:
    * Server that can accept multiple client connections.
    * Each client can send message to the server Only
    Thats all so far but I do intend to
    * Make Client send Client messages via the Server <-- Next Important Step
    * Add and Remove Users (User Lists)
    Lets say I have a Server (S) and Clients (C1) and (C2)
    at the moment both C1 and C2 can connect to S and send messages to it only.
    How can I, or what would I need to do so that I can make C1 and C2 actually send each other messages? I understand I may need the server to somehow get the messages recieved from C1 and C2 and send them to one another?
    Do correct me in my assumptions or methods I am using, as you may know better methods or techniques to use to implement what I need to do.
    Thanks
    QTQ
    P.S If you need anymore information in regards to this or have any questions, please do ask.

    thanks topfoxy for the reply, I've managed to send msgs to everyone and private... but used a different method i think.. basically on each connection it would add the sockets to a vector list adn the same with usernames. and to send to everyone on the server the thread will just loop all the socket vector sending it to each user.. on private it will use the uservector to get the index of the user name and then using that index to get hte socket and hten sending it to that socket only... :)... what do you think? good or bad?

  • Classes and methods to send email to SAP inbox

    Hi,
    I want an appropriate class and method to send emails to SAP Inbox.
    My objective is that i convert spool to PDF and send it to SAP inbox as an attachment.
    I've used  'CONVERT_ABAPSPOOLJOB_2_PDF' and 'SX_TABLE_LINE_WIDTH_CHANGE' to generate PDF attachment.
    I tried Function modules 'SO_DOCUMENT_SEND_API1'/'SO_NEW_DOCUMENT_ATT_SEND_API1' to send email.
    It was working fine till now (for last 4 months). Now the Basis team has run some patches due to which the PDFs are getting damaged.
    Now the FMs 'SO_DOCUMENT_SEND_API1'/'SO_NEW_DOCUMENT_ATT_SEND_API1' seems to be useless.
    So i tried some methods in classes cl_document_bcs and cl_bcs. These are working fine for Internet mails but not SAP mails.
    Please suggest me some Classes and methods to send the PDF atachments to SAP inbox.

    to have all SAP inbox messages into lotus notes inbox you have to sync the same with the use of connectors rather than resending them
    check out this link
    http://www-128.ibm.com/developerworks/lotus/library/lei-sap/
    for outlook its done using MAPI
    http://www.sapgenie.com/faq/exchange.htm
    Regards
    Raja

  • How to send message to MessageDrivenBean from Session bean in JDeveloper

    HI I am trying to write a sample program using JDeveloper.
    I am trying to do these steps
    1) client class which gets Session bean and calls its method.
    2) write Stateless Session bean with a method which gets MDB and sends message.
    3) write Message Driven Bean ( which prints message recieved from Session bean )
    Set up
    =======
    jms.xml
    {JDevHome}\jdev\system9.0.5.2.1618\oc4j-config\jms.xml : changed jms.xml file and included
         <topic name="Demo Topic" location="jms/theTopic">
              <description>A dummy topic</description>
         </topic>
         <topic-connection-factory name="Demo Topic Connection Factory" location="jms/theTopicConnectionFactory">
              <description>A dummy topic connection factory</description>
         </topic-connection-factory>
    orion-ejb-jar.xml:
    edited MDB entry to
    <message-driven-deployment name="MessageLogger"
    destination-location="jms/theTopic" connection-factory-location="jms/theTopicConnectionFactory">
    </message-driven-deployment>
    Implementation
    ===============
    In client class:
    I am getting session bean like
    Properties props = System.getProperties();
    props.put( javax.naming.Context.INITIAL_CONTEXT_FACTORY , "com.evermind.server.rmi.RMIInitialContextFactory");
    props.put( javax.naming.Context.SECURITY_PRINCIPAL , "admin" );
    props.put( javax.naming.Context.SECURITY_CREDENTIALS,"welcome");
    props.put( javax.naming.Context.PROVIDER_URL ,"ormi://localhost:23891/current-workspace-app");
    Context ctx = new InitialContext(props);
    MySessionHome home = (MySessionHome)
              javax.rmi.PortableRemoteObject.narrow(obj, MySessionHome.class);
    This part works fine, and I am calling method on session bean created out of home.
    In Session bean:
    I want to get TopicConnectionFactory and tried these two ways:
    a)
    getting the context by setting new environemnt values like
    Properties props = System.getProperties();
    props.put( javax.naming.Context.INITIAL_CONTEXT_FACTORY , "com.evermind.server.jms.EvermindConnectionFactory");
    props.put( javax.naming.Context.SECURITY_PRINCIPAL , "admin" );
    props.put( javax.naming.Context.SECURITY_CREDENTIALS,"welcome");
    props.put( javax.naming.Context.PROVIDER_URL ,"ormi://localhost:9227/current-workspace-app");
    Context ctx = new InitialContext( props);
    When I try this,it is complaining that it cannot instantiate EvermindConnectionFactory.
    I am not sure which factory class we have to use here.i tried all the Factory class in that package.but didn't worked.
    next I used,
    b)
    tried to use default context in session bean to get MDB factory
    String TOPIC_NAME="jms/theTopic";
    String TOPIC_CONNECTION_FACTORY="jms/theTopicConnectionFactory";
    TopicConnectionFactory connectionFactory = (TopicConnectionFactory)new InitialContext().lookup("java:comp/env/" + TOPIC_CONNECTION_FACTORY);
    this gives
    04/06/13 23:46:09 javax.naming.NameNotFoundException: jms/theTopicConnectionFactory not found in MySession
    04/06/13 23:46:09      at com.oracle.naming.J2EEContext.getSubContext(J2EEContext.java:93)
    this may be because JMS server runs on different port than other EJBs and have different namespaces.
    Can any body give info,how we can make use of Message Driven bean from a Session Bean or from a JSP page or from a simple class inside JDeveloper.
    Thanks in advance.
    gopal

    Hi,
    There are some hints in this forum for how to do this.
    I put together and make it working.
    This example creates an MD Bean and have a simple message and a client class send messages to that bean.
    Steps
    =====
    1)
    a)in {JDev Home}\jdev\system9.0.5.2.1618\oc4j-config\jms.xml
         <topic name="Demo Topic" location="jms/demoTopic">
              <description>A dummy topic</description>
         </topic>
         <topic-connection-factory name="Demo Topic Connection Factory" location="jms/theTopicConnectionFactory">
              <description>A dummy topic connection factory</description>
         </topic-connection-factory>
    b) in current project in orion-ejb-jar.xml
    go to orion-ejb-jar properties and add these values there to MDB node
    destination-location=jms/demoTopic
    connection-factory-location=jms/theTopicConnectionFactory
    2) create a dummy session bean and a dummy client for that session bean
    This sets default configuration for the client application we write
    doing so we do not need to set properties to get Initial context.It makes use of
    {JDev Home}\jdev\system9.0.5.2.1618\oc4j-config\.client\jndi.properties
    We can directly get Contexxt ctx = new InitialContext();
    3) Create MDB and put this sample code in method
    onMessage()
    TextMessage tm = (TextMessage) msg;
    try {
    String text = tm.getText();
    System.err.println("Received new message : " + text);
    catch(JMSException e) {
    e.printStackTrace();
    4) go to properties for the MDB and set Destination to Topic
    5) write Client code
    Context ctx =new InitialContext();
    // 1: Lookup ConnectionFactory via JNDI
    TopicConnectionFactory factory =     
    (TopicConnectionFactory) ctx.lookup("jms/theTopicConnectionFactory");
    // 2: Use ConnectionFactory to create JMS connection
    TopicConnection connection = factory.createTopicConnection();
    // 3: Use Connection to create session
    TopicSession session = connection.createTopicSession( false, Session.AUTO_ACKNOWLEDGE);
    // 4: Lookup Desintation (topic) via JNDI
    Topic topic = (Topic) ctx.lookup("jms/demoTopic");
    // 5: Create a Message Producer
    TopicPublisher publisher = session.createPublisher(topic);
    // 6: Create a text message, and publish it
    TextMessage msg = session.createTextMessage();
    msg.setText("This is a test message from My Test Client!!! .");
    publisher.publish(msg);
    6) Run the server and run the client

  • JMS send message

    Hello,
    in my message bean i have method with 3 BigDecimal parameters.
    How can i send message from client with 3 BigDecimal parameters?
    thanks for help.

    No, but you can. use an object stream to serialize the message and you are
              all set.
              _sjz.
              "deezh" <[email protected]> wrote in message
              news:3d23fdbf$[email protected]..
              >
              >
              

  • I can send messages but not receive.

    My iChat used to work fine. For some reason, however, now I can send messages that my buddies can read but do not appear in my chat box after I hit send. I can no longer read any messages my buddies send to me. I also cannot see chat room invitations that are sent to me. My Mac store people tell me they can find nothing wrong and it "works fine" when they use it. I thought perhaps it was my user account, but I can use iChat at work and on my husband's iMac with no problems. All the settings seem to be identical. I thought about setting up another AIM account, but my original works fine on the other computers.
    Oh, I am able to video chat with my husband. It seems to be only the text chat that does not work.
    Any ideas or suggestions?

    Hi,
    Chats that do Text Chat and then send files or Pics in the chat change it to a Direct IM
    This changes the Protocol iChat uses to send and receive data on.  (It swaps from port 5190 (Or whatever login port you have set) on TCP to using port 5190 on UDP)
    This means you have to have port 5190 open on your router to the UDP protocol.
    (Of course it has to be opened in such a way that two computer can use the port and protocol at the same time. (UPnP is method of choice)
    Group chats also use port 5190 on UDP
    This would seem to be the most likely thing with what you list about the account and the Computer working at a Store  (I take it they tested Your iChat Account there ? (testing their own account would prove very little)
    11:20 PM      Wednesday; August 10, 2011
    Please, if posting Logs, do not post any Log info after the line "Binary Images for iChat"
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb( 10.6.8)
     Mac OS X (10.6.8),
    "Limit the Logs to the Bits above Binary Images."  No, Seriously

Maybe you are looking for

  • Vendor block is not working

    Hi Gurus, I had blocked one vendor against purchase organisation. In case 1 --- when I tried to create Po with that vendor and pur org, system is throwing error which is fine But in case 2 - I had entered this blocked vendor for fright condition FRB1

  • Is there any limitation on how many apps a developer can upload to the apple store?

    Hi , I am planning to sell the same app to several customer ( clothing shop owners ) and I wonder if there is any kind of limitation on the number of apps a developer can upload to the apple store. Do you think there will be any problem because the a

  • Error 200140 and 200278 in Finite Retriggerable Encoder Triggered Sampling

    Hello, I have been using a rotary encoder to trigger a retriggerable sampling task. The encoder will give a pulse once per revolution and this will cause Labview to generate a finite pulse train which will be used to sample an analogue channel. The p

  • [Solved]Bash:Subtract a set of numbers from each other in pairs?

    Solution: see my reply. I know the description isn't exact, there really isn't an easy way to describe it with the limits of the title so the circumstances are these: say I have arrays which contain small numbers like so: ex. 12, 7 and 13 I which is

  • Interactive News Letter

    We want to start an interactive news letter in pdf format, we want to have video, audio and flash animations in the news letter, can I do this with In Design ? I tried inserting video but on export the video did not show. Any Ideas I have the full cs