1 2 Previous Next 18 Replies Latest reply on Sep 20, 2006 8:44 AM by marklittle

    Problem with Trailblazer example and PostgreSQL

    daniel.roeder

      Hi @ALL,

      I installed JBossESB and the TestJBossESB worked fine, but I have problems with the trailblazer example. The following error-messages are presented by the JBoss AS output:

      09:09:01,139 INFO [TomcatDeployer] deploy, ctxPath=/loanbroker, warUrl=.../tmp/deploy/tmp8103loanbroker-exp.war/
      09:09:01,670 INFO [WSDLFilePublisher] WSDL published to: file:/C:/JBoss_SOA/jboss-4.0.4.GA/server/default/data/wsdl/loanbrok
      er.war/LoanBrokerWSService8104.wsdl
      09:09:01,983 INFO [ServiceEndpointManager] WebService started: http://w2k3srv:8080/loanbroker/LoanBrokerWS
      09:11:39,951 INFO [STDOUT] -6101458123877306066
      09:11:39,951 INFO [STDOUT] file:/C:/JBoss_SOA/jboss-4.0.4.GA/server/default/tmp/deploy/tmp8101jbossesb-appl.ear-contents/jbo
      ssesb-common.jar
      09:11:39,951 INFO [STDOUT] 2006-09-14 09:11:39,951 [http-0.0.0.0-8080-1] INFO org.jboss.soa.esb.services.beans.PersistHandle
      rBean - org.jboss.soa.esb.services.beans.PersistHandlerBean@2ad6a0 Created
      09:11:39,951 INFO [PersistHandlerBean] org.jboss.soa.esb.services.beans.PersistHandlerBean@2ad6a0 Created
      09:11:41,483 ERROR [JdbcCleanConn] execUpdWait() FAILED
      org.postgresql.util.PSQLException: ERROR: column "xml_data" is of type text but expression is of type bytea
       at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1525)
       at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1309)
       at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:188)
       at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:452)
       at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:354)
       at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:308)
       at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeUpdate(WrappedPreparedStatement.java:251)
       at org.jboss.soa.esb.helpers.persist.JdbcCleanConn.execUpdWait(JdbcCleanConn.java:122)
       at org.jboss.soa.esb.services.beans.PersistHandlerBean.doAddSnapshot(PersistHandlerBean.java:307)
       at org.jboss.soa.esb.services.beans.PersistHandlerBean.doAddSnapshot(PersistHandlerBean.java:288)
       at org.jboss.soa.esb.services.beans.PersistHandlerBean.addDTO(PersistHandlerBean.java:167)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      .....


      Any suggestions about the problem?

      Daniel Röder

        • 1. Re: Problem with Trailblazer example and PostgreSQL

          Daniel, what version of the PostGreSQL jdbc driver are you using?

          • 2. Re: Problem with Trailblazer example and PostgreSQL
            daniel.roeder

            Hi @All

            I solved the above problem by changing the type of xml_data in the jbossesb table (I think the real problem is the jdbc2 driver shipped with trailblazer: JBossESB4.0Beta1\config\lib\pg74.216.jdbc2ee.jar, i removed the jar and used the postgresql-8.1-407.jdbc2ee.jar instead, but the problem still apeared (i made the full install cycle with the example ant clean -> ant deploy)

            I may mention here that I used the binary of the JBossESB...

            After I changed the type of the xml_data field, the above error disappered, but a new one appered in the "ant runListener" console:

            [java] 11:14:16,870 INFO [ProcessCreditRequest] processObject was called w
            ith <<org.jboss.mq.SpyObjectMessage {
             [java] Header {
             [java] jmsDestination : QUEUE.A
             [java] jmsDeliveryMode : 2
             [java] jmsExpiration : 0
             [java] jmsPriority : 4
             [java] jmsMessageID : ID:14-11582252563861
             [java] jmsTimeStamp : 1158225256386
             [java] jmsCorrelationID: null
             [java] jmsReplyTo : null
             [java] jmsType : null
             [java] jmsRedelivered : false
             [java] jmsProperties : {sample_loanbroker_servicecode=creditRequest, J
            MSXDeliveryCount=1}
             [java] jmsPropReadWrite: false
             [java] msgReadOnly : true
             [java] producerClientId: ID:14
             [java] }
             [java] }>>
             [java] 11:14:18,808 INFO [JmsQueueListener] Waiting for available threads.
            ..
             [java] 11:14:18,824 INFO [ProcessCreditResponse] processObject was called
            with <<org.jboss.mq.SpyObjectMessage {
             [java] Header {
             [java] jmsDestination : QUEUE.A
             [java] jmsDeliveryMode : 2
             [java] jmsExpiration : 0
             [java] jmsPriority : 4
             [java] jmsMessageID : ID:15-11582252587771
             [java] jmsTimeStamp : 1158225258777
             [java] jmsCorrelationID: null
             [java] jmsReplyTo : null
             [java] jmsType : null
             [java] jmsRedelivered : false
             [java] jmsProperties : {sample_loanbroker_servicecode=creditResponse,
            JMSXDeliveryCount=1}
             [java] jmsPropReadWrite: false
             [java] msgReadOnly : true
             [java] producerClientId: ID:15
             [java] }
             [java] }>>
             [java] 11:14:19,370 INFO [ProcessCreditResponse] ProcessCreditResponse --
            Business Object BEFORE Credit Rating is added:
             [java] <Customer __BobjPkg="org.jboss.soa.esb.samples.loanbroker.domain" em
            pName="Wesayso & Co" loanAmt="1000,00" loanDur="12" salary="50000,00" snap="
            10500201" ssn="1234567890" stamp="1158225255214" uid="10500201"><person __Class=
            "Person" fmlyN="Joe Broke"><Laddr List="yes" __Class="Address"><it rol="loan" st
            rLine1="1 Spenditall Str., BrokeTown 99999 DC"/></Laddr><Lemail List="yes" __Cla
            ss="OneValue"><it rol="loan" v="user@localhost"/></Lemail></person></Customer>
             [java] 11:14:19,620 INFO [ProcessCreditResponse] ProcessCreditResponse --
            Business Object AFTER Credit Rating is added:
             [java] <Customer __BobjPkg="org.jboss.soa.esb.samples.loanbroker.domain" em
            pName="Wesayso & Co" loanAmt="1000,00" loanDur="12" salary="50000,00" snap="
            10500201" ssn="1234567890" stamp="1158225255214" uid="10500201"><person __Class=
            "Person" fmlyN="Joe Broke"><Laddr List="yes" __Class="Address"><it rol="loan" st
            rLine1="1 Spenditall Str., BrokeTown 99999 DC"/></Laddr><Lemail List="yes" __Cla
            ss="OneValue"><it rol="loan" v="user@localhost"/></Lemail></person><rating __Cla
            ss="CreditRating" score="2"/></Customer>
             [java] 11:14:19,699 INFO [LoanBrokerConstants] loanbrokerJndiUrl=localhost
            
             [java] 11:14:19,699 INFO [LoanBrokerConstants] loanbrokerJndiType=jboss
             [java] 11:14:19,699 INFO [LoanBrokerConstants] loanbrokerCreditQueue=queue
            /A
             [java] 11:14:19,699 INFO [LoanBrokerConstants] loanbrokerJmsRequestQueue=q
            ueue/C
             [java] 11:14:19,699 INFO [LoanBrokerConstants] loanbrokerRequestDir=/temp/
            bankInput
             [java] 11:14:19,699 INFO [LoanBrokerConstants] loanbrokerEmailTemplatePath
            =/cygwin/home/kstam/dev1.6/loanbrokerdemo/template
             [java] 11:14:19,699 INFO [LoanBrokerConstants] loanbrokerEmailTemplateFile
            =quotes
             [java] java.lang.NumberFormatException: For input string: "1000,00"
             [java] at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal
            .java:1224)
             [java] at java.lang.Double.parseDouble(Double.java:482)
             [java] at org.jboss.soa.esb.samples.loanbroker.adapters.CustomerAdapter
            .bankQuoteFromCustomer(CustomerAdapter.java:110)
             [java] at org.jboss.soa.esb.samples.loanbroker.actions.ProcessCreditRes
            ponse.sendJMSToBank(ProcessCreditResponse.java:135)
             [java] at org.jboss.soa.esb.samples.loanbroker.actions.ProcessCreditRes
            ponse.processCurrentObject(ProcessCreditResponse.java:90)
             [java] at org.jboss.soa.esb.samples.loanbroker.actions.ProcessCreditRes
            ponse.run(ProcessCreditResponse.java:111)
             [java] at java.lang.Thread.run(Thread.java:595)
             [java] 11:14:20,167 ERROR [ProcessCreditResponse] error creating Bank reque
            st file
            



            • 3. Re: Problem with Trailblazer example and PostgreSQL
              daniel.roeder

              Hi Daniel \\great name, by the way ;)

              i read your post after i submitted my last one, but the awnser to your question is in that post.

              I found "some" older jdbc2ee driver in my posgreSQL Installation-directory, are they preffered used instead of the ones in my trailblazer lib directory?

              Thanks for your help in advance...

              Daniel Röder

              • 4. Re: Problem with Trailblazer example and PostgreSQL
                daniel.roeder

                by the way I inserted 1000 (without point or comma) into the form at localhost:8080/loanbroker ...

                • 5. Re: Problem with Trailblazer example and PostgreSQL
                  hutchkintoot

                  Seems like the Trailblazer example isn't working for all locales. I also ran into troubles with number formating and solved it with some ugly hacks just to get it into working condition.

                  /johan (swedish locale)

                  • 6. Re: Problem with Trailblazer example and PostgreSQL
                    daniel.roeder

                    Hi Johan,

                    this is maybe right, but I have an german version of the jdk, I'll try the english one soon...

                    But I'll think that is no real solution...

                    Where did you changed thinks to make it work with your local?
                    Maybe you/we can add a patch to the example, to remove the problem...

                    I still have the problem, that I changed the type of the xml_data row in the database to bytea, although I'am using the recommended JDBC driver...

                    How can I test which version is really running?

                    Thx for help...

                    • 7. Re: Problem with Trailblazer example and PostgreSQL
                      daniel.roeder

                      OK, I'll tried the example with an english version of the JDK, but there was no change with the appearing error...

                      The System and Browser are also native english systems...

                      I'll think the problem is related to my hack with the bytea / text problem of the xml_data database entry....

                      So maybe I'll have to fix this problem frist, any ideas...

                      Daniel

                      • 8. Re: Problem with Trailblazer example and PostgreSQL
                        kurtstam

                        Hi Daniel,

                        The last problem is because of formatting to cents. Let's not worry about the cents in this demo and change line 96 in Customer.java from
                        private static final NumberFormat s_NF = new DecimalFormat("#########0.00");

                        to

                        private static final NumberFormat s_NF = new DecimalFormat("#########0");

                        That should do the trick.

                        Let me know if that works for you.

                        Thx,

                        --Kurt


                        • 9. Re: Problem with Trailblazer example and PostgreSQL
                          kurtstam

                          I created a bug for this: http://jira.jboss.com/jira/browse/JBESB-138

                          Please let me know if you have any other locale related issues and I can add it to this bug.

                          --Kurt

                          • 10. Re: Problem with Trailblazer example and PostgreSQL
                            daniel.roeder

                            Hi Kurt,

                            thanks for your help. It now works, but I also had to change the format settings in customerAsapter.java.

                            Daniel

                            • 11. Re: Problem with Trailblazer example and PostgreSQL
                              kurtstam

                              Thanks Daniel, good catch, I've checked it in on the maintenance branch now too, so it should be in the patch coming out later this week.

                              --Kurt

                              • 12. Re: Problem with Trailblazer example and PostgreSQL
                                fanhengwei

                                10:58:13,984 ERROR [MainDeployer] Could not create deployment: file:/E:/jboss-4.
                                0.4.GA/server/default/deploy/loanbroker.war
                                java.lang.ArrayIndexOutOfBoundsException: 0
                                at org.jboss.ws.metadata.AnnotationsMetaDataBuilder.getWebParamAnnotatio
                                n(AnnotationsMetaDataBuilder.java:322)
                                at org.jboss.ws.metadata.AnnotationsMetaDataBuilder.processWebMethod(Ann
                                otationsMetaDataBuilder.java:400)
                                at org.jboss.ws.metadata.AnnotationsMetaDataBuilder.setupEndpointFromAnn
                                otations(AnnotationsMetaDataBuilder.java:154)

                                • 13. Re: Problem with Trailblazer example and PostgreSQL
                                  marklittle

                                  If there wasn't, create a JIRA task for this (reference this forum entry) and close it if it's fixed. Just so we can add this to the release notes.

                                  • 14. Re: Problem with Trailblazer example and PostgreSQL
                                    kurtstam

                                    For the formatting bug there is an jira task:http://jira.jboss.com/jira/browse/JBESB-138, which is resolved.

                                    fahengwei's issue is different. Let's create a new forum entry for this.

                                    --Kurt

                                    1 2 Previous Next