InflateException while LayoutInflater.inflate - android-layout

Code crashes at second line:
LayoutInflater li = LayoutInflater.from(MyContext);
vView = li.inflate(R.layout.video, null);
Layout - video.xml
<linearlayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/GridItem"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:gravity="center_horizontal"
android:background="#000080">
<imageview android:id="#+id/grid_item_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</imageview>
<textview android:id="#+id/grid_item_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView"
android:gravity="center_horizontal"
android:textColor="#000000">
</textview>
</linearlayout>
Call Stack:
07-15 16:40:57.909: WARN/dalvikvm(7936): threadid=1: thread exiting with uncaught exception (group=0x40018560)
07-15 16:40:57.997: ERROR/AndroidRuntime(7936): FATAL EXCEPTION: main
07-15 16:40:57.997: ERROR/AndroidRuntime(7936): android.view.InflateException: Binary XML file line #1: Error inflating class linearlayout
07-15 16:40:57.997: ERROR/AndroidRuntime(7936): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:581)
07-15 16:40:57.997: ERROR/AndroidRuntime(7936): at android.view.LayoutInflater.inflate(LayoutInflater.java:386)
07-15 16:40:57.997: ERROR/AndroidRuntime(7936): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
07-15 16:40:57.997: ERROR/AndroidRuntime(7936): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
07-15 16:40:57.997: ERROR/AndroidRuntime(7936): at com.nitin.videosurf.VideoAdapter.getView(VideoAdapter.java:71)
07-15 16:40:57.997: ERROR/AndroidRuntime(7936): at android.widget.AbsListView.obtainView(AbsListView.java:1456)
07-15 16:40:57.997: ERROR/AndroidRuntime(7936): at android.widget.GridView.onMeasure(GridView.java:944)
07-15 16:40:57.997: ERROR/AndroidRuntime(7936): at android.view.View.measure(View.java:8322)
07-15 16:40:57.997: ERROR/AndroidRuntime(7936): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3138)
07-15 16:40:57.997: ERROR/AndroidRuntime(7936): at android.widget.FrameLayout.onMeasure(FrameLayout.java:250)
07-15 16:40:57.997: ERROR/AndroidRuntime(7936): at android.view.View.measure(View.java:8322)
07-15 16:40:57.997: ERROR/AndroidRuntime(7936): at android.widget.LinearLayout.measureVertical(LinearLayout.java:531)
07-15 16:40:57.997: ERROR/AndroidRuntime(7936): at android.widget.LinearLayout.onMeasure(LinearLayout.java:309)
07-15 16:40:57.997: ERROR/AndroidRuntime(7936): at android.view.View.measure(View.java:8322)
07-15 16:40:57.997: ERROR/AndroidRuntime(7936): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3138)
07-15 16:40:57.997: ERROR/AndroidRuntime(7936): at android.widget.FrameLayout.onMeasure(FrameLayout.java:250)
07-15 16:40:57.997: ERROR/AndroidRuntime(7936): at android.view.View.measure(View.java:8322)
07-15 16:40:57.997: ERROR/AndroidRuntime(7936): at android.view.ViewRoot.performTraversals(ViewRoot.java:839)
07-15 16:40:57.997: ERROR/AndroidRuntime(7936): at android.view.ViewRoot.handleMessage(ViewRoot.java:1859)
07-15 16:40:57.997: ERROR/AndroidRuntime(7936): at android.os.Handler.dispatchMessage(Handler.java:99)
07-15 16:40:57.997: ERROR/AndroidRuntime(7936): at android.os.Looper.loop(Looper.java:123)
07-15 16:40:57.997: ERROR/AndroidRuntime(7936): at android.app.ActivityThread.main(ActivityThread.java:3806)
07-15 16:40:57.997: ERROR/AndroidRuntime(7936): at java.lang.reflect.Method.invokeNative(Native Method)
07-15 16:40:57.997: ERROR/AndroidRuntime(7936): at java.lang.reflect.Method.invoke(Method.java:507)
07-15 16:40:57.997: ERROR/AndroidRuntime(7936): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
07-15 16:40:57.997: ERROR/AndroidRuntime(7936): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
07-15 16:40:57.997: ERROR/AndroidRuntime(7936): at dalvik.system.NativeStart.main(Native Method)
07-15 16:40:57.997: ERROR/AndroidRuntime(7936): Caused by: java.lang.ClassNotFoundException: android.view.linearlayout in loader dalvik.system.PathClassLoader[/data/app/com.nitin.videosurf-2.apk]
07-15 16:40:57.997: ERROR/AndroidRuntime(7936): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
07-15 16:40:57.997: ERROR/AndroidRuntime(7936): at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
07-15 16:40:57.997: ERROR/AndroidRuntime(7936): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
07-15 16:40:57.997: ERROR/AndroidRuntime(7936): at android.view.LayoutInflater.createView(LayoutInflater.java:471)
07-15 16:40:57.997: ERROR/AndroidRuntime(7936): at android.view.LayoutInflater.onCreateView(LayoutInflater.java:549)
07-15 16:40:57.997: ERROR/AndroidRuntime(7936): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:66)
07-15 16:40:57.997: ERROR/AndroidRuntime(7936): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:568)
07-15 16:40:57.997: ERROR/AndroidRuntime(7936): ... 26 more

It was simple and stupid issue: <linearlayout> <imageview> <textview> etc needs to capitalized to <LinearLayout> <ImageView> <TextView>.

Related

java.lang.NullPointerException at com.sun.faces.el.ELUtils.coerce

