2013-09-30 63 views
0

我使用連接到本地postgresql DB的小工具創建了一個小工具...一切都很完美,但是當我將小工具添加到小工具儀表板時,它什麼也沒有顯示。
這是我的小工具路線:BAM小工具

/registry/resource/_system/config/repository/components/org.wso2.carbon.bam.gadgetgen/gadgetgen/tabla.xml 

這是控制檯錯誤:

Caused by: org.jaggeryjs.scriptengine.exceptions.ScriptException: Error connecting to the database : jdbc:postgresql://127.0.0.1:5432/wso2bam_postgresql 

btw, i have read all the related documentation without success 

Log 

    Mapred Local Task Succeeded . Convert the Join into MapJoin 
OK 
OK 
OK 
[2013-10-07 16:56:09,420] INFO {org.apache.cassandra.service.GCInspector} - GC for PS Scavenge: 375 ms for 1 collections, 95658024 used; max is 954466304 
[2013-10-07 16:56:09,516] WARN {org.jaggeryjs.hostobjects.db.DatabaseHostObject} - Error connecting to the database : jdbc:postgresql://127.0.0.1:5432/wso2bam_postgresql 
java.sql.SQLException 
    at org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:254) 
    at org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:182) 
    at org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:702) 
    at org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:634) 
    at org.apache.tomcat.jdbc.pool.ConnectionPool.getConnection(ConnectionPool.java:188) 
    at org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:127) 
    at org.jaggeryjs.hostobjects.db.DatabaseHostObject.jsConstructor(DatabaseHostObject.java:144) 
    at sun.reflect.GeneratedMethodAccessor295.invoke(Unknown Source) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
    at java.lang.reflect.Method.invoke(Method.java:616) 
    at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:160) 
    at org.mozilla.javascript.FunctionObject.call(FunctionObject.java:417) 
    at org.mozilla.javascript.BaseFunction.construct(BaseFunction.java:328) 
    at org.mozilla.javascript.ScriptRuntime.newObject(ScriptRuntime.java:2266) 
    at org.jaggeryjs.rhino.gadgetgen.c0._c0(/gadgetgen//tabla.jag:4) 
    at org.jaggeryjs.rhino.gadgetgen.c0.call(/gadgetgen//tabla.jag) 
    at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:401) 
    at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3003) 
    at org.jaggeryjs.rhino.gadgetgen.c0.call(/gadgetgen//tabla.jag) 
    at org.jaggeryjs.rhino.gadgetgen.c0.exec(/gadgetgen//tabla.jag) 
    at org.jaggeryjs.scriptengine.engine.RhinoEngine.execScript(RhinoEngine.java:441) 
    at org.jaggeryjs.scriptengine.engine.RhinoEngine.exec(RhinoEngine.java:191) 
    at org.jaggeryjs.jaggery.core.manager.WebAppManager.execute(WebAppManager.java:269) 
    at org.jaggeryjs.jaggery.core.JaggeryServlet.doPost(JaggeryServlet.java:29) 
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:755) 
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:848) 
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) 
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) 
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) 
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) 
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) 
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) 
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99) 
    at org.wso2.carbon.tomcat.ext.valves.CompositeValve.invoke(CompositeValve.java:177) 
    at org.wso2.carbon.tomcat.ext.valves.CarbonStuckThreadDetectionValve.invoke(CarbonStuckThreadDetectionValve.java:161) 
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936) 
    at org.wso2.carbon.tomcat.ext.valves.CarbonContextCreatorValve.invoke(CarbonContextCreatorValve.java:57) 
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) 
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407) 
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004) 
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589) 
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1653) 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) 
    at java.lang.Thread.run(Thread.java:679) 
Caused by: java.lang.NullPointerException 
    at java.lang.Class.forName0(Native Method) 
    at java.lang.Class.forName(Class.java:266) 
    at org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:246) 
    ... 44 more 
[2013-10-07 16:56:09,577] ERROR {org.jaggeryjs.scriptengine.engine.RhinoEngine} - org.mozilla.javascript.WrappedException: Wrapped org.jaggeryjs.scriptengine.exceptions.ScriptException: Error connecting to the database : jdbc:postgresql://127.0.0.1:5432/wso2bam_postgresql (/gadgetgen//tabla.jag#4) 
[2013-10-07 16:56:09,605] ERROR {org.jaggeryjs.jaggery.core.manager.WebAppManager} - org.mozilla.javascript.WrappedException: Wrapped org.jaggeryjs.scriptengine.exceptions.ScriptException: Error connecting to the database : jdbc:postgresql://127.0.0.1:5432/wso2bam_postgresql (/gadgetgen//tabla.jag#4) 
org.jaggeryjs.scriptengine.exceptions.ScriptException: org.mozilla.javascript.WrappedException: Wrapped org.jaggeryjs.scriptengine.exceptions.ScriptException: Error connecting to the database : jdbc:postgresql://127.0.0.1:5432/wso2bam_postgresql (/gadgetgen//tabla.jag#4) 
    at org.jaggeryjs.scriptengine.engine.RhinoEngine.execScript(RhinoEngine.java:446) 
    at org.jaggeryjs.scriptengine.engine.RhinoEngine.exec(RhinoEngine.java:191) 
    at org.jaggeryjs.jaggery.core.manager.WebAppManager.execute(WebAppManager.java:269) 
    at org.jaggeryjs.jaggery.core.JaggeryServlet.doPost(JaggeryServlet.java:29) 
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:755) 
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:848) 
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) 
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) 
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) 
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) 
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) 
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) 
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99) 
    at org.wso2.carbon.tomcat.ext.valves.CompositeValve.invoke(CompositeValve.java:177) 
    at org.wso2.carbon.tomcat.ext.valves.CarbonStuckThreadDetectionValve.invoke(CarbonStuckThreadDetectionValve.java:161) 
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936) 
    at org.wso2.carbon.tomcat.ext.valves.CarbonContextCreatorValve.invoke(CarbonContextCreatorValve.java:57) 
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) 
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407) 
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004) 
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589) 
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1653) 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) 
    at java.lang.Thread.run(Thread.java:679) 
