Page 2 of 2 FirstFirst 12
Results 11 to 18 of 18

Thread: Message Driven Bean + Spring: NullPointerException error?

  1. #11
    Join Date
    Aug 2004
    Posts
    2,715

    Default

    First, I recommend to remove the env-entry element again. The proposal was an error, that's why I removed it from my post.

    Second, Try to debug into the "getBeanFactory" invocation. That might provide further clues.

    BTW: I recommend not to overload ejbCreate() and ejbRemove() in your class.

    Regards,
    Andreas

  2. #12

    Default

    Also, you dont have to specify the location in the ejb-jar.xml file; you can code it if you like:

    Code:
    	public void setMessageDrivenContext(MessageDrivenContext messageDrivenContext) {
    		super.setMessageDrivenContext(messageDrivenContext);
    		setBeanFactoryLocator(ContextSingletonBeanFactoryLocator
    				.getInstance(this.beanRefContextLocation));
    		setBeanFactoryLocatorKey(this.beanFactoryName);
    	}

  3. #13
    Join Date
    Oct 2007
    Location
    Vietnam
    Posts
    7

    Default

    Thank you very much!

    I remove the env-entry element, remove ejbCreate and ejbRemove method, remove implements javax.ejb.MessageDrivenBean, javax.jms.MessageListener and EJB is running success!

    Special thanks to Andreas Senft and mdeinum
    Last edited by chinhtd; Nov 14th, 2007 at 12:56 AM.

  4. #14
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,695

    Default

    Your welcome, glad we figured it out.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  5. #15
    Join Date
    Oct 2007
    Location
    Vietnam
    Posts
    7

    Default Other question

    I have a question with my EJB Project. I use Spring and iBatis in this project. At present, to use the two library I do as follow: Extract spring.jar and ibatis.jar files then copy them to ejbModule directory. I would rather you give me another way to use these libraries such as: edit class-path variable and it can point to spring.jar and ibatis.jar. Thank a lot.

  6. #16
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,695

    Default

    Why not simply put them in the root of your ear and add them to the ear classpath. ?!
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  7. #17
    Join Date
    Apr 2006
    Location
    Dresden, Germany
    Posts
    493

    Default

    If you're working with eclipse you can easily achieve this by adding the jar to the "J2EE Module dependencies" page on project properties.

    Regards Ollie

  8. #18
    Join Date
    Oct 2007
    Location
    Vietnam
    Posts
    7

    Default

    I'm working with RAD 6, I have a problem width deployment, when deploy I export my EJB Project to myProject-EAR file but myProject-EAR are no include libraties (spring.jar and ibatis.jar)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •