Announcement Announcement Module
Collapse
No announcement yet.
Separate database configuration Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Separate database configuration

    Hey guys,

    I've been dealing with this problem for couple of days now and I can't get around to solve it. The working setup that I need is: two separate databases, one for JUnit testing and the other for the pure application access purposes.
    I've been using MySQL for the the application part, since I need the full control and support and the other database that I am considering is Derby or H2 since the speed is essential here.

    Okay, the MySQL database is working as it should, the JUnit tests are 100% success when I run them through
    and there are no problems there. However, when I try to configure my project with the second database, the
    problems arise. I've been searching for answers and I found the following setup when adding additional database to your spring-roo project:

    1. Additional ApplicationContext that I've put in: src/test/resources/META-INF/spring/ and named as: applicationContextTest.xml
    2. As well as additional ApplicationContextSecurity file that I've created in the same folder and named applicationContext-securityTest.xml
    3. Necessary changes in pom.xml, persistence.xml and web.xml files
    4. And also I've configured @ApplicationContext in JUnit test class to use appropriate files
    5. Also separate database_test.properties located in the same folder as mentioned above

    The exception that I am constantly getting is that the EntityManager has not been injected. I know this is a scarce information to work on, but I just want to get few opinions before, lets say, posting the whole code and the files that go along so that you people can see if I have made some silly mistakes(which at this point I am sure I haven't) or that I am missing some additional changes that need to be made.

    Thank you very for your time invested in this.

    Cheers,
    Marko
    Last edited by m4rkoni; May 23rd, 2013, 05:30 PM.

  • #2
    Perhaps including the stacktrace would help.

    Comment


    • #3
      Originally posted by pfurbacher View Post
      Perhaps including the stacktrace would help.
      I've uploaded the stracktrace.txt as an attachment.
      If you open the file with Notepad, just make sure to enable Format->Font Wrap so the text is better organized.

      Comment


      • #4
        I would suggest that you google

        "Spring Aspects JAR configured as an AJC/AJDT aspects library"

        There are a lot of hits for this phrase which appears in your stack trace. I'm not a Roo user so I'm not really able to help here.

        Comment


        • #5
          Originally posted by pfurbacher View Post
          I would suggest that you google

          "Spring Aspects JAR configured as an AJC/AJDT aspects library"

          There are a lot of hits for this phrase which appears in your stack trace. I'm not a Roo user so I'm not really able to help here.
          Thank you. I will give it a try.
          Meanwhile, can anyone that has had similar issues pitch in?

          I've posted the problem on stackoverflow also, with the stack trace in the post, if anyone is not keen on downloading the file.
          Link: http://stackoverflow.com/questions/1...-configuration
          Last edited by m4rkoni; May 24th, 2013, 05:45 PM. Reason: Additional info

          Comment

          Working...
          X