Getting remote messaging to work with Java/Spring and Flex

I am trying to get remote messaging working on a Flex client with a Java/Spring backend.
I have the channel is setup on the server as such:

channel-definition id="long-polling-channel"
class="mx.messaging.channels.AMFChannel">
<endpoint
url="http://{server.name}:{server.port}/{context.root}/messagebroker/amflongpolling"
class="flex.messaging.endpoints.AMFEndpoint" />
<properties>
<!-- Values for near-real time messaging -->
<polling-enabled>true</polling-enabled>
<polling-interval-millis>0</polling-interval-millis>
<wait-interval-millis>-1</wait-interval-millis>
<max-waiting-poll-requests>
10
</max-waiting-poll-requests>
</properties>
</channel-definition>
In the Spring context, I am setting up the MessageBroker, MessageTemplate, and some custom wrapper code:
<? 
xml version="1.0" encoding="UTF-8"?>< 
beans xmlns="http://www.springframework.org/schema/beans"
xmlns:flex="http://www.springframework.org/schema/flex" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/flex
http://www.springframework.org/schema/flex/spring-flex-1.0.xsd" >
<flex:message-broker id="messageServiceBroker" />
<flex:message-destination id="event-bus"
message-broker="messageServiceBroker" channels="long-polling-channel"
message-time-to-live="1000"
subscription-timeout-minutes="5"
throttle-inbound-max-frequency="500" throttle-inbound-policy="ERROR"
throttle-outbound-max-frequency="500" throttle-outbound-policy="IGNORE" />
<bean id="defaultMessageTemplate" class="org.springframework.flex.messaging.MessageTemplate">
<property name="defaultDestination" value="event-bus" />
<property name="messageBroker" ref="messageServiceBroker" />
</bean>
<bean id="MessagingServices" class="com.bofa.esm.utility.messaging.MessagingServices">
<property name="messageTemplate" ref="defaultMessageTemplate" />
<property name="destinationName" value="event-bus" />
<property name="scheduler" ref="PersistentQuartzScheduler" />
</bean></ 
beans>
The custom wrapper code is insignificant, but it basically creates a thread and posts a custom context over and over every minute.  The actual message is posted with this bit of code:
     messageTemplate.send(msgCtx);
