[EJB3] message driven bean, deploy error.

Pagina: 1
Acties:
  • 618 views sinds 30-01-2008
  • Reageer

  • Bastiaan V
  • Registratie: Juni 2005
  • Niet online

Bastiaan V

Tux's lil' helper

Topicstarter
Ik probeer een MBD in de embedded oc4j server van jdeveloper aan de praat te krijgen. Uiteraard wil dit niet lukken, vandaar dit topic. bij het starten krijg ik een No javax.jms.Destination found error (zie hieronder)

Door te googlen kwam ik het volgende tegen:
j2ee/home/config/server.xml:
<jms-config path="./jms.xml"/> is uncommented

j2ee/home/config/jms.xml:
<queue name="Demo Queue" location="jms/demoQueue">
<description>A dummy queue</description>
</queue>
<topic name="Demo Topic" location="jms/demoTopic">
<description>A dummy topic</description>
</topic>
Dit zou moeten kloppen IMHO.
de error:
06/09/21 09:40:55 WARNING: Application.setConfig Application: current-workspace-app is in failed state as initialization failedjava.lang.InstantiationException: Error initializing ejb-modules: No javax.jms.Destination found at the specified destination-location (jms/demoTopic) for MessageDrivenBean MessageLoggerBean
2006-09-21 09:40:55.817 WARNING J2EE JNDI0001 Resource Environment reference ts not found. Allowing J2EEContext creation to continue anyway.
2006-09-21 09:40:55.825 ERROR J2EE EJB3027 [current-workspace-app] An error occured deploying EJB module: java.lang.InstantiationException: No javax.jms.Destination found at the specified destination-location (jms/demoTopic) for MessageDrivenBean MessageLoggerBean
Sep 21, 2006 9:40:55 AM com.evermind.server.Application setConfig
WARNING: Application: current-workspace-app is in failed state as initialization failedjava.lang.InstantiationException: Error initializing ejb-modules: No javax.jms.Destination found at the specified destination-location (jms/demoTopic) for MessageDrivenBean MessageLoggerBean
de code:
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
 package ejb.message;
 
 import java.util.Date;
 
 import javax.annotation.Resource;
 import javax.ejb.ActivationConfigProperty;
 import javax.ejb.MessageDriven;
 import javax.ejb.Timeout;
 import javax.ejb.Timer;
 import javax.ejb.TimerService;
 import javax.jms.Message;
 
 @MessageDriven(activationConfig = {
         @ActivationConfigProperty(propertyName = "connectionFactoryJndiName", propertyValue = "jms/TopicConnectionFactory"),
         @ActivationConfigProperty(propertyName = "destinationName", propertyValue = "jms/demoTopic"),
         @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Topic"),
         @ActivationConfigProperty(propertyName = "messageSelector", propertyValue = "RECIPIENT = 'MDB'")
 
 })
 /**
  * This is a very simple example of a Message-Driven Bean. It listens to the
  * configured JMS Queue or Topic and gets notified via an invocation of it's
  * onMessage() method when a message has been posted to the Queue or Topic. This
  * bean simply prints out the contents of the message.
  */
 public class MessageLoggerBean {
   
 
     @Resource
     javax.ejb.TimerService ts;
     public void onMessage(Message message) {
         System.out.println("onMessage() - " + message);
         try {
 
             String subject = message.getStringProperty("subject");
             String inmessage = message.getStringProperty("message");
             System.out.println("Message received\n\tDate: "
                     + new java.util.Date() + "\n\tSubject: " + subject
                     + "\n\tMessage: " + inmessage + "\n");
             System.out.println("Creating Timer a single event timer");
             // Created a single event timer that expires after 30 secs
             ts.createTimer(30000, subject);
             System.out.println("Timer created by MDB at: "
                     + new Date(System.currentTimeMillis()) + " with info: "
                     + subject);
         }
 
         catch (Throwable ex) {
             ex.printStackTrace();
         }
     }
 
     @Timeout
     public void myTimeout(Timer timer) {
         // Implement Your Business Logic Here
         System.out.println("EJB 3.0: Timer with MDB");
 
         System.out.println("Timeout method called at: "
                 + new Date(System.currentTimeMillis()));
 
         return;
     }
 
 }

  • Janoz
  • Registratie: Oktober 2000
  • Laatst online: 13-02 11:06

Janoz

Moderator Devschuur®

!litemod

Sowieso is dit meer een configuratie probleem van je ontwikkelomgeving. Vandaar de move naar DTE.

Heb je na het aanpassen van de configuratie ook de oc4j instantie herstart?(laatste keer dat ik met jDeveloper gewerkt heb is heel lang terug, maar ik kan me herinneren dat hij blijft draaien totdat je jDeveloper herstart of expliciet aangeeft dat hij moet stoppen)

Weet je daarnaast ook zeker dat je de juiste config aanpast? Het zou best kunnen dat de embedded variant zijn configuratie ergens anders vandaan haalt.

Ken Thompson's famous line from V6 UNIX is equaly applicable to this post:
'You are not expected to understand this'


  • Bastiaan V
  • Registratie: Juni 2005
  • Niet online

Bastiaan V

Tux's lil' helper

Topicstarter
Janoz schreef op donderdag 21 september 2006 @ 13:01:
Sowieso is dit meer een configuratie probleem van je ontwikkelomgeving. Vandaar de move naar DTE.

Heb je na het aanpassen van de configuratie ook de oc4j instantie herstart?(laatste keer dat ik met jDeveloper gewerkt heb is heel lang terug, maar ik kan me herinneren dat hij blijft draaien totdat je jDeveloper herstart of expliciet aangeeft dat hij moet stoppen)

Weet je daarnaast ook zeker dat je de juiste config aanpast? Het zou best kunnen dat de embedded variant zijn configuratie ergens anders vandaan haalt.
daar kwam ik net dus ook achter, ik had een verkeerde config file, blijkt dat alle configfiles 3 (!) keer voorkomen. de juiste zat in:
jdevhome/system/oracle.j2ee.10.1.3.36.73/embedded-oc4j/config

/edit: Alles werkt nu dus zoals het hoort.