HtmlDataTable Not Serializable - jsf-1.2

I am trying to Session repication in cluster envoirnment. After change all my backing beans to serialized object but I am unable to Serialize HtmlDataTable
Caused By: java.io.NotSerializableException: javax.faces.component.html.HtmlDataTable
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1165)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1401)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1159)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:332)
at weblogic.servlet.internal.session.ReplicatedSessionChange.writeExternal(ReplicatedSessionChange.java:124)
at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1430)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1399)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1159)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:332)
at weblogic.rjvm.MsgAbbrevOutputStream.writeObject(MsgAbbrevOutputStream.java:618)
at weblogic.rjvm.MsgAbbrevOutputStream.writeObjectWL(MsgAbbrevOutputStream.java:609)
at weblogic.rmi.internal.ObjectIO.writeObject(ObjectIO.java:38)
at weblogic.rjvm.BasicOutboundRequest.marshalArgs(BasicOutboundRequest.java:88)
at weblogic.rmi.internal.BasicRemoteRef.invoke(BasicRemoteRef.java:221)
at weblogic.cluster.replication.ReplicationManager_1033_WLStub.update(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:600)
at weblogic.cluster.replication.SecureReplicationInvocationHandler$ReplicationServicesInvocationAction.run(SecureReplicationInvocationHandler.java:184)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.cluster.replication.SecureReplicationInvocationHandler.invoke(SecureReplicationInvocationHandler.java:154)
at $Proxy58.update(Unknown Source)
at weblogic.cluster.replication.ReplicationManager.updateSecondary(ReplicationManager.java:532)
at weblogic.servlet.internal.session.ReplicatedSessionData.syncSession(ReplicatedSessionData.java:594)
at weblogic.servlet.internal.session.ReplicatedSessionContext.sync(ReplicatedSessionContext.java:85)
at weblogic.servlet.internal.ServletRequestImpl$SessionHelper.syncSession(ServletRequestImpl.java:2810)
at weblogic.servlet.internal.ServletRequestImpl$SessionHelper.syncSession(ServletRequestImpl.java:2785)
at weblogic.servlet.internal.ServletResponseImpl$1.run(ServletResponseImpl.java:1480)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.ServletResponseImpl.send(ServletResponseImpl.java:1474)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1455)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
Please help....

Related

How to avoid JSON convert error between com.google.gson.JsonObject and com.fasterxml.jackson.databind.ObjectMapper

I use Microsoft Graph SDK for java to get outlook event list as below:
IEventCollectionPage eventPage = graphClient.users(email).calendar().events().buildRequest(requestOptions).select("subject,body,bodyPreview,organizer,attendees,start,end,location").get();
List<com.microsoft.graph.models.extensions.Event> eventList = evevtPage.getCurrentPage();
com.microsoft.graph.models.extensions.Event has a com.google.gson.JsonObject rawObject, and when it converted by com.fasterxml.jackson.databind.ObjectWriter.writeValue, I got error as below:
java.lang.UnsupportedOperationException: JsonObject
com.google.gson.JsonElement.getAsString(JsonElement.java:192)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:654)
com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:675)
com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:157)
com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:693)
com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:675)
com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:157)
com.fasterxml.jackson.databind.ser.impl.IndexedListSerializer.serializeContents(IndexedListSerializer.java:119)
com.fasterxml.jackson.databind.ser.impl.IndexedListSerializer.serialize(IndexedListSerializer.java:79)
com.fasterxml.jackson.databind.ser.impl.IndexedListSerializer.serialize(IndexedListSerializer.java:18)
com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:693)
com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:675)
com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:157)
com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:130)
com.fasterxml.jackson.databind.ObjectWriter$Prefetch.serialize(ObjectWriter.java:1387)
com.fasterxml.jackson.databind.ObjectWriter.writeValue(ObjectWriter.java:889)
org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter.writeInternal(AbstractJackson2HttpMessageConverter.java:269)
org.springframework.http.converter.AbstractGenericHttpMessageConverter.write(AbstractGenericHttpMessageConverter.java:100)
org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodProcessor.writeWithMessageConverters(AbstractMessageConverterMethodProcessor.java:222)
org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodProcessor.writeWithMessageConverters(AbstractMessageConverterMethodProcessor.java:153)
org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor.handleReturnValue(RequestResponseBodyMethodProcessor.java:165)
org.springframework.web.method.support.HandlerMethodReturnValueHandlerComposite.handleReturnValue(HandlerMethodReturnValueHandlerComposite.java:81)
org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:126)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:814)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:737)
org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:969)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:860)
javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:845)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
jp.co.smfl.ng.managers.spi.DefaultMaintenanceManagerFilter.doFilter(DefaultMaintenanceManagerFilter.java:41)
jp.co.smfl.ng.securities.TwoFactorAuthenticationFilter.doFilter(TwoFactorAuthenticationFilter.java:164)
jp.co.smfl.ng.securities.FormAuthenticationFilter.doFilter(FormAuthenticationFilter.java:280)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:121)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
What can I do to parse it without exception?