Caused by: org.mozilla.javascript.WrappedException: Wrapped org.jaggeryjs.scriptengine.exceptions.ScriptException: Error connecting to the database : jdbc:postgresql://127.0.0.1:5432/wso2bam_postgresql (/gadgetgen//tabla.jag#4) 
    at org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:1654) 
    at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:175) 
    at org.mozilla.javascript.FunctionObject.call(FunctionObject.java:417) 
    at org.mozilla.javascript.BaseFunction.construct(BaseFunction.java:328) 
    at org.mozilla.javascript.ScriptRuntime.newObject(ScriptRuntime.java:2266) 
    at org.jaggeryjs.rhino.gadgetgen.c0._c0(/gadgetgen//tabla.jag:4) 
    at org.jaggeryjs.rhino.gadgetgen.c0.call(/gadgetgen//tabla.jag) 
    at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:401) 
    at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3003) 
    at org.jaggeryjs.rhino.gadgetgen.c0.call(/gadgetgen//tabla.jag) 
    at org.jaggeryjs.rhino.gadgetgen.c0.exec(/gadgetgen//tabla.jag) 
    at org.jaggeryjs.scriptengine.engine.RhinoEngine.execScript(RhinoEngine.java:441) 
    ... 24 more 
Caused by: org.jaggeryjs.scriptengine.exceptions.ScriptException: Error connecting to the database : jdbc:postgresql://127.0.0.1:5432/wso2bam_postgresql 
    at org.jaggeryjs.hostobjects.db.DatabaseHostObject.jsConstructor(DatabaseHostObject.java:150) 
    at sun.reflect.GeneratedMethodAccessor295.invoke(Unknown Source) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
    at java.lang.reflect.Method.invoke(Method.java:616) 
    at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:160) 
    ... 34 more 
Caused by: java.sql.SQLException 
    at org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:254) 
    at org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:182) 
    at org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:702) 
    at org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:634) 
    at org.apache.tomcat.jdbc.pool.ConnectionPool.getConnection(ConnectionPool.java:188) 
    at org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:127) 
    at org.jaggeryjs.hostobjects.db.DatabaseHostObject.jsConstructor(DatabaseHostObject.java:144) 
    ... 38 more 
Caused by: java.lang.NullPointerException 
    at java.lang.Class.forName0(Native Method) 
    at java.lang.Class.forName(Class.java:266) 
    at org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:246) 
    ... 44 more 
Total MapReduce jobs = 1 
Launching Job 1 out of 1 
Number of reduce tasks not specified. Estimated from input data size: 1 
In order to change the average load for a reducer (in bytes): 
    set hive.exec.reducers.bytes.per.reducer=<number> 
In order to limit the maximum number of reducers: 
    set hive.exec.reducers.max=<number> 
In order to set a constant number of reducers: 
    set mapred.reduce.tasks=<number> 
Job running in-process (local Hadoop) 
Hadoop job information for null: number of mappers: 0; number of reducers: 0 
2013-10-07 16:56:12,979 null map = 0%, reduce = 0% 
2013-10-07 16:56:18,996 null map = 100%, reduce = 0% 

回答

0

你有沒有包含在驅動程序.jar到$ BAM_HOME /存儲庫/組件/ lib目錄?當您在小工具生成嚮導中創建小工具時,是否能夠在預覽中看到數據?

請確保以上兩點,並提供整個堆棧跟蹤,而不僅僅是錯誤消息。

+0

你好,是的,我有驅動程序位於正確的目錄中...是的,我能夠預覽表/酒吧...順便說一句你叫什麼「整個堆棧」滿了運行.sh腳本之後的日誌?...我很喜歡BAM,我已經閱讀過文檔,我試圖從數據庫中檢索數據來創建一個簡單的KPI ...提前致謝 – Carlos

+0

錯誤堆棧跟蹤意味着整個異常追蹤。你只包含了堆棧跟蹤的第一行。包含整個異常跟蹤。 – Ragavan

+0

你好@Ragavan,爲了延遲,我用日誌更新了問題。謝謝 – Carlos

0

在// repository/deployment/server/jaggeryapps/gadgetgen中爲小工具創建的鋸齒文件中將會有一個變量'config',其中包含空{}。更改爲

var config = {"driverClassName":"org.postgresql.Driver"};