2 Replies Latest reply on Jul 28, 2010 8:50 AM by deesha

    How to set up persistence to a database??

    deesha

      Hi all, I'm a newbie to all this coding..


      I'm having an issue getting stuff persisted to a database (in PostgreSQL) and I wanted to ask, can anyone give me a breakdown of what modifications i need to do in the .xml files to get this working? or at least point me to a link where it's all explained? I get the feeling I've left something out and thats why it won't work..


      Thanks in advance :)

        • 1. Re: How to set up persistence to a database??
          cosmo

          Although this link is for changing database from hsql to mysql, the steps are the same.
          Also, take into account that we will definitely be able to help you more if you give us more details of your problem.

          • 2. Re: How to set up persistence to a database??
            deesha

            Thanks for replying Aldo. I actually started a new project from scratch and i have the persistence thing down, works like a dream, but now im having an issue with the jms messaging setup. i managed it before but i didnt make notes and now im stumped. i downloaded the jms1.1 folder with lib that contains javax.jms.jar and jms.jar. what i dont know is how to put them in my build path? What seems to be happening is its using the wrong import (org.jboss.seam.jms. instead of javax.jms. ) How do i reference the right file in the build path? (step by step if you know the answer?)


            Thanks for reading this.


            This is the error i get, with what i expect are the excess bits left out...


            13:51:51,489 SEVERE application org.jboss.seam.InstantiationException: Could not instantiate Seam component: messageQueueSender
            javax.faces.el.EvaluationException: org.jboss.seam.InstantiationException: Could not instantiate Seam component: messageQueueSender
                    .......


                    at java.lang.Thread.run(Thread.java:619)
            Caused by: org.jboss.seam.InstantiationException: Could not instantiate Seam component: messageQueueSender
                    ......


            Caused by: org.jboss.seam.InstantiationException: Could not instantiate Seam component: org.jboss.seam.jms.queueSession
                    ... org.jboss.seam.jms.QueueSession.instance(QueueSession.java:55)
                    at org.jboss.seam.jms.ManagedQueueSender.create(ManagedQueueSender.java:51)
                    ....


            Caused by: org.jboss.seam.InstantiationException: Could not instantiate Seam component: org.jboss.seam.jms.queueConnection
                    .... org.jboss.seam.jms.QueueConnection.instance(QueueConnection.java:75)
                    at org.jboss.seam.jms.QueueSession.create(QueueSession.java:38)
                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                    at java.lang.reflect.Method.invoke(Method.java:597)
                    at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
                    at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144)
                    at org.jboss.seam.Component.callComponentMethod(Component.java:2249)
                    at org.jboss.seam.Component.callCreateMethod(Component.java:2172)
                    at org.jboss.seam.Component.newInstance(Component.java:2132)
                    ... 97 more
            Caused by: java.lang.ClassCastException: org.jboss.resource.adapter.jms.JmsConnectionFactoryImpl cannot be cast to javax.jms.QueueConnectionFactory
                    at org.jboss.seam.jms.QueueConnection.getQueueConnectionFactory(QueueConnection.java:64)
                    at org.jboss.seam.jms.QueueConnection.init(QueueConnection.java:51)
            ..
            ....
            Caused by: org.jboss.seam.InstantiationException: Could not instantiate Seam component: messageQueueSender
            ... javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)
                    ... 53 more
            Caused by: org.jboss.seam.InstantiationException: Could not instantiate Seam component: org.jboss.seam.jms.queueSession
            ... org.jboss.seam.jms.QueueSession.instance(QueueSession.java:55)
                    at org.jboss.seam.jms.ManagedQueueSender.create(ManagedQueueSender.java:51)
            ...
            Caused by: org.jboss.seam.InstantiationException: Could not instantiate Seam component: org.jboss.seam.jms.queueConnection
            ... org.jboss.seam.jms.QueueConnection.instance(QueueConnection.java:75)
                    at org.jboss.seam.jms.QueueSession.create(QueueSession.java:38)
                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            ..
            Caused by: java.lang.ClassCastException: org.jboss.resource.adapter.jms.JmsConnectionFactoryImpl cannot be cast to javax.jms.QueueConnectionFactory
                    at org.jboss.seam.jms.QueueConnection.getQueueConnectionFactory(QueueConnection.java:64)
                    at org.jboss.seam.jms.QueueConnection.init(QueueConnection.java:51)