7 Replies Latest reply on Dec 2, 2005 3:17 AM by danial79

    MySQL and Portal Hybernate error

    rgjawanda

      I followed the instructions for getting Portal to work with mysql
      mysql 4.1

      portal 2.0

      I tried to force manual hybernate configuration

      org.hibernate.dialect.MySQLDialect

      in the hybernate.cfg.xml

      Here is the exceptoin trace

      Note: I previously tried to do this without manual hybernate but it also failed.


      Any ideas?



      This is my portal-mysql-ds.xml file for portal



      <?xml version="1.0" encoding="UTF-8"?>

      <local-tx-datasource>
      <jndi-name>PortalDS</jndi-name>
      <connection-url>jdbc:mysql://localhost:3306/jbossportal?useServerPrepStmts=false</connection-url>
      <driver-class>org.gjt.mm.mysql.Driver</driver-class>
      <user-name>root</user-name>
      a1b2c3
      </local-tx-datasource>






      t EventContext
      16:16:45,616 INFO [NamingHelper] JNDI InitialContext properties:{}
      16:16:45,616 INFO [SessionFactoryImpl] Checking 0 named queries
      16:16:45,616 INFO [SessionFactoryBinder] Hibernate dialect used org.hibernate.d
      ialect.MySQLInnoDBDialect
      16:16:46,381 ERROR [SessionFactoryBinder] Starting failed portal:service=Hiberna
      te
      java.lang.NullPointerException
      at com.mysql.jdbc.PreparedStatement.asSql(PreparedStatement.java:562)
      at com.mysql.jdbc.PreparedStatement.asSql(PreparedStatement.java:504)
      at com.mysql.jdbc.PreparedStatement.toString(PreparedStatement.java:3228
      )
      at java.lang.String.valueOf(String.java:2131)
      at java.lang.StringBuffer.append(StringBuffer.java:370)
      at com.mysql.jdbc.trace.Tracer.printParameters(Tracer.aj:240)
      at com.mysql.jdbc.trace.Tracer.printEntering(Tracer.aj:167)
      at com.mysql.jdbc.trace.Tracer.entry(Tracer.aj:126)
      at com.mysql.jdbc.trace.Tracer.ajc$before$com_mysql_jdbc_trace_Tracer$1$
      f51c62b8(Tracer.aj:45)
      at com.mysql.jdbc.Connection.registerStatement(Connection.java)
      at com.mysql.jdbc.Statement.(Statement.java:190)
      at com.mysql.jdbc.PreparedStatement.(PreparedStatement.java:429)
      at com.mysql.jdbc.Connection.clientPrepareStatement(Connection.java:2063
      )
      at com.mysql.jdbc.Connection.clientPrepareStatement(Connection.java:1996

        • 1. Re: MySQL and Portal Hybernate error

          What version of AS? 4.0.2 is supported only.

          • 2. Re: MySQL and Portal Hybernate error
            rgjawanda

            Not sure. AS.

            I downloaded the 2.0 binaries.
            What comes with Jboss? or did I install that
            How do i tell.
            Thank you
            Ron

            • 3. Re: MySQL and Portal Hybernate error

              The binary you downloaded, was it the one bundled with JBoss AS? Or did you have a previous installation of AS on your box?

              • 4. Re: MySQL and Portal Hybernate error
                rgjawanda

                It was the one bundled with jboss.
                I then installed mysql (latest version) 4.1
                Windows Platform win 2003 server (unfortunately)
                Thanks

                • 5. Re: MySQL and Portal Hybernate error
                  rgjawanda

                  I tried all of this on Linux (mandrake 10.1) and I get the exact same problem.
                  I read completely the docs on setting up the database.
                  My MYSQL datasource gets configured properly.

                  2005-08-24 21:40:50,878 DEBUG [org.jboss.system.ServiceConfigurator] TypeMapping set to mySQL in jboss.jdbc:datasource=MySqlDS,service=metadata

                  Then my PortalDS

                  2005-08-24 21:40:34,580 DEBUG [org.jboss.cache.invalidation.InvalidationManager] Created jboss.cache:service=InvalidationManager
                  2005-08-24 21:40:34,581 DEBUG [org.jboss.system.ServiceController] Creating dependent components for: jboss.cache:service=InvalidationManager dependents are: [ObjectName: portal:service=CMS
                  State: CONFIGURED
                  I Depend On:
                  jboss.cache:service=InvalidationManager
                  jboss.jca:name=PortalDS,service=DataSourceBinding
                  Depends On Me:
                  portal:service=Tree
                  ]


                  --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
                  ObjectName: portal:service=Hibernate
                  State: FAILED
                  Reason: java.lang.NullPointerException
                  I Depend On:
                  jboss.jca:name=PortalDS,service=DataSourceBinding
                  Depends On Me:
                  portal:service=Module,type=User
                  portal:service=Module,type=Role
                  portal:service=Module,type=Security
                  portal:service=ServerManager






                  I wish I could upload the file for you to look at.

                  There is a LOT of debug statements.
                  Not sure why it is in DEBUG mode.

                  I copied mysql-ds.xml to deploy directory
                  the jdbc drivers for mysql but funny I had to copy the aspect runtime to the server deploy directory as well because mysql gave an exception saying it couldn't locate the aspect class (I forget which one)

                  I copied portal-mysql-ds.xml to the deploy dir

                  I changed the user and password. My password is blank.
                  I can connect to mysql with -u root
                  (no password)

                  I can't figure this out.
                  I'm almost giving up.

                  NOTE: I got postgreSQL working so I know it isn't me.
                  Thanks
                  Ron


                  • 6. Re: MySQL and Portal Hybernate error
                    sanshew

                    did you get this to work?? I am having the same problem.

                    • 7. Re: MySQL and Portal Hybernate error
                      danial79

                      I also experiencing the exact problem?.. any clear / easy solution for installation of portal from binaries?