Ballerina build error with code generator null pointer exception - wso2

Ballerina build package/ fails with a
ballerina: Oh no, something really went wrong. Bad. Sad.
The ballerina-internal.log file had the following compile time error.
ERROR {org.ballerinalang.launcher.Main} - null java.lang.NullPointerException
at org.wso2.ballerinalang.compiler.codegen.CodeGenerator.generateFinallyInstructions(CodeGenerator.java:3311)
at org.wso2.ballerinalang.compiler.codegen.CodeGenerator.generateFinallyInstructions(CodeGenerator.java:3304)
at org.wso2.ballerinalang.compiler.codegen.CodeGenerator.visit(CodeGenerator.java:547)
at org.wso2.ballerinalang.compiler.tree.statements.BLangReturn.accept(BLangReturn.java:44)
at org.wso2.ballerinalang.compiler.codegen.CodeGenerator.genNode(CodeGenerator.java:1386)
at org.wso2.ballerinalang.compiler.codegen.CodeGenerator.visit(CodeGenerator.java:494)
at org.wso2.ballerinalang.compiler.tree.statements.BLangBlockStmt.accept(BLangBlockStmt.java:54)
at org.wso2.ballerinalang.compiler.codegen.CodeGenerator.genNode(CodeGenerator.java:1386)
at org.wso2.ballerinalang.compiler.codegen.CodeGenerator.visit(CodeGenerator.java:2662)
at org.wso2.ballerinalang.compiler.tree.statements.BLangIf.accept(BLangIf.java:53)
at org.wso2.ballerinalang.compiler.codegen.CodeGenerator.genNode(CodeGenerator.java:1386)
at org.wso2.ballerinalang.compiler.codegen.CodeGenerator.visit(CodeGenerator.java:494)
at org.wso2.ballerinalang.compiler.tree.statements.BLangBlockStmt.accept(BLangBlockStmt.java:54)
at org.wso2.ballerinalang.compiler.codegen.CodeGenerator.genNode(CodeGenerator.java:1386)
at org.wso2.ballerinalang.compiler.codegen.CodeGenerator.processWorker(CodeGenerator.java:1653)
at org.wso2.ballerinalang.compiler.codegen.CodeGenerator.visitInvokableNode(CodeGenerator.java:1598)
at org.wso2.ballerinalang.compiler.codegen.CodeGenerator.visit(CodeGenerator.java:482)
at org.wso2.ballerinalang.compiler.tree.BLangFunction.accept(BLangFunction.java:66)
at org.wso2.ballerinalang.compiler.codegen.CodeGenerator.genNode(CodeGenerator.java:1386)
at org.wso2.ballerinalang.compiler.codegen.CodeGenerator.lambda$visit$225(CodeGenerator.java:443)
at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
at org.wso2.ballerinalang.compiler.codegen.CodeGenerator.visit(CodeGenerator.java:443)
at org.wso2.ballerinalang.compiler.tree.BLangPackage.accept(BLangPackage.java:150)
at org.wso2.ballerinalang.compiler.codegen.CodeGenerator.genNode(CodeGenerator.java:1386)
at org.wso2.ballerinalang.compiler.codegen.CodeGenerator.generateBALO(CodeGenerator.java:358)
at org.wso2.ballerinalang.compiler.CompilerDriver.codegen(CompilerDriver.java:200)
at org.wso2.ballerinalang.compiler.CompilerDriver.compile(CompilerDriver.java:172)
at org.wso2.ballerinalang.compiler.CompilerDriver.compilePackageSymbol(CompilerDriver.java:139)
at org.wso2.ballerinalang.compiler.CompilerDriver.compilePackage(CompilerDriver.java:106)
at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
at org.wso2.ballerinalang.compiler.Compiler.compilePackages(Compiler.java:154)
at org.wso2.ballerinalang.compiler.Compiler.compilePackage(Compiler.java:173)
at org.wso2.ballerinalang.compiler.Compiler.compile(Compiler.java:85)
at org.wso2.ballerinalang.compiler.Compiler.build(Compiler.java:94)
at org.ballerinalang.packerina.BuilderUtils.compileWithTestsAndWrite(BuilderUtils.java:63)
at org.ballerinalang.packerina.cmd.BuildCommand.execute(BuildCommand.java:97)
at java.util.Optional.ifPresent(Optional.java:159)
at org.ballerinalang.launcher.Main.main(Main.java:66)
I went through the code and this can occur if the BLangStatement.statementLink can get a null value assigned. Can this value get a null assigned?

