1 Reply Latest reply on Nov 28, 2004 9:29 AM by Mike Duffy

    Configuring the EJB 3.0 Tutorial with MySQL

    liu lianchun Newbie

      it is jboss's problem not ejb3.
      better not configure MySQL as Default datasource.
      you can configure MySQL datasource as:
      mysql-ds.xml:

      <datasources>
       <local-tx-datasource>
       <jndi-name>MyDS</jndi-name>
       <connection-url>jdbc:mysql://mysql-hostname:3306/jbossdb</connection-url>
       <driver-class>com.mysql.jdbc.Driver</driver-class>
       <user-name>x</user-name>
       <password>y</password>
      ........
      

      hibernate.properties:
      hibernate.transaction.manager_lookup_class=org.hibernate.transaction.JBossTransactionManagerLookup
      hibernate.hbm2ddl.auto=create-drop
      #hibernate.hbm2ddl.auto=create
      hibernate.cache.provider_class=org.hibernate.cache.HashtableCacheProvider
      hibernate.connection.datasource=java:/MyDS
      hibernate.dialect=org.hibernate.dialect.MySQLDialect
      


        • 1. jboss-saaj attachmentpart problem
          Mike Duffy Novice

          Hi,
          I'm using jboss 4.0.0. and am having problems with attachments when using saaj. The only success I have is if I attach using MIME type text/plain and set content to a String.
          If I try to set MIME type to application/xml or text/xml and set content to be JDOMSource then I get IllegalArgument exception:



          If I try to set MIME type to application/xml or text/xml and set content to javax.xml.transform.stream.StreamSource then I get null pointer exception :

          13:40:03,032 ERROR [EBXMLTransportActivatorBean] java.lang.NullPointerException
          13:40:03,032 INFO [STDOUT] java.lang.NullPointerException
          13:40:03,042 INFO [STDOUT] at org.apache.axis.attachments.ManagedMemoryData
          Source.<init>(ManagedMemoryDataSource.java:202)
          13:40:03,042 INFO [STDOUT] at org.apache.axis.attachments.AttachmentPartImp
          l.setContent(AttachmentPartImpl.java:491)

          13:47:57,683 ERROR [EBXMLTransportActivatorBean] java.lang.IllegalArgumentExcep
          ion: Cannot content type 'text/xml' for: org.jdom.transform.JDOMSource@2fe64a
          13:47:57,723 INFO [STDOUT] java.lang.IllegalArgumentException: Cannot content
          ype 'text/xml' for: org.jdom.transform.JDOMSource@2fe64a
          13:47:57,763 INFO [STDOUT] at org.apache.axis.attachments.AttachmentPartIm
          l.setContent(AttachmentPartImpl.java:486)



          I would gratefully appreciate it if someone has some experience to offer on adding a StreamSource as an attachment with jboss-saaj.

          Thanks.