我正在使用MULE ESB并且有一个流程,旨在将所有结果从Mysql数据库中提取出来并将所有结果放在一个JSON文件中。但是我将结果作为单独的JSON文件获取,而不是一个JSON文件(这是期望的结果)
这是我的配置文件
<context:property-placeholder location="classpath:mysql.properties,classpath:smtp.properties" />
<smtp:connector name="emailConnector" fromAddress="${smtp.from}" subject="${smtp.subject}" doc:name="SMTP" validateConnections="true"/>
<jdbc-ee:connector name="jdbcConnector" dataSource-ref="MySQL_Data_Source" validateConnections="false" queryTimeout="10" pollingFrequency="10000" doc:name="JDBC">
<jdbc-ee:query key="Users" value="SELECT * FROM test ORDER BY id ASC"></jdbc-ee:query>
</jdbc-ee:connector>
<jdbc-ee:mysql-data-source name="MySQL_Data_Source" user="${mysql.user}" password="${mysql.password}" url="${mysql.url}" transactionIsolation="UNSPECIFIED" doc:name="MySQL Data Source"></jdbc-ee:mysql-data-source>
<flow name="flows1Flow1" >
<jdbc-ee:inbound-endpoint queryKey="Users" connector-ref="jdbcConnector" doc:name="JDBC"></jdbc-ee:inbound-endpoint>
<json:object-to-json-transformer doc:name="Object to JSON"/>
<file:outbound-endpoint path="C:\Users\IEUser\Desktop\New folder" doc:name="File" responseTimeout="10000"></file:outbound-endpoint>
</flow>
答案 0 :(得分:1)
你使用的是什么版本的骡子?您使用的jdbc连接器已弃用3.5+。我能够使用3.7.1中的以下配置获得您期望的结果:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_postlist);
ListView listView = (ListView) this.findViewById(R.id.postListView);
PostItemAdapter itemAdapter = new PostItemAdapter(this,
R.layout.list, listData);
//this.accessWebService();
listView.setAdapter(itemAdapter);
}
03-15 16:11:12.104: E/AndroidRuntime(844): FATAL EXCEPTION: main
03-15 16:11:12.104: E/AndroidRuntime(844): java.lang.RuntimeException: Unable to start activity ComponentInfo{ie.ucc.bis.is4432calculator/ie.ucc.bis.is4432calculator.secondActivity}: java.lang.NullPointerException
03-15 16:11:12.104: E/AndroidRuntime(844): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647)
03-15 16:11:12.104: E/AndroidRuntime(844): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
03-15 16:11:12.104: E/AndroidRuntime(844): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
03-15 16:11:12.104: E/AndroidRuntime(844): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
03-15 16:11:12.104: E/AndroidRuntime(844): at android.os.Handler.dispatchMessage(Handler.java:99)
03-15 16:11:12.104: E/AndroidRuntime(844): at android.os.Looper.loop(Looper.java:123)
03-15 16:11:12.104: E/AndroidRuntime(844): at android.app.ActivityThread.main(ActivityThread.java:3683)
03-15 16:11:12.104: E/AndroidRuntime(844): at java.lang.reflect.Method.invokeNative(Native Method)
03-15 16:11:12.104: E/AndroidRuntime(844): at java.lang.reflect.Method.invoke(Method.java:507)
03-15 16:11:12.104: E/AndroidRuntime(844): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
03-15 16:11:12.104: E/AndroidRuntime(844): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
03-15 16:11:12.104: E/AndroidRuntime(844): at dalvik.system.NativeStart.main(Native Method)
03-15 16:11:12.104: E/AndroidRuntime(844): Caused by: java.lang.NullPointerException
03-15 16:11:12.104: E/AndroidRuntime(844): at android.widget.ArrayAdapter.getCount(ArrayAdapter.java:291)
03-15 16:11:12.104: E/AndroidRuntime(844): at android.widget.ListView.setAdapter(ListView.java:454)
03-15 16:11:12.104: E/AndroidRuntime(844): at ie.ucc.bis.is4432calculator.secondActivity.onCreate(secondActivity.java:42)
03-15 16:11:12.104: E/AndroidRuntime(844): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
HTH