I am using javax.faces-2.2.9.jar on websphere 8.5 on cluster environment, and in my web.xml I have the <distributable /> tag and also the ClientSideSecretKey :
<env-entry>
<env-entry-name>jsf/ClientSideSecretKey</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>somekeyhere</env-entry-value>
</env-entry>
I am using jboss-el-2.0.0.GA.jar :
<context-param>
<param-name>com.sun.faces.expressionFactory</param-name>
<param-value>org.jboss.el.ExpressionFactoryImpl</param-value>
</context-param>
1- my session bean :
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
#ManagedBean(name = "mySessionBean")
#SessionScoped
public class UserBean {
}
2- my view bean :
#ManagedBean(name = "myViewBean")
#ViewScoped
public class MyViewBean {
#ManagedProperty(value = "#{mySessionBean}")
private MySessionBean mySessionBean;
}
My application works fine most of the time, but sometimes I see in the log file the following exception which I don't know the reason for it:
Unable to set property mySessionBean for managed bean myViewBean com.sun.faces.mgbean.ManagedBeanCreationException: Unable to set property mySessionBean for managed bean myViewBean
at com.sun.faces.mgbean.ManagedBeanBuilder$BakedBeanProperty.set(Unknown Source)
at com.sun.faces.mgbean.ManagedBeanBuilder.buildBean(Unknown Source)
at com.sun.faces.mgbean.BeanBuilder.build(Unknown Source)
at com.sun.faces.mgbean.BeanManager.createAndPush(Unknown Source)
at com.sun.faces.mgbean.BeanManager.create(Unknown Source)
at com.sun.faces.el.ManagedBeanELResolver.resolveBean(Unknown Source)
at com.sun.faces.el.ManagedBeanELResolver.getValue(Unknown Source)
at com.sun.faces.el.DemuxCompositeELResolver._getValue(Unknown Source)
at com.sun.faces.el.DemuxCompositeELResolver.getValue(Unknown Source)
at org.jboss.el.parser.AstIdentifier.getValue(AstIdentifier.java:44)
at org.jboss.el.parser.AstValue.getTarget(AstValue.java:34)
at org.jboss.el.parser.AstValue.invoke(AstValue.java:95)
at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
at com.sun.faces.facelets.el.TagMethodExpression.invoke(Unknown Source)
at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(Unknown Source)
at com.sun.faces.application.ActionListenerImpl.processAction(Unknown Source)
at org.primefaces.application.DialogActionListener.processAction(DialogActionListener.java:45)
at javax.faces.component.UIViewAction.broadcast(Unknown Source)
at javax.faces.component.UIViewRoot.broadcastEvents(Unknown Source)
at javax.faces.component.UIViewRoot.processApplication(Unknown Source)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(Unknown Source)
at com.sun.faces.lifecycle.Phase.doPhase(Unknown Source)
at com.sun.faces.lifecycle.LifecycleImpl.execute(Unknown Source)
at javax.faces.webapp.FacesServlet.service(Unknown Source)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1230)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:779)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:478)
at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.invokeTarget(WebAppFilterChain.java:136)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:97)
at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:100)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:195)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:91)
at com.filenet.ae.toolkit.server.servlet.filter.PostprocessorFilter.doFilter(PostprocessorFilter.java:38)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:195)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:91)
at com.filenet.ae.toolkit.server.servlet.filter.ContainerBasedFilter.doFilter(ContainerBasedFilter.java:218)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:195)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:91)
at com.filenet.ae.toolkit.server.servlet.filter.PreprocessorFilter.doFilter(PreprocessorFilter.java:91)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:195)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:91)
at com.filenet.ae.toolkit.server.servlet.filter.SecurityPluginFilter.doFilter(SecurityPluginFilter.java:202)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:195)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:91)
at com.filenet.ae.toolkit.server.servlet.filter.ThreadLocalCleanupFilter.doFilter(ThreadLocalCleanupFilter.java:50)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:195)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:91)
at gov.myapp.web.filter.CoordinatorSecurityFilter.doFilter(CoordinatorSecurityFilter.java:150)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:195)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:91)
at com.dataserve.common.CompatibleFilter.doFilter(CompatibleFilter.java:53)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:195)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:91)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:964)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1104)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3901)
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:304)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:981)
at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1662)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:200)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:463)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:530)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:316)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:287)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:175)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1865)
Caused by: java.lang.NullPointerException
at com.sun.faces.el.ELUtils.coerce(Unknown Source)
at com.sun.faces.mgbean.BeanBuilder$Expression.evaluate(Unknown Source)
... 75 more
[10/25/18 18:19:20:341 AST] 00000243 PrimeExceptio E <Null Message>
java.lang.NullPointerException
at com.sun.faces.el.ELUtils.coerce(Unknown Source)
at com.sun.faces.mgbean.BeanBuilder$Expression.evaluate(Unknown Source)
at com.sun.faces.mgbean.ManagedBeanBuilder$BakedBeanProperty.set(Unknown Source)
at com.sun.faces.mgbean.ManagedBeanBuilder.buildBean(Unknown Source)
at com.sun.faces.mgbean.BeanBuilder.build(Unknown Source)
at com.sun.faces.mgbean.BeanManager.createAndPush(Unknown Source)
at com.sun.faces.mgbean.BeanManager.create(Unknown Source)
at com.sun.faces.el.ManagedBeanELResolver.resolveBean(Unknown Source)
at com.sun.faces.el.ManagedBeanELResolver.getValue(Unknown Source)
at com.sun.faces.el.DemuxCompositeELResolver._getValue(Unknown Source)
at com.sun.faces.el.DemuxCompositeELResolver.getValue(Unknown Source)
at org.jboss.el.parser.AstIdentifier.getValue(AstIdentifier.java:44)
at org.jboss.el.parser.AstValue.getTarget(AstValue.java:34)
at org.jboss.el.parser.AstValue.invoke(AstValue.java:95)
at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
at com.sun.faces.facelets.el.TagMethodExpression.invoke(Unknown Source)
at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(Unknown Source)
at com.sun.faces.application.ActionListenerImpl.processAction(Unknown Source)
at org.primefaces.application.DialogActionListener.processAction(DialogActionListener.java:45)
at javax.faces.component.UIViewAction.broadcast(Unknown Source)
at javax.faces.component.UIViewRoot.broadcastEvents(Unknown Source)
at javax.faces.component.UIViewRoot.processApplication(Unknown Source)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(Unknown Source)
at com.sun.faces.lifecycle.Phase.doPhase(Unknown Source)
at com.sun.faces.lifecycle.LifecycleImpl.execute(Unknown Source)
at javax.faces.webapp.FacesServlet.service(Unknown Source)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1230)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:779)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:478)
at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.invokeTarget(WebAppFilterChain.java:136)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:97)
at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:100)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:195)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:91)
at com.filenet.ae.toolkit.server.servlet.filter.PostprocessorFilter.doFilter(PostprocessorFilter.java:38)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:195)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:91)
at com.filenet.ae.toolkit.server.servlet.filter.ContainerBasedFilter.doFilter(ContainerBasedFilter.java:218)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:195)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:91)
at com.filenet.ae.toolkit.server.servlet.filter.PreprocessorFilter.doFilter(PreprocessorFilter.java:91)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:195)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:91)
at com.filenet.ae.toolkit.server.servlet.filter.SecurityPluginFilter.doFilter(SecurityPluginFilter.java:202)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:195)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:91)
at com.filenet.ae.toolkit.server.servlet.filter.ThreadLocalCleanupFilter.doFilter(ThreadLocalCleanupFilter.java:50)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:195)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:91)
at gov.myapp.web.filter.CoordinatorSecurityFilter.doFilter(CoordinatorSecurityFilter.java:150)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:195)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:91)
at com.dataserve.common.CompatibleFilter.doFilter(CompatibleFilter.java:53)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:195)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:91)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:964)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1104)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3901)
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:304)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:981)
at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1662)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:200)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:463)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:530)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:316)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:287)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:175)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1865)
I want to know if this is a bug or configuration error or it's normal due to session expire ?