Problems opening the jar

I made in netbeans a jar, but when I double clicked it, nothing happen
C:\Users\itzel\Documents>java -jar ColaDeVuelos.jar
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at javax.swing.ImageIcon.<init>(Unknown Source)
at GUI.MenuPrincipal.initComponents(MenuPrincipal.java:110)
at GUI.MenuPrincipal.<init>(MenuPrincipal.java:30)
at GUI.MenuPrincipal$5.run(MenuPrincipal.java:184)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$500(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unkno
wn Source)
Looks like your code is running and throwing NullPointerException.
I guess there is an error in MenuPrincipal.java file.
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at GUI.MenuPrincipal$5.run(MenuPrincipal.java:184)

Sparklyr - Unable to instantiate SessionHiveMetaStoreClient

When trying to connect to a Spark cluster (Spark 2.0.1) from R Studio using sparklyr (0.5.3) library (same machine in the cloud) I am getting an error as below.
It looks like an md_metastore is needed, which fails to instantiate.
I have no hive-site.xml config file (not sure if this might be an issue).
spark.sql.warehouse.dir = file:///usr/lib/spark/spark-2.0.1-bin-hadoop2.6/warehouse
Any ideas what could be wrong?
Thanks, Michal
library(sparklyr)
# Set up environment variables
Sys.setenv(SPARK_HOME="/usr/lib/spark/spark-2.0.1-bin-hadoop2.6")
config <- spark_config()
sc <- spark_connect(master = "spark://my-ip-address:7077", spark_home=Sys.getenv("SPARK_HOME"),
config=config)
iris_tbl <- copy_to(sc, iris, overwrite = TRUE)
Log message:
Error: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at org.apache.spark.sql.hive.client.IsolatedClientLoader.createClient(IsolatedClientLoader.scala:258)
at org.apache.spark.sql.hive.HiveUtils$.newClientForMetadata(HiveUtils.scala:359)
at org.apache.spark.sql.hive.HiveUtils$.newClientForMetadata(HiveUtils.scala:263)
at org.apache.spark.sql.hive.HiveSharedState.metadataHive$lzycompute(HiveSharedState.scala:39)
at org.apache.spark.sql.hive.HiveSharedState.metadataHive(HiveSharedState.scala:38)
at org.apache.spark.sql.hive.HiveSharedState.externalCatalog$lzycompute(HiveSharedState.scala:46)
at org.apache.spark.sql.hive.HiveSharedState.externalCatalog(HiveSharedState.scala:45)
at org.apache.spark.sql.hive.HiveSessionState.catalog$lzycompute(HiveSessionState.scala:50)
at org.apache.spark.sql.hive.HiveSessionState.catalog(HiveSessionState.scala:48)
at org.apache.spark.sql.hive.HiveSessionState$$anon$1.<init>(HiveSessionState.scala:63)
at org.apache.spark.sql.hive.HiveSessionState.analyzer$lzycompute(HiveSessionState.scala:63)
at org.apache.spark.sql.hive.HiveSessionState.analyzer(HiveSessionState.scala:62)
at org.apache.spark.sql.execution.QueryExecution.assertAnalyzed(QueryExecution.scala:49)
at org.apache.spark.sql.Dataset$.ofRows(Dataset.scala:64)
at org.apache.spark.sql.SparkSession.sql(SparkSession.scala:582)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at sparklyr.Invoke$.invoke(invoke.scala:96)
at sparklyr.StreamHandler$.handleMethodCall(stream.scala:89)
at sparklyr.StreamHandler$.read(stream.scala:55)
at sparklyr.BackendHandler.channelRead0(handler.scala:49)
at sparklyr.BackendHandler.channelRead0(handler.scala:14)
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294)
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:244)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:846)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354)
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:111)
at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient
at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:522)
at org.apache.spark.sql.hive.client.HiveClientImpl.<init>(HiveClientImpl.scala:189)
... 46 more
Caused by: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient
at org.apache.hadoop.hive.metastore.MetaStoreUtils.newInstance(MetaStoreUtils.java:1523)
at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.<init>(RetryingMetaStoreClient.java:86)
at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.getProxy(RetryingMetaStoreClient.java:132)
at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.getProxy(RetryingMetaStoreClient.java:104)
at org.apache.hadoop.hive.ql.metadata.Hive.createMetaStoreClient(Hive.java:3005)
at org.apache.hadoop.hive.ql.metadata.Hive.getMSC(Hive.java:3024)
at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:503)
... 47 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at org.apache.hadoop.hive.metastore.MetaStoreUtils.newInstance(MetaStoreUtils.java:1521)
... 53 more
Caused by: javax.jdo.JDOFatalDataStoreException: Unable to open a test connection to the given database. JDBC url = jdbc:derby:;databaseName=metastore_db;create=true, username = APP. Terminating connection pool (set lazyInit to true if you expect to start your database after your app). Original Exception: ------
java.sql.SQLException: Failed to start database 'metastore_db' with class loader org.apache.spark.sql.hive.client.IsolatedClientLoader$$anon$1#ec4d331, see the next exception for details.
at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.Util.seeNextException(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection.bootDatabase(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection.<init>(Unknown Source)
at org.apache.derby.jdbc.InternalDriver$1.run(Unknown Source)
at org.apache.derby.jdbc.InternalDriver$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.derby.jdbc.InternalDriver.getNewEmbedConnection(Unknown Source)
at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
at org.apache.derby.jdbc.AutoloadedDriver.connect(Unknown Source)
at java.sql.DriverManager.getConnection(DriverManager.java:571)
at java.sql.DriverManager.getConnection(DriverManager.java:187)
at com.jolbox.bonecp.BoneCP.obtainRawInternalConnection(BoneCP.java:361)
at com.jolbox.bonecp.BoneCP.<init>(BoneCP.java:416)
at com.jolbox.bonecp.BoneCPDataSource.getConnection(BoneCPDataSource.java:120)
at org.datanucleus.store.rdbms.ConnectionFactoryImpl$ManagedConnectionImpl.getConnection(ConnectionFactoryImpl.java:501)
at org.datanucleus.store.rdbms.RDBMSStoreManager.<init>(RDBMSStoreManager.java:298)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at org.datanucleus.plugin.NonManagedPluginRegistry.createExecutableExtension(NonManagedPluginRegistry.java:631)
at org.datanucleus.plugin.PluginManager.createExecutableExtension(PluginManager.java:301)
at org.datanucleu
Thanks to Blue Data support I finally got the working solution - it was a bdfs specific error connected to data taps usage (dtap protocol).
All I had to do is edit the file /usr/lib/spark/spark-2.0.1-bin-hadoop2.6/conf/core-site.xml on Spark master and remove defaultFS property:
<property>
<name>fs.defaultFS</name>
<value>dtap://TenantStorage/</value>
</property>
Then restart Spark master:
sudo service spark-master restart
Same thing had to be done on all the worker nodes as well.

JavaFX upcall. Cannot cast JSObject

I have followed the example from oracles site it works fine if I just import there example as a standalone project.
With my project I have an abstract UI and I believe I have imported the correct packages. The error I run into is the casting of JSObject when you call the webengine.executeScript("window"). My abstract UI plugin is a container for JavaFX which I then use the webview to display HTML.
This is the error I receive:
java.lang.ClassCastException: com.sun.webpane.webkit.dom.JSObject cannot be cast to netscape.javascript.JSObject
at com.interpro.emmeclipse.views.PageBuilderPart$1.changed(PageBuilderPart.java:48)
at com.interpro.emmeclipse.views.PageBuilderPart$1.changed(PageBuilderPart.java:1)
at com.sun.javafx.binding.ExpressionHelper$SingleChange.fireValueChangedEvent(Unknown Source)
at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(Unknown Source)
at javafx.beans.property.ReadOnlyObjectWrapper$ReadOnlyPropertyImpl.fireValueChangedEvent(Unknown Source)
at javafx.beans.property.ReadOnlyObjectWrapper.fireValueChangedEvent(Unknown Source)
at javafx.beans.property.ObjectPropertyBase.markInvalid(Unknown Source)
at javafx.beans.property.ObjectPropertyBase.set(Unknown Source)
at javafx.scene.web.WebEngine$LoadWorker.updateState(Unknown Source)
at javafx.scene.web.WebEngine$LoadWorker.dispatchLoadEvent(Unknown Source)
at javafx.scene.web.WebEngine$LoadWorker.access$600(Unknown Source)
at javafx.scene.web.WebEngine$PageLoadListener.dispatchLoadEvent(Unknown Source)
at com.sun.webpane.platform.WebPage.fireLoadEvent(Unknown Source)
at com.sun.webpane.platform.WebPage.fwkFireLoadEvent(Unknown Source)
at com.sun.webpane.webkit.network.URLLoader.twkDidFail(Native Method)
at com.sun.webpane.webkit.network.URLLoader.access$1400(Unknown Source)
at com.sun.webpane.webkit.network.URLLoader$7.run(Unknown Source)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(Unknown Source)
at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2546)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3756)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1053)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:942)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:86)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:588)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:543)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
at org.eclipse.equinox.launcher.Main.main(Main.java:1414)
I have failed to include the netscape.javascript as an import package on the plugin manifest.

