4 Replies Latest reply on Jul 30, 2012 3:17 AM by Max Rydahl Andersen

    Eclipse works, Run doesn't?

    Matt Stockbridge Newbie

      I've run into an interesting (read: "agrivating") problem: I can run an instance of JBoss with my .ear just fine from Eclipse using the JBoss tools, but if I try to deploy it by throwing what's in the deploy folder in the Eclipse project into the default/deploy folder in JBoss and running using run.conf.bat I run into some rather nasty JMS problems with one of four queues:


      10:50:51,750 ERROR [org.hornetq.ra.HornetQRASessionFactoryImpl] Could not create session: javax.jms.IllegalStateException: Only allowed one session per connection. See the J2EE spec, e.g. J2EE1.4 Section 6.6

          at org.hornetq.ra.HornetQRASessionFactoryImpl.allocateConnection(HornetQRASessionFactoryImpl.java:816) [:6.1.0.Final]


      This, of course, doesn't happen in Eclipse using the JBoss tools. There is literally nothing else (as far as applications not provided by JBoss) on the server. This has worked in the past, but due to the fact that the project in question is being developed quickly and without much support for infrastructure (read: There's one person on it and no supporting resources) determining what's gone wrong is less about rolling back (which might work, but, since I haven't identified the actual problem, might not) and more about process of elimination.


      So, why would launching from Eclipse using the tools prevent the above error? Why would that error happen in the first place if the only things referencing the queue are one bean that sends messages in and one that takes them out (a paradigm that works for the other three queues without producing the error)? And, possibly the most unanswerable, why would it previously have worked and not be working now?


      I know the typical response is to post everything. I can't do that. But I can post parts. I'm using vanilla JBoss 6.1.0 Final, Eclipse Java EE IDE Indigo SR1, JBoss Seam Tools for Eclipse 3.3.0.v20120302-2019-H81-Beta1, and Java 7.

      I've got four queues, in addition to DLQ and ExpiryQueue:



      <component class="org.jboss.seam.jms.ManagedQueueSender" name="dispatchQueueSender">

        <property name="queueJndiName">/queue/RnD/dispatch</property>


      <component class="org.jboss.seam.jms.ManagedQueueSender" name="scheduleQueueSender">

        <property name="queueJndiName">/queue/RnD/schedule</property>


      <component class="org.jboss.seam.jms.ManagedQueueSender" name="registerQueueSender">

        <property name="queueJndiName">/queue/RnD/register</property>


      <component class="org.jboss.seam.jms.ManagedQueueSender" name="resultsQueueSender">

        <property name="queueJndiName">/queue/RnD/results</property>





         <queue name="DnR Dispatch">

            <entry name="/queue/RnD/dispatch"/>



         <queue name="DnR Scheduling">

            <entry name="/queue/RnD/schedule"/>



         <queue name="DnR Registration">

            <entry name="/queue/RnD/register"/>



         <queue name="DnR Results">

            <entry name="/queue/RnD/results"/>



      I'm using hibernate in my project with MySQL, and everything is configured as an .ear (with ejb's and a .war inside).


      Any thoughts?



        • 1. Re: Eclipse works, Run doesn't?
          Denis Golovin Master

          JBoss Tools seems to start server with different parameters/settings. You can see actuall command in debug view through Properties popup menu on server istance




          1 of 1 people found this helpful
          • 2. Re: Eclipse works, Run doesn't?
            Rob Stryker Master

            You can also see what command is being launched, and even change it, by double-clicking your server to open the server editor, and then clicking "Open Launch Configuration". 


            This will allow you to change and customize the launch args. Not all args are changeable though, and some will be overwritten. Specifically things pointing to urls inside the server such as server.base.url etc.

            • 3. Re: Eclipse works, Run doesn't?
              Matt Stockbridge Newbie

              So, the short answer is that running with "javaw" instead of "java" eliminates the error. From what I know the only appreciable difference is that javaw lacks a console. Is there anything else that is different between java and javaw that would explain why it's not working in java?


              We'd prefer to not have to go to javaw since it'd require us taking on a different logger to get our logging done, and we'd perfer to use the logger JBoss provides.



              • 4. Re: Eclipse works, Run doesn't?
                Max Rydahl Andersen Master

                Another diference between using command line and JBoss tools is that you might be deploying compressed archives on command line and exploded archives in JBoss Tools.


                You can test if that has any effect by changing the server settings (double click on the server in eclipse, get the sever editor) and enable the "Deploy compressed archives".


                Concerning java vs javaw then yes the only difference should be the console but JBoss logger does not require a console - it can log to files too.


                p.s. Questions concerning specifics about JBoss AS/hornetq and how it might be affected by java vs javaw is best ansked for in the jboss as/hornetq forums.