When I try to use HoloEverywhere with my settings activity I get this error in logcat:
10-26 09:56:59.653: E/AndroidRuntime(3552): android.view.InflateException: Binary XML file line #2: Error inflating class <unknown>
10-26 09:56:59.653: E/AndroidRuntime(3552): at android.view.LayoutInflater.createView(LayoutInflater.java:518)
10-26 09:56:59.653: E/AndroidRuntime(3552): at com.WazaBe.HoloEverywhere.LayoutInflater.onCreateView(LayoutInflater.java:195)
10-26 09:56:59.653: E/AndroidRuntime(3552): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:568)
10-26 09:56:59.653: E/AndroidRuntime(3552): at android.view.LayoutInflater.inflate(LayoutInflater.java:386)
10-26 09:56:59.653: E/AndroidRuntime(3552): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
10-26 09:56:59.653: E/AndroidRuntime(3552): at com.WazaBe.HoloEverywhere.preference.Preference.onCreateView(Preference.java:514)
10-26 09:56:59.653: E/AndroidRuntime(3552): at com.WazaBe.HoloEverywhere.preference.Preference.getView(Preference.java:404)
10-26 09:56:59.653: E/AndroidRuntime(3552): at com.WazaBe.HoloEverywhere.preference.PreferenceGroupAdapter.getView(PreferenceGroupAdapter.java:158)
10-26 09:56:59.653: E/AndroidRuntime(3552): at android.widget.AbsListView.obtainView(AbsListView.java:1430)
10-26 09:56:59.653: E/AndroidRuntime(3552): at android.widget.ListView.makeAndAddView(ListView.java:1745)
10-26 09:56:59.653: E/AndroidRuntime(3552): at android.widget.ListView.fillDown(ListView.java:670)
10-26 09:56:59.653: E/AndroidRuntime(3552): at android.widget.ListView.fillFromTop(ListView.java:727)
10-26 09:56:59.653: E/AndroidRuntime(3552): at android.widget.ListView.layoutChildren(ListView.java:1598)
10-26 09:56:59.653: E/AndroidRuntime(3552): at android.widget.AbsListView.onLayout(AbsListView.java:1260)
10-26 09:56:59.653: E/AndroidRuntime(3552): at android.view.View.layout(View.java:7175)
10-26 09:56:59.653: E/AndroidRuntime(3552): at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1254)
10-26 09:56:59.653: E/AndroidRuntime(3552): at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1130)
10-26 09:56:59.653: E/AndroidRuntime(3552): at android.widget.LinearLayout.onLayout(LinearLayout.java:1047)
10-26 09:56:59.653: E/AndroidRuntime(3552): at android.view.View.layout(View.java:7175)
10-26 09:56:59.653: E/AndroidRuntime(3552): at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1254)
10-26 09:56:59.653: E/AndroidRuntime(3552): at android.widget.LinearLayout.layoutHorizontal(LinearLayout.java:1243)
10-26 09:56:59.653: E/AndroidRuntime(3552): at android.widget.LinearLayout.onLayout(LinearLayout.java:1049)
10-26 09:56:59.653: E/AndroidRuntime(3552): at android.view.View.layout(View.java:7175)
10-26 09:56:59.653: E/AndroidRuntime(3552): at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1254)
10-26 09:56:59.653: E/AndroidRuntime(3552): at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1130)
10-26 09:56:59.653: E/AndroidRuntime(3552): at android.widget.LinearLayout.onLayout(LinearLayout.java:1047)
10-26 09:56:59.653: E/AndroidRuntime(3552): at android.view.View.layout(View.java:7175)
10-26 09:56:59.653: E/AndroidRuntime(3552): at android.widget.FrameLayout.onLayout(FrameLayout.java:338)
10-26 09:56:59.653: E/AndroidRuntime(3552): at android.view.View.layout(View.java:7175)
10-26 09:56:59.653: E/AndroidRuntime(3552): at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1254)
10-26 09:56:59.653: E/AndroidRuntime(3552): at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1130)
10-26 09:56:59.653: E/AndroidRuntime(3552): at android.widget.LinearLayout.onLayout(LinearLayout.java:1047)
10-26 09:56:59.653: E/AndroidRuntime(3552): at android.view.View.layout(View.java:7175)
10-26 09:56:59.653: E/AndroidRuntime(3552): at android.widget.FrameLayout.onLayout(FrameLayout.java:338)
10-26 09:56:59.653: E/AndroidRuntime(3552): at android.view.View.layout(View.java:7175)
10-26 09:56:59.653: E/AndroidRuntime(3552): at android.widget.FrameLayout.onLayout(FrameLayout.java:338)
10-26 09:56:59.653: E/AndroidRuntime(3552): at android.view.View.layout(View.java:7175)
10-26 09:56:59.653: E/AndroidRuntime(3552): at android.view.ViewRoot.performTraversals(ViewRoot.java:1140)
10-26 09:56:59.653: E/AndroidRuntime(3552): at android.view.ViewRoot.handleMessage(ViewRoot.java:1859)
10-26 09:56:59.653: E/AndroidRuntime(3552): at android.os.Handler.dispatchMessage(Handler.java:99)
10-26 09:56:59.653: E/AndroidRuntime(3552): at android.os.Looper.loop(Looper.java:130)
10-26 09:56:59.653: E/AndroidRuntime(3552): at android.app.ActivityThread.main(ActivityThread.java:3683)
10-26 09:56:59.653: E/AndroidRuntime(3552): at java.lang.reflect.Method.invokeNative(Native Method)
10-26 09:56:59.653: E/AndroidRuntime(3552): at java.lang.reflect.Method.invoke(Method.java:507)
10-26 09:56:59.653: E/AndroidRuntime(3552): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
10-26 09:56:59.653: E/AndroidRuntime(3552): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
10-26 09:56:59.653: E/AndroidRuntime(3552): at dalvik.system.NativeStart.main(Native Method)
10-26 09:56:59.653: E/AndroidRuntime(3552): Caused by: java.lang.reflect.InvocationTargetException
10-26 09:56:59.653: E/AndroidRuntime(3552): at java.lang.reflect.Constructor.constructNative(Native Method)
10-26 09:56:59.653: E/AndroidRuntime(3552): at java.lang.reflect.Constructor.newInstance(Constructor.java:415)
10-26 09:56:59.653: E/AndroidRuntime(3552): at android.view.LayoutInflater.createView(LayoutInflater.java:505)
10-26 09:56:59.653: E/AndroidRuntime(3552): ... 46 more
10-26 09:56:59.653: E/AndroidRuntime(3552): Caused by: java.lang.UnsupportedOperationException: Can't convert to dimension: type=0x2
10-26 09:56:59.653: E/AndroidRuntime(3552): at android.content.res.TypedArray.getDimensionPixelSize(TypedArray.java:463)
10-26 09:56:59.653: E/AndroidRuntime(3552): at android.view.View.<init>(View.java:2108)
10-26 09:56:59.653: E/AndroidRuntime(3552): at android.view.View.<init>(View.java:1899)
10-26 09:56:59.653: E/AndroidRuntime(3552): at android.view.ViewGroup.<init>(ViewGroup.java:286)
10-26 09:56:59.653: E/AndroidRuntime(3552): at android.widget.LinearLayout.<init>(LinearLayout.java:120)
10-26 09:56:59.653: E/AndroidRuntime(3552): at com.WazaBe.HoloEverywhere.widget.LinearLayout.<init>(LinearLayout.java:37)
10-26 09:56:59.653: E/AndroidRuntime(3552): at com.WazaBe.HoloEverywhere.widget.LinearLayout.<init>(LinearLayout.java:33)
10-26 09:56:59.653: E/AndroidRuntime(3552): ... 49 more
I start my settingsActivity from an overflow menu item. I can add an overflow menu to the HoloEverywhere-Demo and start my activity when chosen and it works. Here is my settings activity:
public class SettingsActivity extends com.WazaBe.HoloEverywhere.sherlock.SPreferenceActivity {
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.settings);
}
#Override
public void onStart() {
super.onStart();
initActionBar();
}
#Override
public void onResume() {
super.onResume();
}
#Override
public void onPause() {
super.onPause();
}
#Override
public void onStop() {
super.onStop();
}
private void initActionBar() {
ActionBar actionBar = getSupportActionBar();
actionBar.setBackgroundDrawable(getResources().getDrawable(R.drawable.action_bar_gradient));
actionBar.setTitle(R.string.settings);
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setDisplayUseLogoEnabled(true);
}
}
Any ideas why I can use this activity in the demo with no problems, but when I add to my application I get the error I posted?
Does your settings.xml use the holo attributes? You have to change xmlns to holo and all android: to holo:
Like this:
<PreferenceScreen xmlns:holo="http://schemas.android.com/apk/res-auto" >
<PreferenceCategory holo:title="title" >
<Preference
holo:key="key"
holo:summary="summary"
holo:title="title" />
</PreferenceCategory>
<Preference
holo:key="key"
holo:title="title"
holo:selectable="true" />
</PreferenceScreen>
Related
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
I use JSF2 and RichFaces and I want to change my view during loading other view, for example
<rich:panel rendered="#{MyMBean.necessaryToChangeView}" styleClass="passwordChangeReminder">... </rich:panel>
And methood in MyMbean:
public boolean isNecessaryToChangeView() {
if (myRequirement...) {
FacesContext fc = FacesContext.getCurrentInstance();
fc.getExternalContext().redirect(fc.getExternalContext().getRequestContextPath() + "/pages/changePass.jsf");
return false;
}
return true;
}
With this code I am getting
13:08:17,428 SEVERE [javax.enterprise.resource.webcontainer.jsf.application] (http-/127.0.0.1:8443-1) Error Rendering View[/pages/bilboard/bilboardShow.xhtml]: javax.el.ELException: /pages/bilboard/bilboardShow.xhtml #30,108 rendered="#{MyMBean.necessaryToChangeView}": java.lang.IllegalStateException
at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:114) [jsf-impl-2.1.19-redhat-2.jar:2.1.19-redhat-2]
at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:194) [jboss-jsf-api_2.1_spec-2.1.19.1.Final-redhat-1.jar:2.1.19.1.Final-redhat-1]
at javax.faces.component.UIComponentBase.isRendered(UIComponentBase.java:419) [jboss-jsf-api_2.1_spec-2.1.19.1.Final-redhat-1.jar:2.1.19.1.Final-redhat-1]
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1773) [jboss-jsf-api_2.1_spec-2.1.19.1.Final-redhat-1.jar:2.1.19.1.Final-redhat-1]
at javax.faces.render.Renderer.encodeChildren(Renderer.java:168) [jboss-jsf-api_2.1_spec-2.1.19.1.Final-redhat-1.jar:2.1.19.1.Final-redhat-1]
at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:851) [jboss-jsf-api_2.1_spec-2.1.19.1.Final-redhat-1.jar:2.1.19.1.Final-redhat-1]
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1779) [jboss-jsf-api_2.1_spec-2.1.19.1.Final-redhat-1.jar:2.1.19.1.Final-redhat-1]
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1782) [jboss-jsf-api_2.1_spec-2.1.19.1.Final-redhat-1.jar:2.1.19.1.Final-redhat-1]
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1782) [jboss-jsf-api_2.1_spec-2.1.19.1.Final-redhat-1.jar:2.1.19.1.Final-redhat-1]
at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:439) [jsf-impl-2.1.19-redhat-2.jar:2.1.19-redhat-2]
at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:124) [jsf-impl-2.1.19-redhat-2.jar:2.1.19-redhat-2]
at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:286) [jboss-jsf-api_2.1_spec-2.1.19.1.Final-redhat-1.jar:2.1.19.1.Final-redhat-1]
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120) [jsf-impl-2.1.19-redhat-2.jar:2.1.19-redhat-2]
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) [jsf-impl-2.1.19-redhat-2.jar:2.1.19-redhat-2]
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139) [jsf-impl-2.1.19-redhat-2.jar:2.1.19-redhat-2]
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:594) [jboss-jsf-api_2.1_spec-2.1.19.1.Final-redhat-1.jar:2.1.19.1.Final-redhat-1]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
at my.web.NoCacheFilter.doFilter(NoCacheFilter.java:73) [jleo-weblsp-client-web-mbean-2.00.00_beta.jar:]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
at my.web.license.LicensesFilter.doFilter(LicensesFilter.java:77) [jleo-weblsp-client-web-mbean-2.00.00_beta.jar:]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
at my.jleo.session.SessionTimeoutFilter.doFilter(SessionTimeoutFilter.java:52) [jleo-weblsp-client-web-mbean-2.00.00_beta.jar:]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
at my.jleo.login.SecurityCheckFilter.doFilter(SecurityCheckFilter.java:73) [jleo-weblsp-client-web-mbean-2.00.00_beta.jar:]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:149) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
at org.jboss.modcluster.container.jbossweb.JBossWebContext$RequestListenerValve.event(JBossWebContext.java:91)
at org.jboss.modcluster.container.jbossweb.JBossWebContext$RequestListenerValve.invoke(JBossWebContext.java:72)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:499) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50) [jboss-as-jpa-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50) [jboss-as-jpa-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169) [jboss-as-web-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:145) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:336) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:920) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_51]
What is wrong with my code? Could anyone help me? I woud be very grateful ;)
l
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.
Time to time I get this exception from liferay, here is the stacktrace:
07:45:02,033 ERROR [BasePersistenceImpl:186] Caught unexpected exception java.lang.NullPointerException
07:45:02,035 ERROR [BasePersistenceImpl:186] Caught unexpected exception com.liferay.portal.kernel.exception.SystemException
07:45:02,040 ERROR [MainServlet:1184] com.liferay.portal.kernel.events.ActionException: com.liferay.portal.kernel.exception.SystemException: com.liferay.portal.kernel.exception.SystemException: java.la
com.liferay.portal.kernel.events.ActionException: com.liferay.portal.kernel.exception.SystemException: com.liferay.portal.kernel.exception.SystemException: java.lang.NullPointerException
at com.liferay.portal.events.ServicePreAction.run(ServicePreAction.java:1241)
at com.liferay.portal.events.EventsProcessorImpl.processEvent(EventsProcessorImpl.java:81)
at com.liferay.portal.events.EventsProcessorImpl.process(EventsProcessorImpl.java:58)
at com.liferay.portal.events.EventsProcessorUtil.process(EventsProcessorUtil.java:53)
at com.liferay.portal.servlet.MainServlet.processServicePre(MainServlet.java:1164)
at com.liferay.portal.servlet.MainServlet.service(MainServlet.java:474)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:72)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:113)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:113)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:113)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:121)
at com.liferay.portal.servlet.filters.secure.SecureFilter.processFilter(SecureFilter.java:199)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:203)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:105)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:121)
at com.liferay.portal.servlet.filters.autologin.AutoLoginFilter.processFilter(AutoLoginFilter.java:240)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:203)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:105)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:71)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:471)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:402)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:329)
at com.liferay.portal.servlet.FriendlyURLServlet.service(FriendlyURLServlet.java:135)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:72)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:121)
at com.liferay.portal.servlet.filters.strip.StripFilter.processFilter(StripFilter.java:304)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:203)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:105)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:113)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:121)
at com.liferay.portal.servlet.filters.gzip.GZipFilter.processFilter(GZipFilter.java:123)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:203)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:105)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:121)
at com.liferay.portal.servlet.filters.secure.SecureFilter.processFilter(SecureFilter.java:199)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:203)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:105)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:113)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:121)
at com.liferay.portal.servlet.filters.etag.ETagFilter.processFilter(ETagFilter.java:55)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:203)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:105)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:121)
at com.liferay.portal.servlet.filters.autologin.AutoLoginFilter.processFilter(AutoLoginFilter.java:240)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:203)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:105)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:71)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:471)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:402)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:329)
at com.liferay.portal.servlet.I18nServlet.service(I18nServlet.java:102)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:72)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:121)
at com.liferay.portal.servlet.filters.sso.ntlm.NtlmPostFilter.processFilter(NtlmPostFilter.java:83)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:203)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:105)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:121)
at com.liferay.portal.sharepoint.SharepointFilter.processFilter(SharepointFilter.java:80)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:203)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:105)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:121)
at com.liferay.portal.servlet.filters.virtualhost.VirtualHostFilter.processFilter(VirtualHostFilter.java:208)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:203)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:105)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:184)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:92)
at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:738)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:203)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:105)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:164)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:92)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:164)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:92)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:71)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
at org.apache.catalina.core.StandardContextValve.__invoke(StandardContextValve.java:169)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.__invoke(StandardHostValve.java:168)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:928)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:539)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:298)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
Caused by: com.liferay.portal.kernel.exception.SystemException: com.liferay.portal.kernel.exception.SystemException: java.lang.NullPointerException
at com.liferay.portal.service.persistence.impl.BasePersistenceImpl.processException(BasePersistenceImpl.java:193)
at com.liferay.counter.service.persistence.CounterFinderImpl._competeIncrement(CounterFinderImpl.java:360)
at com.liferay.counter.service.persistence.CounterFinderImpl.increment(CounterFinderImpl.java:109)
at com.liferay.counter.service.persistence.CounterFinderImpl.increment(CounterFinderImpl.java:99)
at com.liferay.counter.service.impl.CounterLocalServiceImpl.increment(CounterLocalServiceImpl.java:46)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:112)
at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:71)
at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:108)
at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:211)
at $Proxy114.increment(Unknown Source)
at com.liferay.portal.service.impl.LayoutLocalServiceImpl.getNextLayoutId(LayoutLocalServiceImpl.java:1161)
at com.liferay.portal.service.impl.LayoutLocalServiceImpl.addLayout(LayoutLocalServiceImpl.java:196)
at com.liferay.portal.service.impl.LayoutLocalServiceImpl.addLayout(LayoutLocalServiceImpl.java:393)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:112)
at com.liferay.portal.service.impl.LayoutLocalServiceVirtualLayoutsAdvice.invoke(LayoutLocalServiceVirtualLayoutsAdvice.java:144)
at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:108)
at com.liferay.portal.service.impl.LayoutLocalServiceStagingAdvice.invoke(LayoutLocalServiceStagingAdvice.java:90)
at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:108)
at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:71)
at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:108)
at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:211)
at $Proxy26.addLayout(Unknown Source)
at com.liferay.portal.service.LayoutLocalServiceUtil.addLayout(LayoutLocalServiceUtil.java:410)
at com.liferay.portal.events.ServicePreAction.addDefaultUserPrivateLayoutByProperties(ServicePreAction.java:1284)
at com.liferay.portal.events.ServicePreAction.addDefaultUserPrivateLayouts(ServicePreAction.java:1368)
at com.liferay.portal.events.ServicePreAction.updateUserLayouts(ServicePreAction.java:1979)
at com.liferay.portal.events.ServicePreAction.initThemeDisplay(ServicePreAction.java:371)
at com.liferay.portal.events.ServicePreAction.servicePre(ServicePreAction.java:1885)
at com.liferay.portal.events.ServicePreAction.run(ServicePreAction.java:1238)
... 116 more
Caused by: com.liferay.portal.kernel.exception.SystemException: java.lang.NullPointerException
at com.liferay.portal.service.persistence.impl.BasePersistenceImpl.processException(BasePersistenceImpl.java:193)
at com.liferay.counter.service.persistence.CounterFinderImpl._obtainIncrement(CounterFinderImpl.java:403)
at com.liferay.counter.service.persistence.CounterFinderImpl._competeIncrement(CounterFinderImpl.java:350)
... 151 more
Caused by: java.lang.NullPointerException
at com.liferay.counter.service.persistence.CounterFinderImpl._obtainIncrement(CounterFinderImpl.java:384)
... 152 more
And in browser:
an-unexpected-system-error-occurred
com.liferay.portal.kernel.exception.SystemException: com.liferay.portal.kernel.exception.SystemException: java.lang.NullPointerException
And I cannot find reason. This error occurs randomly. Can anybody help me?
When I try to access some protected page like the writerPage, Shiro keep redirecting me to the loging Page
This is the shiro.ini file
[users]
admin = p
mike = p, reader, writer
joe = p, writer
[urls]
/success/** = authc
/writer/** = authc
And the server show some error:
INFO: PWC1412: WebModule[/ShiroTest3_mvn] ServletContext.log():Cleaning up Shiro Environment
INFO: PWC1412: WebModule[/ShiroTest3_mvn] ServletContext.log():Initializing Shiro environment
GRAVE: 105 [http-thread-pool-4848-(1)] INFO org.apache.shiro.web.env.EnvironmentLoader - Starting Shiro environment initialization.
GRAVE: 997 [http-thread-pool-4848-(1)] INFO org.apache.shiro.web.env.EnvironmentLoader - Shiro environment initialized in 882 ms.
INFO: Loading application com.mycompany_ShiroTest3_mvn_war_1.0-SNAPSHOT at /ShiroTest3_mvn
INFO: com.mycompany_ShiroTest3_mvn_war_1.0-SNAPSHOT was successfully deployed in 1 606 milliseconds.
And this the web.xml file
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
version="3.0">
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<listener>
<listener-class>org.apache.shiro.web.env.EnvironmentLoaderListener</listener-class>
</listener>
<filter>
<filter-name>shiroFilter</filter-name>
<filter-class>org.apache.shiro.web.servlet.ShiroFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>shiroFilter</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
<dispatcher>INCLUDE</dispatcher>
<dispatcher>ERROR</dispatcher>
</filter-mapping>
</web-app>
Do i need to add/modify something?
Though Shiro seems to be less complicated for a beginner compared to Spring Security, It seems it has less support :(
UPDATE
after adding the [main] code:
I get this error
server log error
INFO: PWC1412: WebModule[null] ServletContext.log():Initializing Shiro environment
GRAVE: 3155 [admin-thread-pool-4848(1)] INFO org.apache.shiro.web.env.EnvironmentLoader - Starting Shiro environment initialization.
GRAVE: 4218 [admin-thread-pool-4848(1)] ERROR org.apache.shiro.web.env.EnvironmentLoader - Shiro environment initialization failed
GRAVE: java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
at org.apache.commons.beanutils.ConvertUtilsBean.<init>(ConvertUtilsBean.java:157)
at org.apache.commons.beanutils.BeanUtilsBean.<init>(BeanUtilsBean.java:117)
at org.apache.commons.beanutils.BeanUtilsBean$1.initialValue(BeanUtilsBean.java:68)
at org.apache.commons.beanutils.ContextClassLoaderLocal.get(ContextClassLoaderLocal.java:153)
at org.apache.commons.beanutils.BeanUtilsBean.getInstance(BeanUtilsBean.java:80)
at org.apache.commons.beanutils.PropertyUtilsBean.getInstance(PropertyUtilsBean.java:114)
at org.apache.commons.beanutils.PropertyUtils.getPropertyDescriptor(PropertyUtils.java:460)
at org.apache.shiro.config.ReflectionBuilder.isTypedProperty(ReflectionBuilder.java:248)
at org.apache.shiro.config.ReflectionBuilder.applyProperty(ReflectionBuilder.java:491)
at org.apache.shiro.config.ReflectionBuilder.applySingleProperty(ReflectionBuilder.java:203)
at org.apache.shiro.config.ReflectionBuilder.applyProperty(ReflectionBuilder.java:164)
at org.apache.shiro.config.ReflectionBuilder.buildObjects(ReflectionBuilder.java:124)
at org.apache.shiro.config.IniSecurityManagerFactory.buildInstances(IniSecurityManagerFactory.java:170)
at org.apache.shiro.config.IniSecurityManagerFactory.createSecurityManager(IniSecurityManagerFactory.java:119)
at org.apache.shiro.config.IniSecurityManagerFactory.createSecurityManager(IniSecurityManagerFactory.java:97)
at org.apache.shiro.config.IniSecurityManagerFactory.createInstance(IniSecurityManagerFactory.java:83)
at org.apache.shiro.config.IniSecurityManagerFactory.createInstance(IniSecurityManagerFactory.java:41)
at org.apache.shiro.config.IniFactorySupport.createInstance(IniFactorySupport.java:123)
at org.apache.shiro.util.AbstractFactory.getInstance(AbstractFactory.java:47)
at org.apache.shiro.web.env.IniWebEnvironment.createWebSecurityManager(IniWebEnvironment.java:203)
at org.apache.shiro.web.env.IniWebEnvironment.configure(IniWebEnvironment.java:99)
at org.apache.shiro.web.env.IniWebEnvironment.init(IniWebEnvironment.java:92)
at org.apache.shiro.util.LifecycleUtils.init(LifecycleUtils.java:45)
at org.apache.shiro.util.LifecycleUtils.init(LifecycleUtils.java:40)
at org.apache.shiro.web.env.EnvironmentLoader.createEnvironment(EnvironmentLoader.java:226)
at org.apache.shiro.web.env.EnvironmentLoader.initEnvironment(EnvironmentLoader.java:138)
at org.apache.shiro.web.env.EnvironmentLoaderListener.contextInitialized(EnvironmentLoaderListener.java:58)
at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:4750)
at com.sun.enterprise.web.WebModule.contextListenerStart(WebModule.java:550)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:5366)
at com.sun.enterprise.web.WebModule.start(WebModule.java:498)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:917)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:901)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:733)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2019)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1669)
at com.sun.enterprise.web.WebApplication.start(WebApplication.java:109)
at org.glassfish.internal.data.EngineRef.start(EngineRef.java:130)
at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:269)
at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:301)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:461)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:389)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:348)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:363)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1085)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:95)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1291)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1259)
at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:461)
at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:212)
at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:179)
at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117)
at com.sun.enterprise.v3.services.impl.ContainerMapper$Hk2DispatcherCallable.call(ContainerMapper.java:354)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1509)
at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1359)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
... 69 more
GRAVE: PWC1306: Startup of context /ShiroTest3_mvn failed due to previous errors
GRAVE: PWC1305: Exception during cleanup after start failed
org.apache.catalina.LifecycleException: PWC2769: Manager has not yet been started
at org.apache.catalina.session.StandardManager.stop(StandardManager.java:873)
at org.apache.catalina.core.StandardContext.stop(StandardContext.java:5571)
at com.sun.enterprise.web.WebModule.stop(WebModule.java:527)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:5384)
at com.sun.enterprise.web.WebModule.start(WebModule.java:498)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:917)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:901)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:733)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2019)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1669)
at com.sun.enterprise.web.WebApplication.start(WebApplication.java:109)
at org.glassfish.internal.data.EngineRef.start(EngineRef.java:130)
at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:269)
at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:301)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:461)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:389)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:348)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:363)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1085)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:95)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1291)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1259)
at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:461)
at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:212)
at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:179)
at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117)
at com.sun.enterprise.v3.services.impl.ContainerMapper$Hk2DispatcherCallable.call(ContainerMapper.java:354)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:619)
GRAVE: ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
at org.apache.catalina.core.StandardContext.start(StandardContext.java:5389)
at com.sun.enterprise.web.WebModule.start(WebModule.java:498)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:917)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:901)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:733)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2019)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1669)
at com.sun.enterprise.web.WebApplication.start(WebApplication.java:109)
at org.glassfish.internal.data.EngineRef.start(EngineRef.java:130)
at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:269)
at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:301)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:461)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:389)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:348)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:363)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1085)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:95)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1291)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1259)
at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:461)
at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:212)
at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:179)
at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117)
at com.sun.enterprise.v3.services.impl.ContainerMapper$Hk2DispatcherCallable.call(ContainerMapper.java:354)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
at org.apache.commons.beanutils.ConvertUtilsBean.<init>(ConvertUtilsBean.java:157)
at org.apache.commons.beanutils.BeanUtilsBean.<init>(BeanUtilsBean.java:117)
at org.apache.commons.beanutils.BeanUtilsBean$1.initialValue(BeanUtilsBean.java:68)
at org.apache.commons.beanutils.ContextClassLoaderLocal.get(ContextClassLoaderLocal.java:153)
at org.apache.commons.beanutils.BeanUtilsBean.getInstance(BeanUtilsBean.java:80)
at org.apache.commons.beanutils.PropertyUtilsBean.getInstance(PropertyUtilsBean.java:114)
at org.apache.commons.beanutils.PropertyUtils.getPropertyDescriptor(PropertyUtils.java:460)
at org.apache.shiro.config.ReflectionBuilder.isTypedProperty(ReflectionBuilder.java:248)
at org.apache.shiro.config.ReflectionBuilder.applyProperty(ReflectionBuilder.java:491)
at org.apache.shiro.config.ReflectionBuilder.applySingleProperty(ReflectionBuilder.java:203)
at org.apache.shiro.config.ReflectionBuilder.applyProperty(ReflectionBuilder.java:164)
at org.apache.shiro.config.ReflectionBuilder.buildObjects(ReflectionBuilder.java:124)
at org.apache.shiro.config.IniSecurityManagerFactory.buildInstances(IniSecurityManagerFactory.java:170)
at org.apache.shiro.config.IniSecurityManagerFactory.createSecurityManager(IniSecurityManagerFactory.java:119)
at org.apache.shiro.config.IniSecurityManagerFactory.createSecurityManager(IniSecurityManagerFactory.java:97)
at org.apache.shiro.config.IniSecurityManagerFactory.createInstance(IniSecurityManagerFactory.java:83)
at org.apache.shiro.config.IniSecurityManagerFactory.createInstance(IniSecurityManagerFactory.java:41)
at org.apache.shiro.config.IniFactorySupport.createInstance(IniFactorySupport.java:123)
at org.apache.shiro.util.AbstractFactory.getInstance(AbstractFactory.java:47)
at org.apache.shiro.web.env.IniWebEnvironment.createWebSecurityManager(IniWebEnvironment.java:203)
at org.apache.shiro.web.env.IniWebEnvironment.configure(IniWebEnvironment.java:99)
at org.apache.shiro.web.env.IniWebEnvironment.init(IniWebEnvironment.java:92)
at org.apache.shiro.util.LifecycleUtils.init(LifecycleUtils.java:45)
at org.apache.shiro.util.LifecycleUtils.init(LifecycleUtils.java:40)
at org.apache.shiro.web.env.EnvironmentLoader.createEnvironment(EnvironmentLoader.java:226)
at org.apache.shiro.web.env.EnvironmentLoader.initEnvironment(EnvironmentLoader.java:138)
at org.apache.shiro.web.env.EnvironmentLoaderListener.contextInitialized(EnvironmentLoaderListener.java:58)
at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:4750)
at com.sun.enterprise.web.WebModule.contextListenerStart(WebModule.java:550)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:5366)
... 39 more
Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1509)
at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1359)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
... 69 more
ATTENTION: java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:921)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:901)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:733)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2019)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1669)
at com.sun.enterprise.web.WebApplication.start(WebApplication.java:109)
at org.glassfish.internal.data.EngineRef.start(EngineRef.java:130)
at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:269)
at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:301)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:461)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:389)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:348)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:363)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1085)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:95)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1291)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1259)
at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:461)
at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:212)
at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:179)
at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117)
at com.sun.enterprise.v3.services.impl.ContainerMapper$Hk2DispatcherCallable.call(ContainerMapper.java:354)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:619)
GRAVE: Exception while invoking class com.sun.enterprise.web.WebApplication start method
java.lang.Exception: java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
at com.sun.enterprise.web.WebApplication.start(WebApplication.java:138)
at org.glassfish.internal.data.EngineRef.start(EngineRef.java:130)
at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:269)
at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:301)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:461)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:389)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:348)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:363)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1085)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:95)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1291)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1259)
at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:461)
at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:212)
at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:179)
at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117)
at com.sun.enterprise.v3.services.impl.ContainerMapper$Hk2DispatcherCallable.call(ContainerMapper.java:354)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:619)
GRAVE: Exception while loading the app
GRAVE: Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
The authc filter is a FormAuthenticationFilter by default. Because it expects a form to exist, you must configure the form's url.
But you have to configure that login URL in two places, one in [main] and another in [urls]:
[main]
authc.loginUrl = /login.jsp
authc.successUrl = /success/successLogin.jsp
[urls]
/login.jsp = authc
/success/** = authc
/writer/** = authc
The first line in [main] says "The authentication filter should use the following login URL when redirecting a user to login"
The first line in [urls] says: "Whenever a request for the /login.jsp url comes in, I want the authc filter to handle the request".
They are separate, but complementary config statements - both need to be specified for the FormAuthenticationFilter to work.
when you changed to authcBasic, this worked because there is no form to process - the browser supplies the login dialog so Shiro doesn't have to look for form parameters.
Please include below jars in WEB-INF/lib
commons-beanutils-1.6.1.jar
commons-collections-2.1.jar
commons-logging-1.0.3.jar
log4j-1.2.14.jar
slf4j-api-1.5.6.jar
slf4j-log4j12-1.5.6.jar