3 Replies Latest reply on Jun 1, 2006 4:10 AM by obn

    ejb3mdb example

    obn

      Hello, i'm currently integrating jboss messaging in my thesis and already have a working client app.
      but on the jboss server side there are still some problems.

      config:
      - jboss 4.0.4GA
      - jboss-messaging-1.0.1.CR2
      - jboss-EJB-3.0_RC6-PFD

      When trying the ejb3mdb example the compile fails with the following errors:

      compile:
       [javac] Compiling 2 source files to M:\filesharing\fh\jboss-messaging-1.0.1.CR2\examples\common\output
       [javac] Compiling 2 source files to M:\filesharing\fh\jboss-messaging-1.0.1.CR2\examples\ejb3mdb\output\classes
       [javac] M:\filesharing\fh\jboss-messaging-1.0.1.CR2\examples\ejb3mdb\src\org\jboss\example\jms\ejb3mdb\EJB3MDBExample.java:11: cannot find symbol
       [javac] symbol : class PostConstruct
       [javac] location: package javax.ejb
       [javac] import javax.ejb.PostConstruct;
       [javac] ^
       [javac] M:\filesharing\fh\jboss-messaging-1.0.1.CR2\examples\ejb3mdb\src\org\jboss\example\jms\ejb3mdb\EJB3MDBExample.java:30: cannot find symbol
       [javac] symbol : method activateConfig()
       [javac] location: @interface javax.ejb.MessageDriven
       [javac] @MessageDriven(activateConfig =
       [javac] ^
       [javac] M:\filesharing\fh\jboss-messaging-1.0.1.CR2\examples\ejb3mdb\src\org\jboss\example\jms\ejb3mdb\EJB3MDBExample.java:32: annotation not valid for a value of type <any>
       [javac] @ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Queue"),
       [javac] ^
       [javac] M:\filesharing\fh\jboss-messaging-1.0.1.CR2\examples\ejb3mdb\src\org\jboss\example\jms\ejb3mdb\EJB3MDBExample.java:33: annotation not valid for a value of type <any>
       [javac] @ActivationConfigProperty(propertyName="destination", propertyValue="queue/testQueue")
       [javac] ^
       [javac] 4 errors
      


      The mdb example works so far, but i'm not able to implement a working mdb in my server-application. it does not listen to incoming messages, maybe i forgot a needed file? already put rfidnodes-service.xml in the deploy directory:

      <?xml version="1.0" encoding="UTF-8"?>
      <server>
      <loader-repository>jboss.messaging:loader=ScopedLoaderRepository
      <loader-repository-config>java2ParentDelegation=false</loader-repository-config>
      </loader-repository>
      <mbean code="org.jboss.jms.server.destination.Queue"
       name="jboss.messaging.destination:service=Queue,name=rfidnodes"
       xmbean-dd="xmdesc/Queue-xmbean.xml">
       <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
       <attribute name="SecurityConfig">
       <security>
       <role name="guest" read="true" write="true"/>
       <role name="publisher" read="true" write="true" create="false"/>
       <role name="noacc" read="false" write="false" create="false"/>
       </security>
       </attribute> <!--
       <attribute name="fullSize">75000</attribute>
       <attribute name="pageSize">2000</attribute>
       <attribute name="downCacheSize">2000</attribute>
       -->
      </mbean>
      </server>
      


      Thanks in advance, great product & helpful forum

        • 1. Re: ejb3mdb example
          obn

          The first error is resolved in that post:
          http://www.jboss.com/index.html?module=bb&op=viewtopic&t=80873[/url]

          • 2. Re: ejb3mdb example
            ovidiu.feodorov

            The example's documentation clearly warns about this kind of occurrences:

            Note: The current example was tested with JBoss EJB 3.0 RC5 - PFD but more recent EJB3 versions are liable to introduce API changes that may break the example. If this is the case, please modify the example accordingly. Most likely, you will only need to modify the import fully qualified class names.


            (Quoted from the README.html that ships with the example)

            I think the paragraph above just answered your question.

            • 3. Re: ejb3mdb example
              obn

              Thanks - that's it, i just had to change two points in EJB3MDBExample.java:

              PostConstruct moved to javax.annotation

              //import javax.ejb.PostConstruct;
              import javax.annotation.PostConstruct;
              

              and
              //@MessageDriven(activateConfig =
              @MessageDriven(activationConfig =
              



              - Oliver