This looks like a bug in the product. Please post the issue and how to reproduce it on https://github.com/ballerina-platform/ballerina-lang

Related

Error in SQL Launcher (java.lang.NullPointerException) in Google Dataflow SQL

I am trying to read the data from a Pubsub topic using Google dataflow SQL and getting "NullPointerException" error. Could anyone guide me on what I am doing wrong.
Below is the SQL query. I tried selecting few columns also. Same error is coming.
SELECT tr.* FROM pubsub.topic.`project-xxx`.county_timeranges as tr
Log from LogsExplorer
logger: "com.google.cloud.dataflow.sqllauncher.DataflowSqlLauncher"
message: "Error in SQL launcher"
exception: "java.lang.NullPointerException
at sun.reflect.annotation.TypeAnnotationParser.mapTypeAnnotations(TypeAnnotationParser.java:356)
at sun.reflect.annotation.AnnotatedTypeFactory$AnnotatedTypeBaseImpl.<init>(AnnotatedTypeFactory.java:139)
at sun.reflect.annotation.AnnotatedTypeFactory.buildAnnotatedType(AnnotatedTypeFactory.java:65)
at sun.reflect.annotation.TypeAnnotationParser.buildAnnotatedType(TypeAnnotationParser.java:79)
at java.lang.reflect.Executable.getAnnotatedReturnType0(Executable.java:633)
at java.lang.reflect.Method.getAnnotatedReturnType(Method.java:648)
at org.apache.beam.sdk.schemas.FieldValueTypeInformation.hasNullableReturnType(FieldValueTypeInformation.java:173)
at org.apache.beam.sdk.schemas.FieldValueTypeInformation.forGetter(FieldValueTypeInformation.java:132)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1380)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
at org.apache.beam.sdk.schemas.AutoValueSchema$AbstractGetterTypeSupplier.get(AutoValueSchema.java:62)
at org.apache.beam.sdk.schemas.utils.FieldValueTypeSupplier.get(FieldValueTypeSupplier.java:43)
at org.apache.beam.sdk.schemas.utils.JavaBeanUtils.lambda$getFieldTypes$0(JavaBeanUtils.java:107)
at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660)
at org.apache.beam.sdk.schemas.utils.JavaBeanUtils.getFieldTypes(JavaBeanUtils.java:106)
at org.apache.beam.sdk.schemas.AutoValueSchema.fieldValueTypeInformations(AutoValueSchema.java:78)
at org.apache.beam.sdk.schemas.CachingFactory.create(CachingFactory.java:52)
at org.apache.beam.sdk.schemas.FromRowUsingCreator.fromRow(FromRowUsingCreator.java:78)
at org.apache.beam.sdk.schemas.FromRowUsingCreator.apply(FromRowUsingCreator.java:62)
at org.apache.beam.sdk.schemas.FromRowUsingCreator.apply(FromRowUsingCreator.java:45)
at org.apache.beam.sdk.io.gcp.pubsub.PubsubSchemaIOProvider$PubsubSchemaIO.<init>(PubsubSchemaIOProvider.java:176)
at org.apache.beam.sdk.io.gcp.pubsub.PubsubSchemaIOProvider$PubsubSchemaIO.<init>(PubsubSchemaIOProvider.java:165)
at org.apache.beam.sdk.io.gcp.pubsub.PubsubSchemaIOProvider.from(PubsubSchemaIOProvider.java:124)
at org.apache.beam.sdk.io.gcp.pubsub.PubsubSchemaIOProvider.from(PubsubSchemaIOProvider.java:91)
at org.apache.beam.sdk.extensions.sql.meta.provider.SchemaIOTableProviderWrapper.buildBeamSqlTable(SchemaIOTableProviderWrapper.java:72)
at org.apache.beam.sdk.extensions.sql.meta.provider.datacatalog.DataCatalogTableProvider.buildBeamSqlTable(DataCatalogTableProvider.java:123)
at org.apache.beam.sdk.extensions.sql.meta.provider.FullNameTableProvider$TableNameTrackingProvider.buildBeamSqlTable(FullNameTableProvider.java:163)
at org.apache.beam.sdk.extensions.sql.impl.BeamCalciteSchema.getTable(BeamCalciteSchema.java:110)
at org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.jdbc.SimpleCalciteSchema.getImplicitTable(SimpleCalciteSchema.java:83)
at org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.jdbc.CalciteSchema.getTable(CalciteSchema.java:289)
at org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.jdbc.CalciteSchema$SchemaPlusImpl.getTable(CalciteSchema.java:657)
at org.apache.beam.sdk.extensions.sql.zetasql.TableResolution.resolveCalciteTable(TableResolution.java:57)
at org.apache.beam.sdk.extensions.sql.zetasql.SqlAnalyzer.addTableToLeafCatalog(SqlAnalyzer.java:326)
at org.apache.beam.sdk.extensions.sql.zetasql.SqlAnalyzer.lambda$createPopulatedCatalog$1(SqlAnalyzer.java:216)
at com.google.common.collect.ImmutableList.forEach(ImmutableList.java:407)
at org.apache.beam.sdk.extensions.sql.zetasql.SqlAnalyzer.createPopulatedCatalog(SqlAnalyzer.java:216)
at org.apache.beam.sdk.extensions.sql.zetasql.ZetaSQLPlannerImpl.rel(ZetaSQLPlannerImpl.java:98)
at org.apache.beam.sdk.extensions.sql.zetasql.ZetaSQLQueryPlanner.convertToBeamRelInternal(ZetaSQLQueryPlanner.java:168)
at org.apache.beam.sdk.extensions.sql.zetasql.ZetaSQLQueryPlanner.convertToBeamRel(ZetaSQLQueryPlanner.java:156)
at org.apache.beam.sdk.extensions.sql.impl.BeamSqlEnv.parseQuery(BeamSqlEnv.java:110)
at org.apache.beam.sdk.extensions.sql.SqlTransform.expand(SqlTransform.java:135)
at org.apache.beam.sdk.extensions.sql.SqlTransform.expand(SqlTransform.java:86)
at org.apache.beam.sdk.Pipeline.applyInternal(Pipeline.java:542)
at org.apache.beam.sdk.Pipeline.applyTransform(Pipeline.java:493)
at org.apache.beam.sdk.values.PBegin.apply(PBegin.java:56)
at org.apache.beam.sdk.Pipeline.apply(Pipeline.java:186)
at com.google.cloud.dataflow.sqllauncher.DataflowSqlLauncher.buildPipelineOrThrow(DataflowSqlLauncher.java:177)
at com.google.cloud.dataflow.sqllauncher.DataflowSqlLauncher.buildPipeline(DataflowSqlLauncher.java:114)
at com.google.cloud.dataflow.sqllauncher.DataflowSqlLauncher.buildAndRunPipeline(DataflowSqlLauncher.java:105)
at com.google.cloud.dataflow.sqllauncher.DataflowSqlLauncher.main(DataflowSqlLauncher.java:73)