Xpages error when saving document in different DB in XPiNC

I am running an Xpages db in XPiNC that I want to use as a "front end" to several other databases in our system. I will store the code in this DB and access the data in other DBs.
When I am trying to do a simple CRUD operation on a form I am getting an error that I cannot explain.
6/22/15 4:51 PM: Exception Thrown
Context Path: /xsp/<SERVER>NetworkHome.nsf
Page Name: /xpFormHelpDesk.xsp
javax.faces.FacesException
at com.sun.faces.lifecycle.ProcessValidationsPhase.execute(Unknown Source)
at com.sun.faces.lifecycle.LifecycleImpl.phase(Unknown Source)
at com.sun.faces.lifecycle.LifecycleImpl.execute(Unknown Source)
at com.ibm.xsp.controller.FacesControllerImpl.execute(Unknown Source)
at com.ibm.xsp.webapp.FacesServlet.serviceView(Unknown Source)
at com.ibm.xsp.webapp.FacesServletEx.serviceView(Unknown Source)
at com.ibm.xsp.webapp.FacesServlet.service(Unknown Source)
at com.ibm.xsp.webapp.FacesServletEx.service(Unknown Source)
at com.ibm.xsp.webapp.DesignerFacesServlet.service(Unknown Source)
at com.ibm.designer.runtime.domino.adapter.ComponentModule.invokeServlet(Unknown Source)
at com.ibm.domino.xsp.module.nsf.NSFComponentModule.invokeServlet(Unknown Source)
at com.ibm.designer.runtime.domino.adapter.ComponentModule$AdapterInvoker.invokeServlet(Unknown Source)
at com.ibm.designer.runtime.domino.adapter.ComponentModule$ServletInvoker.doService(Unknown Source)
at com.ibm.designer.runtime.domino.adapter.ComponentModule.doService(Unknown Source)
at com.ibm.domino.xsp.module.nsf.NSFComponentModule.doService(Unknown Source)
at com.ibm.domino.xsp.module.nsf.NSFService.doServiceInternal(Unknown Source)
at com.ibm.domino.xsp.module.nsf.NSFService.access$0(Unknown Source)
at com.ibm.domino.xsp.module.nsf.NSFService$NsfServiceRequest.call(Unknown Source)
at com.ibm.domino.xsp.module.nsf.NSFService$NsfServiceRequest.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
at com.ibm.domino.xsp.module.nsf.NSFService$NsfServiceThread.run(Unknown Source)
Caused by: java.lang.NullPointerException
at com.ibm.xsp.renderkit.dojo.DateTimeHelperRenderer._getConvertedValue(Unknown Source)
at com.ibm.xsp.renderkit.dojo.DateTimeHelperRenderer.getConvertedValue(Unknown Source)
at com.ibm.xsp.renderkit.ReadOnlyAdapterRenderer.getConvertedValue(Unknown Source)
at javax.faces.component.UIInput.getConvertedValue(Unknown Source)
at com.ibm.xsp.component.UIInputEx.getConvertedValue(Unknown Source)
at javax.faces.component.UIInput.validate(Unknown Source)
at javax.faces.component.UIInput.executeValidate(Unknown Source)
at javax.faces.component.UIInput.processValidators(Unknown Source)
at javax.faces.component.UIComponentBase.processValidators(Unknown Source)
at javax.faces.component.UIComponentBase.processValidators(Unknown Source)
at javax.faces.component.UIComponentBase.processValidators(Unknown Source)
at javax.faces.component.UIComponentBase.processValidators(Unknown Source)
at javax.faces.component.UIComponentBase.processValidators(Unknown Source)
at javax.faces.component.UIComponentBase.processValidators(Unknown Source)
at javax.faces.component.UIComponentBase.processValidators(Unknown Source)
at com.ibm.xsp.component.UIDataPanelBase.processValidators(Unknown Source)
at javax.faces.component.UIComponentBase.processValidators(Unknown Source)
at com.ibm.xsp.component.UIDataPanelBase.processValidators(Unknown Source)
at javax.faces.component.UIComponentBase.processValidators(Unknown Source)
at javax.faces.component.UIComponentBase.processValidators(Unknown Source)
at com.ibm.xsp.component.UIDataPanelBase.processValidators(Unknown Source)
at javax.faces.component.UIComponentBase.processValidators(Unknown Source)
at com.ibm.xsp.component.UIDataPanelBase.processValidators(Unknown Source)
at javax.faces.component.UIComponentBase.processValidators(Unknown Source)
at com.ibm.xsp.extlib.component.layout.UIVarPublisherBase.processValidators(Unknown Source)
at javax.faces.component.UIComponentBase.processValidators(Unknown Source)
at com.ibm.xsp.component.UIDataPanelBase.processValidators(Unknown Source)
at javax.faces.component.UIForm.processValidators(Unknown Source)
at javax.faces.component.UIComponentBase.processValidators(Unknown Source)
at javax.faces.component.UIComponentBase.processValidators(Unknown Source)
at javax.faces.component.UIViewRoot.processValidators(Unknown Source)
at com.ibm.xsp.component.UIViewRootEx._processValidators(Unknown Source)
at com.ibm.xsp.component.UIViewRootEx.processValidators(Unknown Source)
... 25 more
My code in the custom control is as follows:
<?xml version="1.0" encoding="UTF-8"?>
<xp:view
xmlns:xp="http://www.ibm.com/xsp/core"
xmlns:xe="http://www.ibm.com/xsp/coreex"
xmlns:xc="http://www.ibm.com/xsp/custom">
<xp:this.data>
<xp:dominoView
var="view1"
databaseName="helpdesk.nsf"
viewName="My Tickets">
<xp:this.categoryFilter><![CDATA[#{javascript:#Name("[CN]",session.getEffectiveUserName()) + "Open"}]]></xp:this.categoryFilter>
</xp:dominoView>
</xp:this.data>
<xe:widgetContainer
id="widgetContainer1"
style="width:800.px;font-weight:bold;font-size:10pt;margin-left:10.0px"
dropDownRendered="false"
titleBarText="My Help Desk Tickets"
titleBar="true"
type="sidebar"
collapsible="false">
<xp:panel>
<xp:repeat
id="repeat1"
var="rowData"
indexVar="repeatIndex"
value="#{view1}">
<xp:this.facets>
<xp:text
disableTheme="true"
xp:key="header"
escape="false">
<xp:this.value><![CDATA[<table class='lotusTable repeatRowColors' border='0' cellspacing='0' cellpadding='0'>
<tr class ='lotusFirst lotusSort scope='col'>
<th class ='lotusBold'>Requester</th>
<th class ='lotusBold'>Subject</th>
<th class ='lotusBold'>Date</th>
</tr>
</thead>]]></xp:this.value>
</xp:text>
<xp:text
disableTheme="true"
xp:key="footer"
escape="false">
<xp:this.value><![CDATA[</table>]]></xp:this.value>
</xp:text>
</xp:this.facets>
<xp:tr
id="rowDataContainer">
<xp:td
style="width:125.00px;min-width:125px;max-width:125px;font-size:10pt">
<xp:text
escape="true"
id="computedField3">
<xp:this.value><![CDATA[#{javascript:rowData.getColumnValue("$0");}]]>
</xp:this.value>
</xp:text>
</xp:td>
<xp:td
style="width:250px;min-width:250px;max-width:250px font-size:10pt">
<xp:link
escape="true"
id="link1">
<xp:this.text><![CDATA[#{javascript:rowData.getColumnValue("Subject2")}]]></xp:this.text>
<xp:eventHandler
event="onclick"
submit="true"
refreshMode="complete">
<xp:this.action>
<xp:openPage
name="/xpFormHelpDesk.xsp"
target="openDocument">
<xp:this.documentId><![CDATA[#{javascript:rowData.getDocument().getUniversalID()}]]></xp:this.documentId>
</xp:openPage>
</xp:this.action>
</xp:eventHandler>
</xp:link>
</xp:td>
<xp:td
style="font-size:10pt">
<xp:text
escape="true"
id="computedField2">
<xp:this.value><![CDATA[#{javascript:rowData.getColumnValue("$1");}]]>
</xp:this.value>
<xp:this.converter>
<xp:convertDateTime
type="date"></xp:convertDateTime>
</xp:this.converter>
</xp:text>
</xp:td>
</xp:tr>
</xp:repeat>
</xp:panel>
</xe:widgetContainer>
</xp:view>
The database that I am getting the data from is not in Xpages, but I don't think that that should matter.
Your datasource defines databaseName="helpdesk.nsf" - in XPiNC it means local replica of the database. You need to use full format, as Paul suggested:
databaseName="yourservername!!helpdesk.nsf"
I recommend to parametrize the server with:
databaseName="#{database.server}!!helpdesk.nsf"
I think validator fails because of "no data" from invalid data source.
Looking at the stack trace, it's failing in Process Validations phase - so checking datatypes for validation / data conversion, and failing on the DateTimeHelperRenderer. It looks like that's pointing to computedField2.
There are two possible explanations:
One of the view entries has a value in column $1 that cannot be converted to a date. This sounds the most probable.
You're hitting the problem I blogged about with partial refreshes and row datasources not available http://www.intec.co.uk/dataviews-and-nested-repeats/. If this is the case, wrapping the calculation with if (view.isRenderingPhase()) {...} will solve the problem. If it's not the case, it will move the error to the Render Response phase.

Accessing #SessionScoped class from a #RequestScoped class?

I have one class that is #SessionScoped and another class that is #RequestScoped. What I am trying to do is access the SessionScoped class from the #RequestScoped class. I thought simply using CDI, by injecting the #SessionScoped class into a variable in the #RequestScoped class, but as soon as I try to access parameters through that variable I end up getting errors.
How would be the best way to access the #SessionScoped class from the #RequestScoped class?
The SessionScoped class:
#ManagedBean(name = "globalBean", eager = true)
#Named
#SessionScoped
public class GlobalBean implements Serializable {
private String language;
public String getLanguage() {
return language;
}
public void setLanguage(String language) {
this.language = language;
}
}
The RequestScoped class:
#Named
#RequestScoped
public class TopMenuBean implements Serializable {
//#Inject
#ManagedProperty(value = "#{globalBean}")
private GlobalBean global;
public TopMenuBean() {
this.global.setLanguage("en");
}
}
The error:
20:23:32,214 SEVERE [javax.enterprise.resource.webcontainer.jsf.application] (default task-17) Error Rendering View[/index.xhtml]: java.lang.NullPointerException
at com.mycategory.myprogram.TopMenuBean.<init>(TopMenuBean.java:84) [classes:]
at com.mycategory.myprogram.TopMenuBean$Proxy$_$$_WeldClientProxy.<init>(Unknown Source) [classes:]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [rt.jar:1.8.0_11]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) [rt.jar:1.8.0_11]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [rt.jar:1.8.0_11]
at java.lang.reflect.Constructor.newInstance(Constructor.java:408) [rt.jar:1.8.0_11]
at java.lang.Class.newInstance(Class.java:433) [rt.jar:1.8.0_11]
at org.jboss.weld.security.NewInstanceAction.run(NewInstanceAction.java:33) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23]
at java.security.AccessController.doPrivileged(Native Method) [rt.jar:1.8.0_11]
at org.jboss.weld.bean.proxy.ProxyFactory.create(ProxyFactory.java:282) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23]
at org.jboss.weld.bean.proxy.ClientProxyFactory.create(ClientProxyFactory.java:111) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23]
at org.jboss.weld.bean.proxy.ClientProxyProvider.createClientProxy(ClientProxyProvider.java:180) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23]
at org.jboss.weld.bean.proxy.ClientProxyProvider.createClientProxy(ClientProxyProvider.java:170) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23]
at org.jboss.weld.bean.proxy.ClientProxyProvider.access$100(ClientProxyProvider.java:45) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23]
at org.jboss.weld.bean.proxy.ClientProxyProvider$CreateClientProxy.load(ClientProxyProvider.java:56) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23]
at org.jboss.weld.bean.proxy.ClientProxyProvider$CreateClientProxy.load(ClientProxyProvider.java:52) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23]
at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3524)
at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2317)
at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2280)
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2195)
at com.google.common.cache.LocalCache.get(LocalCache.java:3934)
at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3938)
at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4821)
at org.jboss.weld.util.cache.LoadingCacheUtils.getCacheValue(LoadingCacheUtils.java:52) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23]
at org.jboss.weld.util.cache.LoadingCacheUtils.getCastCacheValue(LoadingCacheUtils.java:80) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23]
at org.jboss.weld.bean.proxy.ClientProxyProvider.getClientProxy(ClientProxyProvider.java:186) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23]
at org.jboss.weld.el.AbstractWeldELResolver.lookup(AbstractWeldELResolver.java:110) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23]
at org.jboss.weld.el.AbstractWeldELResolver.getValue(AbstractWeldELResolver.java:91) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23]
at org.jboss.as.jsf.injection.weld.ForwardingELResolver.getValue(ForwardingELResolver.java:46) [wildfly-jsf-injection-8.1.0.Final.jar:8.1.0.Final]
at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:188) [jboss-el-api_3.0_spec-1.0.3.Final.jar:1.0.3.Final]
at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176) [jsf-impl-2.2.6-jbossorg-4.jar:]
at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203) [jsf-impl-2.2.6-jbossorg-4.jar:]
at com.sun.el.parser.AstIdentifier.getValue(AstIdentifier.java:116) [javax.el-3.0.0.jar:]
at com.sun.el.parser.AstValue.getBase(AstValue.java:151) [javax.el-3.0.0.jar:]
at com.sun.el.parser.AstValue.getValue(AstValue.java:200) [javax.el-3.0.0.jar:]
at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:226) [javax.el-3.0.0.jar:]
at org.jboss.weld.el.WeldValueExpression.getValue(WeldValueExpression.java:50) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23]
at org.jboss.weld.el.WeldValueExpression.getValue(WeldValueExpression.java:50) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23]
at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:109) [jsf-impl-2.2.6-jbossorg-4.jar:]
at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:194) [jboss-jsf-api_2.2_spec-2.2.6.jar:2.2.6]
at org.primefaces.component.tabmenu.TabMenu.getModel(TabMenu.java:84) [primefaces-5.1.jar:5.1]
at org.primefaces.component.menu.BaseMenuRenderer.encodeEnd(BaseMenuRenderer.java:103) [primefaces-5.1.jar:5.1]
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:919) [jboss-jsf-api_2.2_spec-2.2.6.jar:2.2.6]
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1864) [jboss-jsf-api_2.2_spec-2.2.6.jar:2.2.6]
at javax.faces.render.Renderer.encodeChildren(Renderer.java:176) [jboss-jsf-api_2.2_spec-2.2.6.jar:2.2.6]
at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:889) [jboss-jsf-api_2.2_spec-2.2.6.jar:2.2.6]
at org.primefaces.renderkit.CoreRenderer.renderChild(CoreRenderer.java:79) [primefaces-5.1.jar:5.1]
at org.primefaces.renderkit.CoreRenderer.renderChildren(CoreRenderer.java:66) [primefaces-5.1.jar:5.1]
at org.primefaces.component.panelgrid.PanelGridRenderer.encodeRow(PanelGridRenderer.java:187) [primefaces-5.1.jar:5.1]
at org.primefaces.component.panelgrid.PanelGridRenderer.encodeStaticBody(PanelGridRenderer.java:147) [primefaces-5.1.jar:5.1]
at org.primefaces.component.panelgrid.PanelGridRenderer.encodeTableBody(PanelGridRenderer.java:100) [primefaces-5.1.jar:5.1]
at org.primefaces.component.panelgrid.PanelGridRenderer.encodeTableLayout(PanelGridRenderer.java:65) [primefaces-5.1.jar:5.1]
at org.primefaces.component.panelgrid.PanelGridRenderer.encodeEnd(PanelGridRenderer.java:37) [primefaces-5.1.jar:5.1]
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:919) [jboss-jsf-api_2.2_spec-2.2.6.jar:2.2.6]
at org.primefaces.renderkit.CoreRenderer.renderChild(CoreRenderer.java:83) [primefaces-5.1.jar:5.1]
at org.primefaces.renderkit.CoreRenderer.renderChildren(CoreRenderer.java:66) [primefaces-5.1.jar:5.1]
at org.primefaces.component.layout.LayoutUnitRenderer.encodeEnd(LayoutUnitRenderer.java:49) [primefaces-5.1.jar:5.1]
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:919) [jboss-jsf-api_2.2_spec-2.2.6.jar:2.2.6]
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1864) [jboss-jsf-api_2.2_spec-2.2.6.jar:2.2.6]
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1860) [jboss-jsf-api_2.2_spec-2.2.6.jar:2.2.6]
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1860) [jboss-jsf-api_2.2_spec-2.2.6.jar:2.2.6]
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1860) [jboss-jsf-api_2.2_spec-2.2.6.jar:2.2.6]
at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:461) [jsf-impl-2.2.6-jbossorg-4.jar:]
at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:133) [jsf-impl-2.2.6-jbossorg-4.jar:]
at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:337) [jboss-jsf-api_2.2_spec-2.2.6.jar:2.2.6]
at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:337) [jboss-jsf-api_2.2_spec-2.2.6.jar:2.2.6]
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120) [jsf-impl-2.2.6-jbossorg-4.jar:]
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) [jsf-impl-2.2.6-jbossorg-4.jar:]
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219) [jsf-impl-2.2.6-jbossorg-4.jar:]
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:647) [jboss-jsf-api_2.2_spec-2.2.6.jar:2.2.6]
at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:61) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:113) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:56) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:45) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:61) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:58) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:70) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:240) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:227) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:73) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:146) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.server.Connectors.executeRootHandler(Connectors.java:177) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:727) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_11]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_11]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_11]
20:23:32,227 ERROR [io.undertow.request] (default task-17) UT005023: Exception handling request to /myprogram/index.jsf: javax.servlet.ServletException
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:659) [jboss-jsf-api_2.2_spec-2.2.6.jar:2.2.6]
at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:61) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:113) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:56) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:45) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:61) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:58) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:70) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:240) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:227) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:73) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:146) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.server.Connectors.executeRootHandler(Connectors.java:177) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:727) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_11]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_11]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_11]
Caused by: java.lang.NullPointerException
at com.mycategory.myprogram.TopMenuBean.<init>(TopMenuBean.java:84) [classes:]
at com.mycategory.myprogram.TopMenuBean$Proxy$_$$_WeldClientProxy.<init>(Unknown Source) [classes:]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [rt.jar:1.8.0_11]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) [rt.jar:1.8.0_11]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [rt.jar:1.8.0_11]
at java.lang.reflect.Constructor.newInstance(Constructor.java:408) [rt.jar:1.8.0_11]
at java.lang.Class.newInstance(Class.java:433) [rt.jar:1.8.0_11]
at org.jboss.weld.security.NewInstanceAction.run(NewInstanceAction.java:33) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23]
at java.security.AccessController.doPrivileged(Native Method) [rt.jar:1.8.0_11]
at org.jboss.weld.bean.proxy.ProxyFactory.create(ProxyFactory.java:282) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23]
at org.jboss.weld.bean.proxy.ClientProxyFactory.create(ClientProxyFactory.java:111) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23]
at org.jboss.weld.bean.proxy.ClientProxyProvider.createClientProxy(ClientProxyProvider.java:180) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23]
at org.jboss.weld.bean.proxy.ClientProxyProvider.createClientProxy(ClientProxyProvider.java:170) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23]
at org.jboss.weld.bean.proxy.ClientProxyProvider.access$100(ClientProxyProvider.java:45) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23]
at org.jboss.weld.bean.proxy.ClientProxyProvider$CreateClientProxy.load(ClientProxyProvider.java:56) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23]
at org.jboss.weld.bean.proxy.ClientProxyProvider$CreateClientProxy.load(ClientProxyProvider.java:52) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23]
at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3524)
at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2317)
at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2280)
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2195)
at com.google.common.cache.LocalCache.get(LocalCache.java:3934)
at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3938)
at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4821)
at org.jboss.weld.util.cache.LoadingCacheUtils.getCacheValue(LoadingCacheUtils.java:52) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23]
at org.jboss.weld.util.cache.LoadingCacheUtils.getCastCacheValue(LoadingCacheUtils.java:80) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23]
at org.jboss.weld.bean.proxy.ClientProxyProvider.getClientProxy(ClientProxyProvider.java:186) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23]
at org.jboss.weld.el.AbstractWeldELResolver.lookup(AbstractWeldELResolver.java:110) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23]
at org.jboss.weld.el.AbstractWeldELResolver.getValue(AbstractWeldELResolver.java:91) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23]
at org.jboss.as.jsf.injection.weld.ForwardingELResolver.getValue(ForwardingELResolver.java:46) [wildfly-jsf-injection-8.1.0.Final.jar:8.1.0.Final]
at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:188) [jboss-el-api_3.0_spec-1.0.3.Final.jar:1.0.3.Final]
at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176) [jsf-impl-2.2.6-jbossorg-4.jar:]
at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203) [jsf-impl-2.2.6-jbossorg-4.jar:]
at com.sun.el.parser.AstIdentifier.getValue(AstIdentifier.java:116) [javax.el-3.0.0.jar:]
at com.sun.el.parser.AstValue.getBase(AstValue.java:151) [javax.el-3.0.0.jar:]
at com.sun.el.parser.AstValue.getValue(AstValue.java:200) [javax.el-3.0.0.jar:]
at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:226) [javax.el-3.0.0.jar:]
at org.jboss.weld.el.WeldValueExpression.getValue(WeldValueExpression.java:50) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23]
at org.jboss.weld.el.WeldValueExpression.getValue(WeldValueExpression.java:50) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23]
at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:109) [jsf-impl-2.2.6-jbossorg-4.jar:]
at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:194) [jboss-jsf-api_2.2_spec-2.2.6.jar:2.2.6]
at org.primefaces.component.tabmenu.TabMenu.getModel(TabMenu.java:84) [primefaces-5.1.jar:5.1]
at org.primefaces.component.menu.BaseMenuRenderer.encodeEnd(BaseMenuRenderer.java:103) [primefaces-5.1.jar:5.1]
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:919) [jboss-jsf-api_2.2_spec-2.2.6.jar:2.2.6]
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1864) [jboss-jsf-api_2.2_spec-2.2.6.jar:2.2.6]
at javax.faces.render.Renderer.encodeChildren(Renderer.java:176) [jboss-jsf-api_2.2_spec-2.2.6.jar:2.2.6]
at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:889) [jboss-jsf-api_2.2_spec-2.2.6.jar:2.2.6]
at org.primefaces.renderkit.CoreRenderer.renderChild(CoreRenderer.java:79) [primefaces-5.1.jar:5.1]
at org.primefaces.renderkit.CoreRenderer.renderChildren(CoreRenderer.java:66) [primefaces-5.1.jar:5.1]
at org.primefaces.component.panelgrid.PanelGridRenderer.encodeRow(PanelGridRenderer.java:187) [primefaces-5.1.jar:5.1]
at org.primefaces.component.panelgrid.PanelGridRenderer.encodeStaticBody(PanelGridRenderer.java:147) [primefaces-5.1.jar:5.1]
at org.primefaces.component.panelgrid.PanelGridRenderer.encodeTableBody(PanelGridRenderer.java:100) [primefaces-5.1.jar:5.1]
at org.primefaces.component.panelgrid.PanelGridRenderer.encodeTableLayout(PanelGridRenderer.java:65) [primefaces-5.1.jar:5.1]
at org.primefaces.component.panelgrid.PanelGridRenderer.encodeEnd(PanelGridRenderer.java:37) [primefaces-5.1.jar:5.1]
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:919) [jboss-jsf-api_2.2_spec-2.2.6.jar:2.2.6]
at org.primefaces.renderkit.CoreRenderer.renderChild(CoreRenderer.java:83) [primefaces-5.1.jar:5.1]
at org.primefaces.renderkit.CoreRenderer.renderChildren(CoreRenderer.java:66) [primefaces-5.1.jar:5.1]
at org.primefaces.component.layout.LayoutUnitRenderer.encodeEnd(LayoutUnitRenderer.java:49) [primefaces-5.1.jar:5.1]
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:919) [jboss-jsf-api_2.2_spec-2.2.6.jar:2.2.6]
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1864) [jboss-jsf-api_2.2_spec-2.2.6.jar:2.2.6]
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1860) [jboss-jsf-api_2.2_spec-2.2.6.jar:2.2.6]
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1860) [jboss-jsf-api_2.2_spec-2.2.6.jar:2.2.6]
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1860) [jboss-jsf-api_2.2_spec-2.2.6.jar:2.2.6]
at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:461) [jsf-impl-2.2.6-jbossorg-4.jar:]
at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:133) [jsf-impl-2.2.6-jbossorg-4.jar:]
at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:337) [jboss-jsf-api_2.2_spec-2.2.6.jar:2.2.6]
at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:337) [jboss-jsf-api_2.2_spec-2.2.6.jar:2.2.6]
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120) [jsf-impl-2.2.6-jbossorg-4.jar:]
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) [jsf-impl-2.2.6-jbossorg-4.jar:]
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219) [jsf-impl-2.2.6-jbossorg-4.jar:]
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:647) [jboss-jsf-api_2.2_spec-2.2.6.jar:2.2.6]
... 26 more
[solved]:
Mixing JSF (#ManagedBean) and CDI (#Named) was not my intention. I prefer concentrating on CDI and built up a working example, which I would like to post here for those souls out there having the same problem. One quick thing that long time was one of my errors:
Don't try to access the injected variable within the constructor!
Thank you all very much for your help! Enjoy the example:
test.xhtml:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html">
<h:head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</h:head>
<h:body>
<h:outputText value="The language is: #{beanTwo.language}" />
</h:body>
</html>
BeanOne.java:
import java.io.Serializable;
import javax.enterprise.context.SessionScoped;
import javax.inject.Named;
#Named
#SessionScoped
public class BeanOne implements Serializable {
private String language;
public String getLanguage() {
return language;
}
public void setLanguage(String language) {
this.language = language;
}
}
BeanTwo.java:
import java.io.Serializable;
import javax.enterprise.context.RequestScoped;
import javax.inject.Inject;
import javax.inject.Named;
#Named
#RequestScoped
public class BeanTwo implements Serializable {
#Inject
private BeanOne beanOne;
public String getLanguage() {
this.beanOne.setLanguage("de");
return this.beanOne.getLanguage();
}
}

android.view.InflateException: Binary XML file line #2: Error inflating class

When i click imgPlayGame -> Open new activity -> Error
My Main:
ImageView imgPlayGame;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.start_game);
AddEvents();
}
My Events:
public void AddEvents(){
imgPlayGame=(ImageView) findViewById(R.id.imgPlayGame);
//repeat imgPlayGame
Start_Repeat_ImgPlayGame();
imgPlayGame.setOnClickListener(new OnClickListener() {
#Override
public void onClick(View v) {
StartGame();
}
});
}
Animation Drawable:
public void Start_Repeat_ImgPlayGame(){
imgPlayGame.setBackgroundResource(R.drawable.play_anim_repeat);
animationDrawable= (AnimationDrawable) imgPlayGame.getBackground();
animationDrawable.start();
}
Open new activity:
protected void StartGame() {
Intent select_level= new Intent(StartGameActivity.this, SelectLevelActivity.class);
startActivity(select_level);
}
Class play_anim_repeat:
<?xml version="1.0" encoding="utf-8"?>
<animation-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:drawable="#drawable/ic_play_2"
android:duration="300"
>
</item>
<item
android:drawable="#drawable/ic_play_3"
android:duration="300">
</item>
<item
android:drawable="#drawable/ic_play_4"
android:duration="300">
</item>
</animation-list>
Error:
11-30 16:14:16.476: E/dalvikvm-heap(11347): Out of memory on a 30025744-byte allocation. 11-30 16:14:16.491: E/AndroidRuntime(11347):
FATAL EXCEPTION: main 11-30 16:14:16.491: E/AndroidRuntime(11347):
Process: com.thoai.leminh.huntervsfruit, PID: 11347 11-30
16:14:16.491: E/AndroidRuntime(11347): java.lang.RuntimeException:
Unable to start activity
ComponentInfo{com.thoai.leminh.huntervsfruit/com.thoai.leminh.huntervsfruit.EasyLevelActivity}:
android.view.InflateException: Binary XML file line #2: Error
inflating class 11-30 16:14:16.491: E/AndroidRuntime(11347):
at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2305)
11-30 16:14:16.491: E/AndroidRuntime(11347): at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2363)
11-30 16:14:16.491: E/AndroidRuntime(11347): at
android.app.ActivityThread.access$900(ActivityThread.java:161) 11-30
16:14:16.491: E/AndroidRuntime(11347): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1265)
11-30 16:14:16.491: E/AndroidRuntime(11347): at
android.os.Handler.dispatchMessage(Handler.java:102) 11-30
16:14:16.491: E/AndroidRuntime(11347): at
android.os.Looper.loop(Looper.java:157) 11-30 16:14:16.491:
E/AndroidRuntime(11347): at
android.app.ActivityThread.main(ActivityThread.java:5356) 11-30
16:14:16.491: E/AndroidRuntime(11347): at
java.lang.reflect.Method.invokeNative(Native Method) 11-30
16:14:16.491: E/AndroidRuntime(11347): at
java.lang.reflect.Method.invoke(Method.java:515) 11-30 16:14:16.491:
E/AndroidRuntime(11347): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265)
11-30 16:14:16.491: E/AndroidRuntime(11347): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081) 11-30
16:14:16.491: E/AndroidRuntime(11347): at
dalvik.system.NativeStart.main(Native Method) 11-30 16:14:16.491:
E/AndroidRuntime(11347): Caused by: android.view.InflateException:
Binary XML file line #2: Error inflating class 11-30
16:14:16.491: E/AndroidRuntime(11347): at
android.view.LayoutInflater.createView(LayoutInflater.java:626) 11-30
16:14:16.491: E/AndroidRuntime(11347): at
com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
11-30 16:14:16.491: E/AndroidRuntime(11347): at
android.view.LayoutInflater.onCreateView(LayoutInflater.java:675)
11-30 16:14:16.491: E/AndroidRuntime(11347): at
android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:700)
11-30 16:14:16.491: E/AndroidRuntime(11347): at
android.view.LayoutInflater.inflate(LayoutInflater.java:470) 11-30
16:14:16.491: E/AndroidRuntime(11347): at
android.view.LayoutInflater.inflate(LayoutInflater.java:398) 11-30
16:14:16.491: E/AndroidRuntime(11347): at
android.view.LayoutInflater.inflate(LayoutInflater.java:354) 11-30
16:14:16.491: E/AndroidRuntime(11347): at
com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:359)
11-30 16:14:16.491: E/AndroidRuntime(11347): at
android.app.Activity.setContentView(Activity.java:2010) 11-30
16:14:16.491: E/AndroidRuntime(11347): at
com.thoai.leminh.huntervsfruit.EasyLevelActivity.onCreate(EasyLevelActivity.java:20)
11-30 16:14:16.491: E/AndroidRuntime(11347): at
android.app.Activity.performCreate(Activity.java:5426) 11-30
16:14:16.491: E/AndroidRuntime(11347): at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
11-30 16:14:16.491: E/AndroidRuntime(11347): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2269)
11-30 16:14:16.491: E/AndroidRuntime(11347): ... 11 more 11-30
16:14:16.491: E/AndroidRuntime(11347): Caused by:
java.lang.reflect.InvocationTargetException 11-30 16:14:16.491:
E/AndroidRuntime(11347): at
java.lang.reflect.Constructor.constructNative(Native Method) 11-30
16:14:16.491: E/AndroidRuntime(11347): at
java.lang.reflect.Constructor.newInstance(Constructor.java:423) 11-30
16:14:16.491: E/AndroidRuntime(11347): at
android.view.LayoutInflater.createView(LayoutInflater.java:600) 11-30
16:14:16.491: E/AndroidRuntime(11347): ... 23 more 11-30
16:14:16.491: E/AndroidRuntime(11347): Caused by:
java.lang.OutOfMemoryError 11-30 16:14:16.491:
E/AndroidRuntime(11347): at
android.graphics.BitmapFactory.nativeDecodeAsset(Native Method) 11-30
16:14:16.491: E/AndroidRuntime(11347): at
android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:677)
11-30 16:14:16.491: E/AndroidRuntime(11347): at
android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:507)
11-30 16:14:16.491: E/AndroidRuntime(11347): at
android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:872)
11-30 16:14:16.491: E/AndroidRuntime(11347): at
android.content.res.Resources.loadDrawable(Resources.java:3024) 11-30
16:14:16.491: E/AndroidRuntime(11347): at
android.content.res.TypedArray.getDrawable(TypedArray.java:602) 11-30
16:14:16.491: E/AndroidRuntime(11347): at
android.view.View.(View.java:3694) 11-30 16:14:16.491:
E/AndroidRuntime(11347): at android.view.View.(View.java:3624)
11-30 16:14:16.491: E/AndroidRuntime(11347): at
android.view.ViewGroup.(ViewGroup.java:474) 11-30 16:14:16.491:
E/AndroidRuntime(11347): at
android.widget.RelativeLayout.(RelativeLayout.java:236) 11-30
16:14:16.491: E/AndroidRuntime(11347): ... 26 more
Your image #drawable/backgound_easy is probably is too large. Try to use another one
http://developer.android.com/training/displaying-bitmaps/load-bitmap.html

