Null Pointer Exception setting layout Params of custom imageView in NavigationDrawerMenu - android-layout

Hi Im trying to set Layour Params of a Custom ImageView class (called MLRoundedImageView) in navigation Drawer menu but always i have the same error:
03-26 19:27:13.446: E/AndroidRuntime(6532): FATAL EXCEPTION: main
03-26 19:27:13.446: E/AndroidRuntime(6532): java.lang.NullPointerException
03-26 19:27:13.446: E/AndroidRuntime(6532): at android.view.ViewGroup.addView(ViewGroup.java:3187)
03-26 19:27:13.446: E/AndroidRuntime(6532): at android.view.ViewGroup.addView(ViewGroup.java:3170)
03-26 19:27:13.446: E/AndroidRuntime(6532): at com.norriors.java.mtbfreeride.Controllers.PersonalDrawerAdapter.getView(PersonalDrawerAdapter.java:59)
03-26 19:27:13.446: E/AndroidRuntime(6532): at android.widget.AbsListView.obtainView(AbsListView.java:2267)
03-26 19:27:13.446: E/AndroidRuntime(6532): at android.widget.ListView.makeAndAddView(ListView.java:1769)
03-26 19:27:13.446: E/AndroidRuntime(6532): at android.widget.ListView.fillDown(ListView.java:672)
03-26 19:27:13.446: E/AndroidRuntime(6532): at android.widget.ListView.fillFromTop(ListView.java:733)
03-26 19:27:13.446: E/AndroidRuntime(6532): at android.widget.ListView.layoutChildren(ListView.java:1622)
03-26 19:27:13.446: E/AndroidRuntime(6532): at android.widget.AbsListView.onLayout(AbsListView.java:2102)
03-26 19:27:13.446: E/AndroidRuntime(6532): at android.view.View.layout(View.java:13754)
03-26 19:27:13.446: E/AndroidRuntime(6532): at android.view.ViewGroup.layout(ViewGroup.java:4362)
03-26 19:27:13.446: E/AndroidRuntime(6532): at android.support.v4.widget.DrawerLayout.onLayout(DrawerLayout.java:931)
03-26 19:27:13.446: E/AndroidRuntime(6532): at android.view.View.layout(View.java:13754)
03-26 19:27:13.446: E/AndroidRuntime(6532): at android.view.ViewGroup.layout(ViewGroup.java:4362)
03-26 19:27:13.446: E/AndroidRuntime(6532): at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
03-26 19:27:13.446: E/AndroidRuntime(6532): at android.view.View.layout(View.java:13754)
03-26 19:27:13.446: E/AndroidRuntime(6532): at android.view.ViewGroup.layout(ViewGroup.java:4362)
03-26 19:27:13.446: E/AndroidRuntime(6532): at android.support.v7.internal.widget.ActionBarOverlayLayout.onLayout(ActionBarOverlayLayout.java:502)
03-26 19:27:13.446: E/AndroidRuntime(6532): at android.view.View.layout(View.java:13754)
03-26 19:27:13.446: E/AndroidRuntime(6532): at android.view.ViewGroup.layout(ViewGroup.java:4362)
03-26 19:27:13.446: E/AndroidRuntime(6532): at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
03-26 19:27:13.446: E/AndroidRuntime(6532): at android.view.View.layout(View.java:13754)
03-26 19:27:13.446: E/AndroidRuntime(6532): at android.view.ViewGroup.layout(ViewGroup.java:4362)
03-26 19:27:13.446: E/AndroidRuntime(6532): at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1649)
03-26 19:27:13.446: E/AndroidRuntime(6532): at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1507)
03-26 19:27:13.446: E/AndroidRuntime(6532): at android.widget.LinearLayout.onLayout(LinearLayout.java:1420)
03-26 19:27:13.446: E/AndroidRuntime(6532): at android.view.View.layout(View.java:13754)
03-26 19:27:13.446: E/AndroidRuntime(6532): at android.view.ViewGroup.layout(ViewGroup.java:4362)
03-26 19:27:13.446: E/AndroidRuntime(6532): at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
03-26 19:27:13.446: E/AndroidRuntime(6532): at android.view.View.layout(View.java:13754)
03-26 19:27:13.446: E/AndroidRuntime(6532): at android.view.ViewGroup.layout(ViewGroup.java:4362)
03-26 19:27:13.446: E/AndroidRuntime(6532): at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:1866)
03-26 19:27:13.446: E/AndroidRuntime(6532): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1687)
03-26 19:27:13.446: E/AndroidRuntime(6532): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:998)
03-26 19:27:13.446: E/AndroidRuntime(6532): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4212)
03-26 19:27:13.446: E/AndroidRuntime(6532): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:725)
03-26 19:27:13.446: E/AndroidRuntime(6532): at android.view.Choreographer.doCallbacks(Choreographer.java:555)
03-26 19:27:13.446: E/AndroidRuntime(6532): at android.view.Choreographer.doFrame(Choreographer.java:525)
03-26 19:27:13.446: E/AndroidRuntime(6532): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:711)
03-26 19:27:13.446: E/AndroidRuntime(6532): at android.os.Handler.handleCallback(Handler.java:615)
03-26 19:27:13.446: E/AndroidRuntime(6532): at android.os.Handler.dispatchMessage(Handler.java:92)
03-26 19:27:13.446: E/AndroidRuntime(6532): at android.os.Looper.loop(Looper.java:137)
03-26 19:27:13.446: E/AndroidRuntime(6532): at android.app.ActivityThread.main(ActivityThread.java:4745)
03-26 19:27:13.446: E/AndroidRuntime(6532): at java.lang.reflect.Method.invokeNative(Native Method)
03-26 19:27:13.446: E/AndroidRuntime(6532): at java.lang.reflect.Method.invoke(Method.java:511)
03-26 19:27:13.446: E/AndroidRuntime(6532): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
03-26 19:27:13.446: E/AndroidRuntime(6532): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
03-26 19:27:13.446: E/AndroidRuntime(6532): at dalvik.system.NativeStart.main(Native Method)
And here is my class
package com.norriors.java.mtbfreeride.Controllers;
import android.app.Activity;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.norriors.java.mtbfreeride.R;
import java.util.List;
/**
* Classe PersonalDrawerAdapter
*/
public class PersonalDrawerAdapter extends ArrayAdapter<DrawerItems> {
Context context;
List<DrawerItems> drawerItemsList;
int layoutResID;
DrawerItems dItem;
public PersonalDrawerAdapter(Context context, int layoutResourceID,
List<DrawerItems> listItems) {
super(context, layoutResourceID, listItems);
this.context = context;
this.drawerItemsList = listItems;
this.layoutResID = layoutResourceID;
}
#Override
public View getView(int position, View convertView, ViewGroup parent) {
DrawerItemHolder drawerHolder;
View view = convertView;
dItem = this.drawerItemsList.get(position);
if (view == null) {
LayoutInflater inflater = ((Activity) context).getLayoutInflater();
drawerHolder = new DrawerItemHolder();
view = inflater.inflate(layoutResID, parent, false);
drawerHolder.ItemName = (TextView) view
.findViewById(R.id.drawer_itemName);
drawerHolder.title = (TextView) view.findViewById(R.id.drawerTitle);
drawerHolder.headerLayout = (LinearLayout) view
.findViewById(R.id.headerLayout);
drawerHolder.itemLayout = (LinearLayout) view
.findViewById(R.id.itemLayout);
drawerHolder.icon = dItem.getImgUser();
drawerHolder.headerLayout.addView(drawerHolder.icon);
drawerHolder.icon.getLayoutParams().width = 50;
drawerHolder.icon.getLayoutParams().height = 50;
view.setTag(drawerHolder);
} else {
drawerHolder = (DrawerItemHolder) view.getTag();
}
if (dItem.getTitle() != null) {
drawerHolder.headerLayout.setVisibility(LinearLayout.VISIBLE);
drawerHolder.title.setText(dItem.getTitle());
} else {
drawerHolder.itemLayout.setVisibility(LinearLayout.VISIBLE);
drawerHolder.ItemName.setText(dItem.getItemName());
}
return view;
}
private static class DrawerItemHolder {
TextView ItemName, title;
MLRoundedImageView icon;
LinearLayout headerLayout, itemLayout;
}
}
And my view.xml:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<LinearLayout
android:id="#+id/headerLayout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginTop="30dp">
<TextView
android:id="#+id/drawerTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:textStyle="bold"
android:textAppearance="?android:attr/textAppearanceSmall" />
<View
android:layout_width="match_parent"
android:layout_height="2dp"
android:background="#DADADC" ></View>
</LinearLayout>
<LinearLayout
android:id="#+id/itemLayout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:orientation="vertical"
android:layout_marginTop="0dp"
android:background="?android:attr/activatedBackgroundIndicator">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:minHeight="50dp"
android:paddingTop="10dp">
<TextView
android:id="#+id/drawer_itemName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="18sp"
android:layout_marginTop="3dp"
android:layout_marginLeft="5dp"
android:textAppearance="?android:attr/textAppearanceLarge"/>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginBottom="0dp"
android:layout_marginTop="0dp"
android:layout_marginLeft="0dp"
android:layout_marginRight="0dp"
android:background="#DADADC"
></View>
</LinearLayout>
</RelativeLayout>
To be honest i dont know what is happens, because i add the view before set the width and height. Can you help me?
Thanks.