Google Glass Eye Gesture Crashing (EyeGestureLib)

I am trying to check Wink from Glass using the EyeGestureLib.
I created a new project and did exactly what the guy did with the sample project here.
The problem part of my code is below:
private EyeGestureManager mEyeGestureManager;
private EyeGestureListener mEyeGestureListener;
private EyeGesture target1 = EyeGesture.WINK;
private EyeGesture target2 = EyeGesture.DOUBLE_BLINK;
Inside onCreate, I have:
mEyeGestureManager = EyeGestureManager.from(this);
mEyeGestureListener = new EyeGestureListener();
// print out each eye gesture is supported or not
for (EyeGesture eg : EyeGesture.values()) {
boolean supported = mEyeGestureManager.isSupported(eg);
Log.d(TAG, eg.name() + ":" + supported);
}
My program crashes immediately after opening. I realize that the problem is when it tries to access
mEyeGestureManager. Any where in the code that uses mEyeGestureManager will make the program crash.According to what I observed, mEyeGestureManager is null even after mEyeGestureManager = EyeGestureManager.from(this);
When I change
mEyeGestureManager = EyeGestureManager.from(this);
to
mEyeGestureManager = new EyeGestureManager();
it stops crashing and mEyeGestureManager is no longer null but won't detect wink, or double wink.
My glass was running XE21 but I downgraded it to XE18.3 because my research shows that EyeGestureLib wont work properly on Glass version > XE18.3.
EyeGestures NOT working in 19.1
https://github.com/thorikawa/EyeGestureLib/issues/2
Now I have XE18.3 but it is not working. Wink is not working when I have
mEyeGestureManager = new EyeGestureManager();
and I get:
Supported:﹕ BLINK:false
Supported:﹕ DOFF:false
Supported:﹕ DON:false
Supported:﹕ DOUBLE_BLINK:false
Supported:﹕ DOUBLE_WINK:false
Supported:﹕ LOOK_AT_SCREEN:false
Supported:﹕ LOOK_AWAY_FROM_SCREEN:false
Supported:﹕ WINK:false
But when I have:
mEyeGestureManager = EyeGestureManager.from(this);
it crashes right away.
I went and installed already compiled example "EyeGestureDemo-debug-1.1.apk" and that WORKED very well but mine does not.
What am I doing wrong? I have been trying to do this for 3 days now. Google doesn't have an official API for this but I don't want to wait till they release one. I need this for my school project ASAP.
Anyone got any ideas of what might be the problem?
EDIT:
CRASH LOG
12-02 09:39:54.347 3758-3758/com.inno.inno.glassplugin D/AndroidRuntime﹕ Shutting down VM
12-02 09:39:54.347 3758-3758/com.inno.inno.glassplugin W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0x41f78bd8)
12-02 09:39:54.363 3758-3758/com.inno.inno.glassplugin E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.inno.inno.glassplugin, PID: 3758
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.inno.inno.glassplugin/com.inno.inno.glassplugin.MainActivity}: java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2235)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2285)
at android.app.ActivityThread.access$800(ActivityThread.java:138)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1236)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:149)
at android.app.ActivityThread.main(ActivityThread.java:5061)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at com.inno.inno.glassplugin.MainActivity.onCreate(MainActivity.java:92)
at android.app.Activity.performCreate(Activity.java:5236)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1089)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2199)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2285)
            at android.app.ActivityThread.access$800(ActivityThread.java:138)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1236)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:149)
            at android.app.ActivityThread.main(ActivityThread.java:5061)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:515)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)
            at dalvik.system.NativeStart.main(Native Method)
