2016-03-02 64 views
0

我創建DB德比和後續的錯誤返回瀏覽連接:MULE連接德比錯誤

ERROR 2016-03-01 23:20:31,168 
[[fiapacessobancodedados].HTTP_Listener_Configuration.worker.01] 
org.mule.exception.DefaultMessagingExceptionStrategy: 

Message    : null (java.lang.NullPointerException). Message payload is of type: NullPayload 
Type     : org.mule.api.MessagingException 
Code     : MULE_ERROR--2 
JavaDoc    : 
Payload    : {NullPayload} 

的XML如下:

<spring:beans> 
    <spring:bean id="Bean" name="Bean" class="fiapacessobancodedados.ConexaoDerby"/> 
</spring:beans> 
<db:derby-config name="Derby_Configuration" url="jdbc:derby://localhost:1527/SOAFiap;username=Fiap;password=Fiap" doc:name="Derby Configuration"/> 
<http:listener-config name="HTTP_Listener_Configuration" host="0.0.0.0" port="8081" doc:name="HTTP Listener Configuration"/> 
<flow name="fiapacessobancodedadosFlow"> 
    <http:listener config-ref="HTTP_Listener_Configuration" path="/" doc:name="HTTP"/> 
    <db:insert config-ref="Derby_Configuration" doc:name="Database"> 
     <db:parameterized-query><![CDATA[INSERT INTO FIAP.ALUNO (CODIGO, NOME_ALUNO) 
VALUES (5, 'Igor Koba')]]></db:parameterized-query> 
    </db:insert> 
    <json:object-to-json-transformer doc:name="Object to JSON"/> 
</flow> 

+0

FIAPéNOIS! kkk – jhonatan2760

回答

0

我有如下修改你的流量和連接的URL,現在將正常工作: -

<spring:beans> 
     <spring:bean id="Derby_Data_Source" class="org.enhydra.jdbc.standard.StandardXADataSource" > 
      <spring:property name="driverName" value="org.apache.derby.jdbc.EmbeddedDriver"/> 
      <!-- <spring:property name="url" value="jdbc:derby:SOAFiap;create=true"/> --> 
      <spring:property name="url" value="jdbc:derby:memory:SOAFiap;create=true"/> <!-- Create Database in memory --> 
     </spring:bean> 
</spring:beans> 
<db:generic-config name="Generic_Database_Configuration" dataSource-ref="Derby_Data_Source" doc:name="Generic Database Configuration"/> 
<http:listener-config name="HTTP_Listener_Configuration" host="0.0.0.0" port="8081" doc:name="HTTP Listener Configuration"/> 

    <flow name="DerbyDBFlow1" > 
      <http:listener config-ref="HTTP_Listener_Configuration" path="/" doc:name="HTTP"/> 

     <db:insert config-ref="Generic_Database_Configuration" doc:name="Database"> 
      <db:parameterized-query><![CDATA[INSERT INTO FIAP.ALUNO (CODIGO, NOME_ALUNO) 
VALUES (5, 'Igor Koba')]]></db:parameterized-query> 
      </db:insert> 

     <logger message="#[message.payload]" level="INFO" doc:name="Logger"/> 
    </flow> 

這是工作對我罰款。
您可以修改URL按您的DBNAME,用戶名等

+0

嗨Anirban,thans由答案。但是,當我運行部署和執行的http://本地主機:8081在瀏覽器中,錯誤模式FIAP不存在.....請,您可以將其他的建議?很感謝... –