Child class of SurfaceView crashed the application

I did simple application. I had added the new class TouchView:
package com.example.lookatme;
import android.content.Context;
import android.view.SurfaceView;
public class TouchView extends SurfaceView{
public TouchView(Context context) {
super(context);
}
}
... and added my new view at layout:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/rlMain"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
tools:context=".BlockerActivity" >
<com.example.lookatme.TouchView
android:id="#+id/tvPaint"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignTop="#+id/ivCenter"
android:layout_marginTop="14dp" />
<ImageView
android:id="#+id/ivCenter"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:src="#drawable/ic_launcher" android:contentDescription="TODO"/>
</RelativeLayout>
At the start crashed application on the code setContentView(R.layout.activity_blocker) in activity. That i did wrong? The LogCat have same text:
10-23 18:02:03.442: W/dalvikvm(1964): threadid=1: thread exiting with uncaught exception (group=0xb57ef4f0)
10-23 18:02:03.442: E/AndroidRuntime(1964): FATAL EXCEPTION: main
10-23 18:02:03.442: E/AndroidRuntime(1964): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.lookatme/com.example.lookatme.BlockerActivity}: java.lang.ClassCastException: android.view.SurfaceView
10-23 18:02:03.442: E/AndroidRuntime(1964): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647)
10-23 18:02:03.442: E/AndroidRuntime(1964): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
10-23 18:02:03.442: E/AndroidRuntime(1964): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
10-23 18:02:03.442: E/AndroidRuntime(1964): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
10-23 18:02:03.442: E/AndroidRuntime(1964): at android.os.Handler.dispatchMessage(Handler.java:99)
10-23 18:02:03.442: E/AndroidRuntime(1964): at android.os.Looper.loop(Looper.java:130)
10-23 18:02:03.442: E/AndroidRuntime(1964): at android.app.ActivityThread.main(ActivityThread.java:3683)
10-23 18:02:03.442: E/AndroidRuntime(1964): at java.lang.reflect.Method.invokeNative(Native Method)
10-23 18:02:03.442: E/AndroidRuntime(1964): at java.lang.reflect.Method.invoke(Method.java:507)
10-23 18:02:03.442: E/AndroidRuntime(1964): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
10-23 18:02:03.442: E/AndroidRuntime(1964): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
10-23 18:02:03.442: E/AndroidRuntime(1964): at dalvik.system.NativeStart.main(Native Method)
10-23 18:02:03.442: E/AndroidRuntime(1964): Caused by: java.lang.ClassCastException: android.view.SurfaceView
10-23 18:02:03.442: E/AndroidRuntime(1964): at com.example.lookatme.BlockerActivity.onCreate(BlockerActivity.java:67)
10-23 18:02:03.442: E/AndroidRuntime(1964): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
10-23 18:02:03.442: E/AndroidRuntime(1964): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
10-23 18:02:03.442: E/AndroidRuntime(1964): ... 11 more
10-23 18:04:01.741: W/ActivityThread(2020): Application com.example.lookatme is waiting for the debugger on port 8100...
I did found the desision: for child class need to overload other constructor: with Context and Attributes.

Resources