The API has changed a long time ago (around XE 20 I think).
I had to do quite a bit of digging with reflection to figure out the workings of EyeGestureManager.
Here's my updated version, along with some sample code demonstrating usage: https://gist.github.com/victorkp/9094a6aea9db236a97f3

Error protecting Glassfishv3 with J2ee-openam-agent

I am trying to protect a Glassfish v3.0.0 with a J2EE agent (v3.3.0 and OpenAM server v9.5.3).
The installation and deployment was OK, but when I log in with a valid user I get some errors.
I don´t know if it is a compatibility problem, a GlassFish misconfiguration or another thing.
These are the error logs:
Browser error
Exceptions details : null
________________________________________
java.lang.NullPointerException at java.io.File.(File.java:222) at org.glassfish.webservices.monitoring.WebServiceTesterServlet.initializePort(WebServiceTesterServlet.java:505) at org.glassfish.webservices.monitoring.WebServiceTesterServlet.doGet(WebServiceTesterServlet.java:165) at org.glassfish.webservices.monitoring.WebServiceTesterServlet.invoke(WebServiceTesterServlet.java:100) at org.glassfish.webservices.JAXWSServlet.doGet(JAXWSServlet.java:193) at javax.servlet.http.HttpServlet.service(HttpServlet.java:734) at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1523) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215) at com.sun.identity.agents.filter.AmAgentBaseFilter.allowRequestToContinue(AmAgentBaseFilter.java:128) at com.sun.identity.agents.filter.AmAgentBaseFilter.doFilter(AmAgentBaseFilter.java:78) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:277) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641) at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97) at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185) at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:332) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:233) at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:165) at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791) at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693) at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954) at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170) at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135) at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102) at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88) at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76) at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53) at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57) at com.sun.grizzly.ContextTask.run(ContextTask.java:69) at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330) at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309) at java.lang.Thread.run(Thread.java:662)
**GlassFish Log**
[#|2014-08-05T16:15:29.109+0200|WARNING|glassfishv3.0|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=24;_ThreadName=http-thread-pool-8080-(1);|StandardWrapperValve[default]: PWC1406: Servlet.service() for servlet default threw exception
java.lang.ClassNotFoundException: com.sun.identity.agents.filter.AmAgentFilter
at org.glassfish.web.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1985)
at org.glassfish.web.loader.WebappClassLoader.findClass(WebappClassLoader.java:888)
at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1420)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:245)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:277)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97)
at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:332)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:233)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:165)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
at java.lang.Thread.run(Thread.java:662)
|#]
[#|2014-08-05T16:15:29.109+0200|WARNING|glassfishv3.0|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=24;_ThreadName=Thread-1;|StandardWrapperValve[default]: PWC1406: Servlet.service() for servlet default threw exception
java.lang.ClassNotFoundException: com.sun.identity.agents.filter.AmAgentFilter
at org.glassfish.web.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1985)
at org.glassfish.web.loader.WebappClassLoader.findClass(WebappClassLoader.java:888)
at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1420)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:245)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:277)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97)
at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:332)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:233)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:165)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
at java.lang.Thread.run(Thread.java:662)
|#]
Thanks for your time and tips.