On the Flex side, I create a Channel and ChannelSet like thus:
public  
static function getMessageChannelSet():ChannelSet{ 
if(messageChannelSet == null){messageChannelSet =
new ChannelSet();
//e.g. 'http://{server.name}:{server.port}/{context.root}/messagebroker/amfpolling';
var messageURL:String = getBaseUrl() + MESSAGE_URL; 
var channel:AMFChannel = new AMFChannel(MESSAGE_CHANNEL_NAME,messageURL);messageChannelSet.addChannel(channel);
return channelSet;}
And then, latter I create a Consumer and add the channelset to it:
var  
_messageConsumer:Consumer = new Consumer(); 
var msgChannel:ChannelSet = RemotingUtility.getMessageChannelSet();
var encrypted:Object = this.encrypt(_sessionModel.username, _sessionModel.password); 
var token:AsyncToken = msgChannel.login(encrypted.userId, encrypted.password); 
_messageConsumer.channelSet = msgChannel;
_messageConsumer.destination =
"event-bus";_messageConsumer.addEventListener(MessageEvent.RESULT,
this.onMessage);
The problem is, I dont get the messages from the server.  In fact, from what I can tell by the logs when I post a message from the server, it doesn't appear that anything is listening to the channel:
09:32:03,106 INFO [MessagingServices] Posting message...
09:32:08,184 INFO [STDOUT] [BlazeDS]Before invoke service: message-service
incomingMessage: Flex Message (flex.messaging.messages.AsyncMessage)
clientId = CC2B0D5D-B00A-CD8B-CE43-0430C8CC10DF
correlationId = null
destination = event-bus
messageId = CC3211B4-F80E-15FE-076C-00C963ED5D01
timestamp = 1278595928184
timeToLive = 0
body = com.bofa.esm.utility.messaging.SimpleMessageContext@159a771
09:32:08,200 INFO [STDOUT] [BlazeDS]Before invoke service: message-service
incomingMessage: Flex Message (flex.messaging.messages.AsyncMessage)
clientId = CC2B0D5D-B00A-CD8B-CE43-0430C8CC10DF
correlationId = null
destination = event-bus
messageId = CC3211B4-F80E-15FE-076C-00C963ED5D01
timestamp = 1278595928184
timeToLive = 0
body = com.bofa.esm.utility.messaging.SimpleMessageContext@159a771
09:32:08,200 INFO [STDOUT] [BlazeDS]Sending message: Flex Message (flex.messaging.messages.AsyncMessage)
clientId = CC2B0D5D-B00A-CD8B-CE43-0430C8CC10DF
correlationId = null
destination = event-bus
messageId = CC3211B4-F80E-15FE-076C-00C963ED5D01
timestamp = 1278595928184
timeToLive = 1000
body = com.bofa.esm.utility.messaging.SimpleMessageContext@159a771
to subscribed clientIds: []
09:32:08,200 INFO [STDOUT] [BlazeDS]Sending message: Flex Message (flex.messaging.messages.AsyncMessage)
clientId = CC2B0D5D-B00A-CD8B-CE43-0430C8CC10DF
correlationId = null
destination = event-bus
messageId = CC3211B4-F80E-15FE-076C-00C963ED5D01
timestamp = 1278595928184
timeToLive = 1000
body = com.bofa.esm.utility.messaging.SimpleMessageContext@159a771
to subscribed clientIds: []
09:32:08,200 INFO [STDOUT] [BlazeDS]After invoke service: message-service; execution time = 0ms
09:32:08,200 INFO [STDOUT] [BlazeDS]After invoke service: message-service; execution time = 0ms
09:32:08,200 INFO [STDOUT] [BlazeDS]After invoke service: message-service
reply: null
09:32:08,200 INFO [STDOUT] [BlazeDS]After invoke service: message-service
reply: null
09:32:12,075 INFO [STDOUT] [BlazeDS]Before invoke service: message-service
incomingMessage: Flex Message (flex.messaging.messages.AsyncMessage)
clientId = CC2B0D5D-B00A-CD8B-CE43-0430C8CC10DF
correlationId = null
destination = event-bus
messageId = CC3236D0-7B0D-182C-5632-C84FB4D1E215
timestamp = 1278595932075
timeToLive = 0
body = com.bofa.esm.utility.messaging.SimpleMessageContext@1a6595b
09:32:12,075 INFO [STDOUT] [BlazeDS]Before invoke service: message-service
incomingMessage: Flex Message (flex.messaging.messages.AsyncMessage)
clientId = CC2B0D5D-B00A-CD8B-CE43-0430C8CC10DF
correlationId = null
destination = event-bus
messageId = CC3236D0-7B0D-182C-5632-C84FB4D1E215
timestamp = 1278595932075
timeToLive = 0
body = com.bofa.esm.utility.messaging.SimpleMessageContext@1a6595b
09:32:12,075 INFO [STDOUT] [BlazeDS]Sending message: Flex Message (flex.messaging.messages.AsyncMessage)
clientId = CC2B0D5D-B00A-CD8B-CE43-0430C8CC10DF
correlationId = null
destination = event-bus
messageId = CC3236D0-7B0D-182C-5632-C84FB4D1E215
timestamp = 1278595932075
timeToLive = 1000
body = com.bofa.esm.utility.messaging.SimpleMessageContext@1a6595b
to subscribed clientIds: []
09:32:12,075 INFO [STDOUT] [BlazeDS]Sending message: Flex Message (flex.messaging.messages.AsyncMessage)
clientId = CC2B0D5D-B00A-CD8B-CE43-0430C8CC10DF
correlationId = null
destination = event-bus
messageId = CC3236D0-7B0D-182C-5632-C84FB4D1E215
timestamp = 1278595932075
timeToLive = 1000
body = com.bofa.esm.utility.messaging.SimpleMessageContext@1a6595b
to subscribed clientIds: []
09:32:12,075 INFO [STDOUT] [BlazeDS]After invoke service: message-service; execution time = 0ms
09:32:12,075 INFO [STDOUT] [BlazeDS]After invoke service: message-service; execution time = 0ms
09:32:12,075 INFO [STDOUT] [BlazeDS]After invoke service: message-service
reply: null
09:32:12,075 INFO [STDOUT] [BlazeDS]After invoke service: message-service
reply: null
Shouldn't the "subscribed clientIds: []" have something listed as subscribed?  What am I missing?

I made some modifications to the code section that registers the Consumer:
  Alert.show(
"onRegister running","AppShellMediator",Alert.OK); 
  var _messageConsumer:Consumer = new Consumer(); 
  var msgChannel:ChannelSet = RemotingUtility.getMessageChannelSet();  _messageConsumer.channelSet = msgChannel;
  _messageConsumer.destination =
"event-bus";  _messageConsumer.addEventListener(MessageEvent.RESULT,
this.onMessage);  _messageConsumer.subscribe(
"MessagingClient"+Math.random()); 
if(_messageConsumer.connected)      Alert.show(
"Message Channel is connected","AppShellMediator",Alert.OK); 
  if(_messageConsumer.authenticated)      Alert.show(
"Message Channel is authenticated","AppShellMediator",Alert.OK); 
  if(_messageConsumer.subscribed)      Alert.show(
"Message Channel is subscribed, clientId: "+_messageConsumer.clientId,"AppShellMediator",Alert.OK);
I am now calling the subscribe method, then testing to see if the consumer is connected, authorized, and subscribed.  The first two return True, the last one does not.  So, despite the call to subscribe(), the Consumer is not subscribed.  Is there a way to figure out why?  Possibly there was an error somewhere?

Similar Messages

  • Sdk 3b Remote Objects not working with java 1.6.29

    So I am not sure if this is java specific or if there is anything in Flex I can do.
    I am working on a project that communicates with the java back end via the AMF channels / Consumer objects and Remote Objects. Usking SDK 3b
    In Java 1.6.26 and java 1.7 it works fine.  However in java 1.6.29 The remote objects seem to not get called/communicated/execute on the java server side. 
    Interesting thing to note is that the consumer/AMF feeds are still able to function.
    Was there any change that Adobe has documented that may have caused this to happen when they changed the java version? or any solution around this as a requirement is to use 1.6.29?

    So it aprears that it works via MXML however when I try to define it in actionscript it recieves no events, messages, etc.  Looking at the serverside print statements it appears the call never goes through.

  • Problem getting MySQL driver to work with JAVA

    Hi
    I have downloaded this driver for MySQL 'mysql-connector-java-3.0.16-ga-bin.jar' what should I do with this to make it work with my instalation of jdk1.3.1_15?
    I have placed it in the folder C:\jdk1.3.1_15\lib but I am getting the following error on compilation:
    MyClass.java:9: <identifier> expected
    Class.forName("com.mysql.jdbc.Driver").newInstance();
    ^
    MyClass.java:9: cannot resolve symbol
    symbol : class forName
    location: class java.lang.Class
    Class.forName("com.mysql.jdbc.Driver").newInstance();
    ^
    2 errors
    or am i doing something else wrong?

    Here's a snippet of the code I am using if this helps
    import java.util.*;
    import java.sql.*;
    class MyClass{
         Class.forName("com.mysql.jdbc.Driver").newInstance();
             Connection connection = DriverManager.getConnection("jdbc:mysql://localhost/myDB?user=admin&password=admin", "", "");
         Statement statement = connection.createStatement();
         public void MyClass(){
                  // count the number of records in the database table
              ResultSet rsCount = statement.executeQuery("SELECT COUNT(*) AS tCount FROM myTable");     
              rsCount.first();
              int tCount = rsCount.getInt("tCount");
              rsCount.close();
    }

  • WD Elements external hard drive getting 1 drive to work with 10.4 and 10.5

    I have a WD 2TB Elements new drive ready to start using. Anyone know the tricks to be able to get this drive to work right with 10.4 Power PC AND 10.5 Mac Pro? I have another WD drive (same type, the "Elements") and it won't copy most files that were made on my 10.5 machine. It was formatted on the 10.4 machine and I may not have formatted it right.  Works fine on the 10.4 machine but when I use that drive on the 10.5 Mac Pro, it often doesn't like files made on 10.4, and vice versa. Is it impossible to get the WD to be compatible with both or am I stuck dedicating the new drive to either the 10.4 or the 10.5 exclusively?  I've only had this compatibility issue with WD drives. No problems like this with Seagate and other brands. Also do not have this problem with WD's tiny 750GB drive that is powered by USB. That one works like a charm.  So I'm wondering if I just need to reformat it correctly - maybe I didn't get the partioning right-- however I have read comments by others who have had the same problem with WD Elements drives.  A -36 Error message pops up and the drive will not copy the file, and then it craps out and you cannot see the files listed - it goes blank. Then the only way to quit the drive is to pull the USB or power cord and kill it - then put it back in right away.  Force Quitting by relaunching Finder still doesn't allow a Trashing of the drive - has to be done by yanking out the connection or the power.

    These are what WD lists for Mac, so no I wouldn't buy WD Elements and while their drives are fine, I don't recommend any external or MyBook series.
    http://www.wdc.com/en/products/external/desktopformac/
    G4 uses one partition map and Intel Macs use GUID.
    Your actions are contributing to directory corruption, pulling plug and killing power to the unit.

  • Can't get my facetime to work with my mac and my wifes i phone touch

    my face time does not work with my macbook connecting to my wifes i phone touch and we are in the same room she calls me my mac rings then cuts straight off. My mac will not connect to hers at all

    Out of curiosity, are you trying to connect each device using the same account? If so, the devices may be getting confused on which one it's calling from and which one it should be trying to contact. You'd need two separate accounts/numbers in order for this to work.
    For example my Macbook Pro's factime connection is using [email protected] as a host, and my iPhone is using it's cell number xxx-xxx-xxxx. If I click on my number from my Macbook Pro, it rings my iPhone for a Facetime. Or if I tap on my email address (associated with Facetime for the Macbook Pro) from my iPhone, it starts the Facetime and my Macbook Pro will ring.
    If this is not the right answer, please respond with more detail on how you have your connection set up.
    Cheers!

  • How do you set the remote only to work with the MacBook and not the Hi-Fi.

    I have a Hi-Fi Apple stereo hooked up to my Macbook but when I use the Apple remote, it controls both things.
    So if I am scrolling through my music in Frontrow then the volume on the Hi-Fi stereo is turning down or up depending on which way I am scrolling.
    My question is:
    How do I make the remote work with only my MacBook?

    Pair the remote with your macbook by isolating it point the remote at it while holding down the menu and next buttons. You see like a chain appear and that will mean the remote is paired. Now only the macbook will only respond to the macbooks remote. Do the same with the Hi-Fi remote and now the hi-fi will only work with the hi-fi remote.

  • HT1555 Two remotes - Both still work with Apple TV and MBP despite pairing

    I have a MBP (early 2011 13") and Apple TV. Therefore, I paired one remote with my MBP and the other remote with Apple TV. Both parings have been successfull (chain icon) but still both remotes can be used on both devices. How can I resolve this issue? (and no, I don't want to disable the IR on my MBP)
    Is it possible that the two remotes have by coincidence the same ID?

    I am sure that I have done that correctly. Apple TV and MBP states that a remote has been paired, but still both work on both devices. Is it possible that both remotes have the same ID (by coincidence)?

  • How to get remote ejb client working with Weblogic 8.1?

    I have Weblogic 8.1 running on a WinXP box behind my firewall. Port 7001 is open to WL and remote browsers can access the console.
    I have a client machine running WinXP on a different network that is remote to the WL server. It can ping the WL server machine.
    I use JVM 1.4.2_08 on all machines.
    If I put my client machine on the LAN with the WL server, then my EJB test client works fine. If I put the client machine on the remote network then the test client fails with a ClassCastException when trying to do a PortableRemoteObject.narrow on the bean home.
    I had this running fine on JBoss 3.22 using RMI over HTTP. I added an HTTP invoker service to my jboss.xml file. I don't know if something similar is needed on the Weblogic side - any ideas on that? All I've done on the WL side is turn on Tunneling - which obviously works because the remote client gets a correct home object when doing a lookup on the bean - based on the IOR string of the home obj.
    Below I include my client code, exception, ejb-jar.xml and my weblogic-ejb-jar.xml.
    Any ideas on what else needs to be done so that a remote client can do a PortableRemoteObject.narrow? My client.jar has all of the EJB classes, and runs fine when run from LAN.
    Thanks,
    --BobC
    Client Code
    Properties p = new Properties();
    p.put("java.naming.factory.initial", "weblogic.jndi.WLInitialContextFactory");
    p.put("java.naming.provider.url", "http://66.114.140.213:7001");
    InitialContext ic = new InitialContext(p);
    // Test register bean
    Object homeObj = ic.lookup("tacplanner/register");
    RegisterHome home = (RegisterHome) PortableRemoteObject.narrow(homeObj, RegisterHome.class); // <<< ClassCastException here
    Exception
    java.lang.ClassCastException
    at com.sun.corba.se.internal.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:293)
    at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:134)
    at com.nimblus.tacplanner.test.TestUtils.<init>(TestUtils.java:60)
    at com.nimblus.tacplanner.test.TestUtils.main(TestUtils.java:196)
    ejb-jar.xml
    <?xml version="1.0"?>
    <!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN' 'http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd'>
    <ejb-jar>
    <enterprise-beans>
    <session>
    <ejb-name>register</ejb-name>
    <home> com.nimblus.tacplanner.server.ejb.stateless.RegisterHome</home>
    <remote> com.nimblus.tacplanner.server.ejb.stateless.Register</remote>
    <ejb-class>com.nimblus.tacplanner.server.ejb.stateless.RegisterSession</ejb-class>
    <session-type>Stateless</session-type>
    <transaction-type>Container</transaction-type>
    <resource-ref>
    <description>The Oracle Datasource</description>
    <res-ref-name>java:/OracleDS</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    </session>
    </enterprise-beans>
    <assembly-descriptor>
    <container-transaction>
    <method>
    <ejb-name>register</ejb-name>
    <method-name>*</method-name>
    </method>
    <trans-attribute>Required</trans-attribute>
    </container-transaction>
    </ejb-jar>
    weblogic-ejb-jar.xml
    <?xml version="1.0"?>
    <!DOCTYPE weblogic-ejb-jar PUBLIC
    '-//BEA Systems, Inc.//DTD WebLogic 8.1.0 EJB//EN'
    'http://www.bea.com/servers/wls810/dtd/weblogic-ejb-jar.dtd'>
    <weblogic-ejb-jar>
    <weblogic-enterprise-bean>
    <ejb-name>register</ejb-name>
    <stateless-session-descriptor>
    <pool>
    <max-beans-in-free-pool>100</max-beans-in-free-pool>
    </pool>
    </stateless-session-descriptor>
    <reference-descriptor>
    <resource-description>
    <res-ref-name>jdbc/OracleDS</res-ref-name>
    <jndi-name>OracleDS</jndi-name>
    </resource-description>
    </reference-descriptor>
    <enable-call-by-reference>True</enable-call-by-reference>
    <jndi-name>tacplanner/register</jndi-name>
    </weblogic-enterprise-bean>
    </weblogic-ejb-jar>
    --------------------

    Problem solved.
    For remote clients you need to generate and use the stub classes for EJB interfaces using Weblogic's appc utility.
    See: "http://e-docs.bea.com/wls/docs81/ejb/appc_ejbc.html#1151900"
    --BobC                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How do I get the messaging to work with Mountain Lion?

    I downloaded Mountain Lion.  So far everything seems to be working properly but I can't seem to use the new messaging feature.  I click on the message icon.....I can access my contacts (although it gives me NO choice of email address - seems to only pick AOL).  I've tested it and the recipient doesn't receive the message nor do I see the message on any of  my other devices.  It's like something isn't syncing.  Was I supposed to do something to start it......perhaps turn on a setting?   anybody??  thanks. 

    Open Messages, select Messages from the App Menu and go to preferences.
    Under accounts, you should have an iMessage account linked to your AppleID or iCloud account.
    You may also need to click "enable this account" checkbox

  • Messages not working with iOS8, Yosemite, and Android

    I am running a MBA with Yosemite. I also have several iOS devices (IPhone 6, iPad Mini, iPad 2Gen).  I have gone over the set up time and time again and believe it to be correct.  However, some (not all) messages to Android (presumably) devices fail.  I also am not sure if I am receiving all messages.
    Example: My son initiated a text to me tonight and it came through. I received it on my MBA and was able to reply from my MBA. He responded fine, but my response failed (see screen cap).  This is the same behavior on the iPhone 6 as well.  He is running an HTC brand new latest Android phone on Verizon.  My plan is also on Verizon and I have Verizon for my WiFi as well.  Another friend has a crappy Android that was bought at Walmart and has some lower tier cell carrier and I get a similar behavior there.
    Any suggestions?

    Hi,
    After setting up the iPhone and the Mac they should remain in fairly close contact as the Mac uses the iPhone's Carrier service to send the SMS.
    Whilst the setting up does not mention it the procedure looks a lot like Pairing Blue Tooth devices which gives you a range of 30 feet or so depending on surroundings.
    Having said that the specs say they two should be on the same WiFi Network (or network that the iPhone is WiFi Connected to be be correct) which would also limit coverage somewhat but  larger area than Blue Tooth.
    You then have to decide if it is possible your son went out of range of a suitable carrier service or whether your phone was moved too far form your Mac.
    If both your Mac and the iPhone are not maintaining the connection it would seem it is at the far end that the issue is happening.
    Is your son's phone maintaining:-
    1) Connection to a suitable service ?
    2) an SMS ability during that connection ?
    9:42 PM      Saturday; December 6, 2014
    ​  iMac 2.5Ghz i5 2011 (Mavericks 10.9)
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb (Snow Leopard 10.6.8)
     Mac OS X (10.6.8),
     Couple of iPhones and an iPad

  • How to get Surround Sound to work With Itunes 7 and Stop Skipping

    A common problem for surround sound with itunes 7 appears to come from Creative sound cards. The way to fix this problem is to right click on the volume icon in the taskbar and open the EAX Console. Open the CMSS 3D tab and check the box that says Enable CMSS 3D and set both CMSS and CMSS2 to 0% in the stereo focus slider. It should work. Remember to have the volume slider in itunes at 100%.
    If that doesn't work then open the quicktime preferences in the controlpanel/quicktime. Then go to the audio tab, uncheck the safe mode box. Set the rate to 64 kHz and the size to 16 bit. Then set the channels to 5.1
    This should all make it work, after hours of struggling i've found these successful settings and am loving it!
    For those of you who have sound skipping during transitions----
    Go to the preferences of Itunes and go to the Playback tab, disable the crossfading between songs and you should play skip free!!!!

    bump

  • My MacBook Pro is not showing it's connected but it is, my messages stopped working with my iPhone and is locking me out of my mail accounts

    II'm having so much trouble with my MacBook Pro.
    1. The wifi is not showing it's connected but it is
    2. I used to be able to use messages as iMessage from my phone- that randomly stopped
    3. It alerted gmail to lock my account.
    Please help!

    Log out, log back in, and try again.

  • How do i get home share to work with ios 6 and pc Itunes 10.7

    I have update all my devices to ios 6 and pc to itunes 10.7, however since then i can not use home share to share music over my network with any of my devices.  Can anyone help Please.
    Pablo

    Did you already try to reset the phone by holding the sleep and home button for about 10sec, until the Apple logo comes back again?
    Did you already try the troubleshooting mentioned in this article?
    iOS: Troubleshooting FaceTime and iMessage activation

  • Geting remote management example work with 1.5 jconsol.exe

    Hello, I had a difficulty getting remote manegement exaple work with jconsole.
    I follow the guidence of:
    http://java.sun.com/developer/technicalArticles/J2SE/jmx.html
    Working with HTTP adaptor going fine,
    Tring to invoke example with jconsole.exe produces exception (the situation happens unsing jre 1.4 and 1.5):
    the code:
    public class Server {
        public static void main(String[] args) {
            try {
                // Instantiate the MBean server
                System.out.println("\nCreate the MBean server");
                MBeanServer mbs = MBeanServerFactory.createMBeanServer();
                // Create a JMXMP connector server
                System.out.println("\nCreate a JMXMP connector server");
                JMXServiceURL url = new JMXServiceURL("jmxmp", null, 5551);
                JMXConnectorServer cs =
                    JMXConnectorServerFactory.newJMXConnectorServer(url, null, mbs);
                // Start the JMXMP connector server
                System.out.println("\nStart the JMXMP connector server");
                cs.start();
                System.out.println("\nJMXMP connector server successfully started");
                System.out.println("\nWaiting for incoming connections...");
            } catch (Exception e) {
                e.printStackTrace();
    }consol:
    Create the MBean server
    Create a JMXMP connector server
    Start the JMXMP connector server
    JMXMP connector server successfully started
    Waiting for incoming connections...
    20/03/2007 10:54:51 GenericConnectorServer ClientCreation.run
    WARNING: Failed to open connection: java.io.StreamCorruptedException: invalid stream header
    java.io.StreamCorruptedException: invalid stream header
         at java.io.ObjectInputStream.readStreamHeader(Unknown Source)
         at java.io.ObjectInputStream.<init>(Unknown Source)
         at com.sun.jmx.remote.socket.SocketConnection$ObjectInputStreamWithLoader.<init>(SocketConnection.java:354)
         at com.sun.jmx.remote.socket.SocketConnection.readMessage(SocketConnection.java:204)
         at com.sun.jmx.remote.opt.security.AdminServer.connectionOpen(AdminServer.java:76)
         at com.sun.jmx.remote.generic.ServerSynchroMessageConnectionImpl.connect(ServerSynchroMessageConnectionImpl.java:58)
         at javax.management.remote.generic.GenericConnectorServer$ClientCreation.run(GenericConnectorServer.java:405)
         at com.sun.jmx.remote.opt.util.ThreadService$ThreadServiceJob.run(ThreadService.java:208)
         at com.sun.jmx.remote.opt.util.JobExecutor.run(JobExecutor.java:59)Any ideas ?
    10X
    Message was edited by:
    KIRPICH79

    Hi,
    We belive that you used the default connector RMIConnector in your jconsole to connect your JMXMP connector server.
    What you should do is to:
    1) start your jconsole with the jmxmp classes:
    jconsole -J-Djava.class.path=JAVA_HOME/lib/jconsole.jar:JAVA_HOME/lib/tools.jar:jmxremote_optional.jar
    (see http://java.sun.com/javase/6/docs/technotes/guides/management/jconsole.html)
    2) specify your server url address in the jconsole connecting window:
    service:jmx:jmxmp://boat:5551
    you should substitue "boat" to your host name
    3)connect
    Hope this helps and let's know if you still have problem.
    Shanliang JIANG
    SUN JavaSE/JMX team

  • Mapping editor not working with Java 5 classes

    I have a small protoype web service which I wrote using Tomcat/Axis/Spring/Hibernate and using EJB3 annotations for the mappings. I want to port the persistence layer to Toplink.
    I installed Toplink 9.0.4.1 and added the toplink libraries to my project and implemented the DAO and the spring bean defs.
    I opened the mapping editor and created a project. When I try to add classes to it for mapping I get an error that it can't find the classes (even though I selected them from the chooser). I figured it might be that they were compiled with Java 5, so I switched the JRE_HOME in setenv.cmd to my Java 5 JRE. Now I can import the classes and see the attributes but when I click on any of them in the Navigator panel, the editor panel remains blank. If I now try to save, I get:
    java.lang.NullPointerException
         at oracle.toplink.workbench.ui.tools.CheckListModel.getRowCount(CheckListModel.java:119)
         at javax.swing.JTable.checkLeadAnchor(JTable.java:2949)
         at javax.swing.JTable.tableChanged(JTable.java:2993)
         at javax.swing.JTable.setModel(JTable.java:2827)
         at oracle.toplink.workbench.ui.tools.CheckList.initialize(CheckList.java:47)
         at oracle.toplink.workbench.ui.tools.CheckList.<init>(CheckList.java:26)
    It seems that the mapping workbench doesnt work with Java 5. What should I do?

    Ah, I see. I saw another post here stating that must use 10.1.3.

Maybe you are looking for