Related

Unable to parse document 'jndi:/server/WebApplication2/WEB-INF/faces-config.xml': null

I already read almost everything about this and still cant solve it:
This is my faces-config:
<?xml version='1.0' encoding='UTF-8'?>
<faces-config version="2.2" xmlns="https://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://xmlns.jcp.org/xml/ns/javaee
https://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd">
<navigation-rule>
<from-view-id>/login.xhtml</from-view-id>
<navigation-case>
<from-outcome>admin</from-outcome>
<to-view-id>/admin.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
Severe: Exception during lifecycle processing
java.lang.Exception: java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: java.util.concurrent.ExecutionException: com.sun.faces.config.ConfigurationException: Unable to parse document 'jndi:/server/WebApplication2/WEB-INF/faces-config.xml': null
at com.sun.enterprise.web.WebApplication.start(WebApplication.java:168)
at org.glassfish.internal.data.EngineRef.start(EngineRef.java:122)
at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:291)
at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:352)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:500)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:539)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:535)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:360)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:534)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:565)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:557)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:360)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:556)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1464)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1300(CommandRunnerImpl.java:109)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1846)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1722)
at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:534)
at com.sun.enterprise.v3.admin.AdminAdapter.onMissingResource(AdminAdapter.java:224)
at org.glassfish.grizzly.http.server.StaticHttpHandlerBase.service(StaticHttpHandlerBase.java:189)
at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167)
at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:206)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:180)
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:283)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:200)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:132)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:111)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:536)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:591)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:571)
at java.lang.Thread.run(Thread.java:748)

App stopped when start an new activity by Intent

I'm using Intent to start new activity. I have also add it in my AndroidManifest. But When I click button to call ContactsActivity.class, Application get crash.
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".ContactsActivity">
</activity>
</application>
Mainactivity.class
Intent myIntent = new Intent(MainActivity.this, ContactsActivity.class);
startActivityForResult(myIntent,SECOND_ACTIVITY_RESULT_CODE);
FATAL EXCEPTION:
2019-01-20 08:04:48.101 30203-30203/com.example.musicplayeronline E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.musicplayeronline, PID: 30203
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.example.musicplayeronline-2/base.apk"],nativeLibraryDirectories=[/data/app/com.example.musicplayeronline-2/lib/x86_64, /system/lib64, /vendor/lib64]]] couldn't find "libnative-lib.so"
at java.lang.Runtime.loadLibrary0(Runtime.java:972)
at java.lang.System.loadLibrary(System.java:1530)
at com.example.musicplayeronline.ContactsActivity.<clinit>(ContactsActivity.java:24)
at java.lang.Class.newInstance(Native Method)
at android.app.Instrumentation.newActivity(Instrumentation.java:1078)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2538)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2707)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1460)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6077)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)

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