Tasks fail after BAM admin password change

After changing the default password for admin user in WSO2 BAM 4.1.0, tasks fail with the following error:
TID: [0] [BAM] [2013-06-20 16:56:15,464] ERROR {org.wso2.carbon.analytics.hive.impl.HiveExecutorServiceImpl} - Error while executing Hive script.
Query returned non-zero code: 9, cause: FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.MapRedTask {org.wso2.carbon.analytics.hive.impl.HiveExecutorServiceImpl}
java.sql.SQLException: Query returned non-zero code: 9, cause: FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.MapRedTask
at org.apache.hadoop.hive.jdbc.HiveStatement.executeQuery(HiveStatement.java:189)
at org.wso2.carbon.analytics.hive.impl.HiveExecutorServiceImpl$ScriptCallable.call(HiveExecutorServiceImpl.java:355)
at org.wso2.carbon.analytics.hive.impl.HiveExecutorServiceImpl$ScriptCallable.call(HiveExecutorServiceImpl.java:250)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
TID: [0] [BAM] [2013-06-20 16:56:15,467] ERROR {org.wso2.carbon.analytics.hive.task.HiveScriptExecutorTask} - Error while executing script : am_stats_analyzer_460 {org.wso2.carbon.analytics.hive.ta
sk.HiveScriptExecutorTask}
org.wso2.carbon.analytics.hive.exception.HiveExecutionException: Error while executing Hive script.Query returned non-zero code: 9, cause: FAILED: Execution Error, return code 2 from org.apache.hado
op.hive.ql.exec.MapRedTask
at org.wso2.carbon.analytics.hive.impl.HiveExecutorServiceImpl.execute(HiveExecutorServiceImpl.java:117)
at org.wso2.carbon.analytics.hive.task.HiveScriptExecutorTask.execute(HiveScriptExecutorTask.java:60)
at org.wso2.carbon.ntask.core.impl.TaskQuartzJobAdapter.execute(TaskQuartzJobAdapter.java:56)
at org.quartz.core.JobRunShell.run(JobRunShell.java:213)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
Reverting back the password to its original value solves the issue.
How do I change the password for the admin user and keep the tasks working?
Have you changed the username, password in the hive script am_stats_analyzer? The defaults are admin/admin, check the hive script and update the password accordingly. The property is as follows;
"cassandra.ks.username" = "admin",
"cassandra.ks.password" = "xxxxx",
Check if that fixes your issue.
In order to solve the issue I had to perform the following steps:
edit the file [BAM_HOME]/repository/conf/etc/cassandra-auth.xml and change the password value to the new password.
edit the file [BAM_HOME]/repository/conf/datasources/master-datasources.xml and change the password value of the WSO2BAM_CASSANDRA_DATASOURCE datasource to the new password.
restart the BAM: the Hive tasks now run without errors.
where the new password is the password I assigned to the admin user.
Moreover, the Main \ Manage \ Cassandra Keyspaces \ List page in the BAM UI, which was raising the following error, is now fixed:
org.wso2.carbon.cassandra.mgt.ui.CassandraAdminClientException: Error retrieving keyspace names !
(...)
Caused by: org.apache.axis2.AxisFault: InvalidRequestException(why:You have not logged in)
(...)
Sorry I couldn't follow up with the question earlier, anyway glad your problem is sorted now .! Keep on trying BAM and don't hesitate to holler if you run into any issues.
Thanks,
Shariq.

java.lang.ClassCastException: com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl cannot be cast to DocumentBuilderFactory