Robolectric 2.0 not creating views when testing

I'm trying to set up testing with robolectric and roboguice. I'm successfully injecting and testing classes but when i try to test activities i can't seem to create View objects in the test environment
I get the following errors
testAttemptsLoginWhenSignInButtonIsClicked(com.clearc2.HomeActivityTest)
Time elapsed: 2.234 sec <<< ERROR! java.lang.RuntimeException: Failed
to create a android.widget.EditText at
org.robolectric.res.builder.LayoutBuilder.constructView(LayoutBuilder.java:182)
at
org.robolectric.res.builder.LayoutBuilder.create(LayoutBuilder.java:109)
at
org.robolectric.res.builder.LayoutBuilder.doInflate(LayoutBuilder.java:42)
at
org.robolectric.res.builder.LayoutBuilder.doInflate(LayoutBuilder.java:45)
at
org.robolectric.res.builder.LayoutBuilder.doInflate(LayoutBuilder.java:45)
at
org.robolectric.res.builder.LayoutBuilder.doInflate(LayoutBuilder.java:45)
at
org.robolectric.res.builder.LayoutBuilder.inflateView(LayoutBuilder.java:62)
at
org.robolectric.shadows.ShadowLayoutInflater.inflate(ShadowLayoutInflater.java:50)
at
org.robolectric.shadows.ShadowLayoutInflater.inflate(ShadowLayoutInflater.java:55)
at android.view.LayoutInflater.inflate(LayoutInflater.java) at
org.robolectric.tester.android.view.RoboWindow.setContentView(RoboWindow.java:80)
at
org.robolectric.shadows.ShadowActivity.setContentView(ShadowActivity.java:265)
at android.app.Activity.setContentView(Activity.java) at
com.clearc2.HomeActivity.onCreate(HomeActivity.java:38) at
com.clearc2.HomeActivityTest.setUp(HomeActivityTest.java:22) at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
at
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at
org.robolectric.RobolectricTestRunner$2.evaluate(RobolectricTestRunner.java:246)
at
org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) at
org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) at
org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) at
org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) at
org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) at
org.robolectric.RobolectricTestRunner$1.evaluate(RobolectricTestRunner.java:181)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236) at
org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:59)
at
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:120)
at
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:103)
at org.apache.maven.surefire.Surefire.run(Surefire.java:169) at
org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:350)
at
org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1021)
Caused by: java.lang.reflect.InvocationTargetException at
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at
org.robolectric.res.builder.LayoutBuilder.constructView(LayoutBuilder.java:167)
at
org.robolectric.res.builder.LayoutBuilder.create(LayoutBuilder.java:109)
at
org.robolectric.res.builder.LayoutBuilder.doInflate(LayoutBuilder.java:42)
at
org.robolectric.res.builder.LayoutBuilder.doInflate(LayoutBuilder.java:45)
at
org.robolectric.res.builder.LayoutBuilder.doInflate(LayoutBuilder.java:45)
at
org.robolectric.res.builder.LayoutBuilder.doInflate(LayoutBuilder.java:45)
at
org.robolectric.res.builder.LayoutBuilder.inflateView(LayoutBuilder.java:62)
at
org.robolectric.shadows.ShadowLayoutInflater.inflate(ShadowLayoutInflater.java:50)
at
org.robolectric.shadows.ShadowLayoutInflater.inflate(ShadowLayoutInflater.java:55)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601) at
org.robolectric.bytecode.ShadowWrangler$ShadowMethodPlan.run(ShadowWrangler.java:440)
at android.view.LayoutInflater.inflate(LayoutInflater.java) at
org.robolectric.tester.android.view.RoboWindow.setContentView(RoboWindow.java:80)
at
org.robolectric.shadows.ShadowActivity.setContentView(ShadowActivity.java:265)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601) at
org.robolectric.bytecode.ShadowWrangler$ShadowMethodPlan.run(ShadowWrangler.java:440)
at android.app.Activity.setContentView(Activity.java) at
com.clearc2.HomeActivity.onCreate(HomeActivity.java:38) at
com.clearc2.HomeActivityTest.setUp(HomeActivityTest.java:22) at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601) at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
at
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at
org.robolectric.RobolectricTestRunner$2.evaluate(RobolectricTestRunner.java:246)
at
org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) at
org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) at
org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) at
org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) at
org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) at
org.robolectric.RobolectricTestRunner$1.evaluate(RobolectricTestRunner.java:181)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236) at
org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:59)
at
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:120)
at
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:103)
at org.apache.maven.surefire.Surefire.run(Surefire.java:169) at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601) ... 2 more
Caused by: java.lang.NumberFormatException: For input string: "#0" at
java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:492) at
com.android.internal.util.XmlUtils.convertValueToInt(XmlUtils.java:123)
at android.content.res.TypedArray.getInt(TypedArray.java:254) at
android.widget.TextView.constructor(TextView.java:827) at
android.widget.TextView.(TextView.java:447) at
android.widget.EditText.(EditText.java:60) at
android.widget.EditText.(EditText.java:56) at
org.robolectric.res.builder.LayoutBuilder.constructView(LayoutBuilder.java:167)
at
org.robolectric.res.builder.LayoutBuilder.create(LayoutBuilder.java:109)
at
org.robolectric.res.builder.LayoutBuilder.doInflate(LayoutBuilder.java:42)
at
org.robolectric.res.builder.LayoutBuilder.doInflate(LayoutBuilder.java:45)
at
org.robolectric.res.builder.LayoutBuilder.doInflate(LayoutBuilder.java:45)
at
org.robolectric.res.builder.LayoutBuilder.doInflate(LayoutBuilder.java:45)
at
org.robolectric.res.builder.LayoutBuilder.inflateView(LayoutBuilder.java:62)
at
org.robolectric.shadows.ShadowLayoutInflater.inflate(ShadowLayoutInflater.java:50)
at
org.robolectric.shadows.ShadowLayoutInflater.inflate(ShadowLayoutInflater.java:55)
at android.view.LayoutInflater.inflate(LayoutInflater.java) at
org.robolectric.tester.android.view.RoboWindow.setContentView(RoboWindow.java:80)
at
org.robolectric.shadows.ShadowActivity.setContentView(ShadowActivity.java:265)
at android.app.Activity.setContentView(Activity.java) at
com.clearc2.HomeActivity.onCreate(HomeActivity.java:38) at
com.clearc2.HomeActivityTest.setUp(HomeActivityTest.java:22) at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
at
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at
org.robolectric.RobolectricTestRunner$2.evaluate(RobolectricTestRunner.java:246)
at
org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) at
org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) at
org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) at
org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) at
org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) at
org.robolectric.RobolectricTestRunner$1.evaluate(RobolectricTestRunner.java:181)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236) at
org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:59)
at
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:120)
at
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:103)
at org.apache.maven.surefire.Surefire.run(Surefire.java:169) ... 2
more
found the problem. Robolectric didn't like the android ime options set on my password EditText. As soon as i removed those lines the test ran as expected.
I've had similar errors, but the issue was imeActionId, not imeOptions. Removing the imeActionId from the XML and setting it in code (but keeping the imeOptions) solved this problem.
Here were my errors for reference and for search engine crawlers so people can find this answer easier:
android.view.InflateException: XML file app/build/intermediates/res/debug/layout/fragment_registration_form.xml
line #-1 (sorry, not yet implemented): Error inflating class com.company.project.widgets.MyCustomEditTextView
...
Caused by: java.lang.reflect.InvocationTargetException
...
Caused by: java.lang.NumberFormatException: For input string: "#0"
...
I guess Robolectric cannot parse the imeActionId correctly for some reason. Looks like it's related to the issue described in this question: Why does setting imeActionId with a predefined ID resource create an error?

Resources