I am using powermock with powermock-easymock-1.5-full.jar. The following exception occurs.
These are the all jars i have in my classpath. And are downloaded as powermock package from http://code.google.com/p/powermock/downloads/detail?name=powermock-easymock-testng-1.5.zip&can=2&q=
easymock-3.1.jar
javassist-3.17.1-GA.jar
jcommander-1.27.jar
objenesis-1.2.jar
snakeyaml-1.6.jar
testng-6.8.jar
bsh-2.0b4.jar
cglib-nodep-2.2.2.jar
powermock-easymock-1.5-full.jar
java.lang.ClassCastException: com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl cannot be cast to javax.xml.parsers.DocumentBuilderFactory
at javax.xml.parsers.DocumentBuilderFactory.newInstance(Unknown Source)
at com.eibus.localization.message.MessageSet._tryGetMessageText(MessageSet.java:268)
at com.eibus.localization.message.Message._tryGetMessage(Message.java:135)
at com.eibus.localization.message.Message.getMessage(Message.java:110)
at com.eibus.localization.message.Message.getMessageWithLocaleFallBack(Message.java:155)
at com.eibus.localization.StringFormatter.getMessageWithFallBack(StringFormatter.java:141)
at com.eibus.localization.StringFormatter.format(StringFormatter.java:43)
at com.eibus.localization.LocalizableComposite.getMessage(LocalizableComposite.java:42)
at com.eibus.localization.exception.LocalizableException.getMessage(LocalizableException.java:168)
at com.eibus.localization.exception.LocalizableException.getLocalizedMessage(LocalizableException.java:130)
at java.lang.Throwable.toString(Throwable.java:479)
at java.lang.String.valueOf(Unknown Source)
at java.io.PrintWriter.println(Unknown Source)
at java.lang.Throwable$WrappedPrintWriter.println(Unknown Source)
at java.lang.Throwable.printStackTrace(Throwable.java:654)
at java.lang.Throwable.printStackTrace(Throwable.java:720)
at org.junit.runner.notification.Failure.getTrace(Failure.java:67)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestListener.testFailure(JUnit4TestListener.java:68)
at org.junit.runner.notification.RunNotifier$4.notifyListener(RunNotifier.java:100)
at org.junit.runner.notification.RunNotifier$SafeNotifier.run(RunNotifier.java:41)
at org.junit.runner.notification.RunNotifier.fireTestFailure(RunNotifier.java:97)
at org.junit.internal.runners.MethodRoadie.addFailure(MethodRoadie.java:154)
at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl$PowerMockJUnit44MethodRunner.handleException(PowerMockJUnit44RunnerDelegateImpl.java:359)
at org.powermock.modules.junit4.internal.impl.PowerMockJUnit49RunnerDelegateImpl$PowerMockJUnit49MethodRunner.executeTest(PowerMockJUnit49RunnerDelegateImpl.java:93)
at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl$PowerMockJUnit44MethodRunner.runBeforesThenTestThenAfters(PowerMockJUnit44RunnerDelegateImpl.java:284)
at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:84)
at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:49)
at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl.invokeTestMethod(PowerMockJUnit44RunnerDelegateImpl.java:209)
at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl.runMethods(PowerMockJUnit44RunnerDelegateImpl.java:148)
at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl$1.run(PowerMockJUnit44RunnerDelegateImpl.java:122)
at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:34)
at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:44)
at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl.run(PowerMockJUnit44RunnerDelegateImpl.java:120)
at org.powermock.modules.junit4.common.internal.impl.JUnit4TestSuiteChunkerImpl.run(JUnit4TestSuiteChunkerImpl.java:101)
at org.powermock.modules.junit4.common.internal.impl.AbstractCommonPowerMockRunner.run(AbstractCommonPowerMockRunner.java:53)
at org.powermock.modules.junit4.PowerMockRunner.run(PowerMockRunner.java:53)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Please help me
Here is something that worked for me:
#PowerMockIgnore({"javax.xml.*", "org.xml.sax.*", "org.w3c.dom.*", "org.springframework.context.*", "org.apache.log4j.*"})
If this is a PowerMock related problem, then you can try to annotate you test class with:
#PowerMockIgnore({"javax.xml.parsers.*", "com.sun.org.apache.xerces.internal.jaxp.*"})
You can ignore the log4j.. I have the same problem with jptool logger. And I already resolved by ignoring it
Here is my code
#PowerMockIgnore({"jptools."})
This is a PowerMock problem, I had this error:
java.lang.ClassCastException: class sun.security.provider.ConfigFile
that you can resolve with this annotation, try to annotate you test class with :
#PowerMockIgnore({"javax.management.*", "java.lang.*", "javax.security.*" })
You can create a configuration.properties file in test/resources/org/powermock/extensions/ with content:
powermock.global-ignore=org.apache.xerces.*,javax.xml.parsers.*,org.xml.sax.*
Note: Comma separation and NO spaces in the property value, otherwise, it will not work!
The list of packages depends on the dependencies of your project.
PowerMock Configuration here.