I have an app with flipper and animation of images on each page of Flipper...
App works on HTC Desire, Desire S, Samsung Galaxy tab 1 (7')... But when I try to run it on Samsung Galaxy Tab 10.1 - this error occures...
flipper = (ViewFlipper) findViewById(R.id.flipper);
LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
int layouts[] = new int[]{ R.layout.first, R.layout.second, R.layout.third, R.layout.fourth,
R.layout.fifth, R.layout.sixth, R.layout.seventh, R.layout.eighth, R.layout.nineth, R.layout.tenth,
R.layout.eleventh, R.layout.twelveth, R.layout.thirteen, R.layout.fourteenth };
for (int layout : layouts)
flipper.addView(inflater.inflate(layout, null));
02-16 09:33:44.129: E/AndroidRuntime(1733): FATAL EXCEPTION: main
02-16 09:33:44.129: E/AndroidRuntime(1733): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.home/com.home.Main}: android.view.InflateException: Binary XML file line #2: Error inflating class <unknown>
02-16 09:33:44.129: E/AndroidRuntime(1733): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1751)
02-16 09:33:44.129: E/AndroidRuntime(1733): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1767)
02-16 09:33:44.129: E/AndroidRuntime(1733): at android.app.ActivityThread.access$1500(ActivityThread.java:122)
02-16 09:33:44.129: E/AndroidRuntime(1733): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1005)
02-16 09:33:44.129: E/AndroidRuntime(1733): at android.os.Handler.dispatchMessage(Handler.java:99)
02-16 09:33:44.129: E/AndroidRuntime(1733): at android.os.Looper.loop(Looper.java:132)
02-16 09:33:44.129: E/AndroidRuntime(1733): at android.app.ActivityThread.main(ActivityThread.java:4028)
02-16 09:33:44.129: E/AndroidRuntime(1733): at java.lang.reflect.Method.invokeNative(Native Method)
02-16 09:33:44.129: E/AndroidRuntime(1733): at java.lang.reflect.Method.invoke(Method.java:491)
02-16 09:33:44.129: E/AndroidRuntime(1733): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:844)
02-16 09:33:44.129: E/AndroidRuntime(1733): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)
02-16 09:33:44.129: E/AndroidRuntime(1733): at dalvik.system.NativeStart.main(Native Method)
02-16 09:33:44.129: E/AndroidRuntime(1733): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class <unknown>
02-16 09:33:44.129: E/AndroidRuntime(1733): at android.view.LayoutInflater.createView(LayoutInflater.java:596)
02-16 09:33:44.129: E/AndroidRuntime(1733): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
02-16 09:33:44.129: E/AndroidRuntime(1733): at android.view.LayoutInflater.onCreateView(LayoutInflater.java:644)
02-16 09:33:44.129: E/AndroidRuntime(1733): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:669)
02-16 09:33:44.129: E/AndroidRuntime(1733): at android.view.LayoutInflater.inflate(LayoutInflater.java:457)
02-16 09:33:44.129: E/AndroidRuntime(1733): at android.view.LayoutInflater.inflate(LayoutInflater.java:391)
02-16 09:33:44.129: E/AndroidRuntime(1733): at android.view.LayoutInflater.inflate(LayoutInflater.java:347)
02-16 09:33:44.129: E/AndroidRuntime(1733): at com.home.Main.onCreate(Main.java:98)
02-16 09:33:44.129: E/AndroidRuntime(1733): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1048)
02-16 09:33:44.129: E/AndroidRuntime(1733): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1715)
02-16 09:33:44.129: E/AndroidRuntime(1733): ... 11 more
02-16 09:33:44.129: E/AndroidRuntime(1733): Caused by: java.lang.reflect.InvocationTargetException
02-16 09:33:44.129: E/AndroidRuntime(1733): at java.lang.reflect.Constructor.constructNative(Native Method)
02-16 09:33:44.129: E/AndroidRuntime(1733): at java.lang.reflect.Constructor.newInstance(Constructor.java:416)
02-16 09:33:44.129: E/AndroidRuntime(1733): at android.view.LayoutInflater.createView(LayoutInflater.java:576)
02-16 09:33:44.129: E/AndroidRuntime(1733): ... 20 more
02-16 09:33:44.129: E/AndroidRuntime(1733): Caused by: java.lang.OutOfMemoryError
02-16 09:33:44.129: E/AndroidRuntime(1733): at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
02-16 09:33:44.129: E/AndroidRuntime(1733): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:577)
02-16 09:33:44.129: E/AndroidRuntime(1733): at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:445)
02-16 09:33:44.129: E/AndroidRuntime(1733): at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:738)
02-16 09:33:44.129: E/AndroidRuntime(1733): at android.content.res.Resources.loadDrawable(Resources.java:1869)
02-16 09:33:44.129: E/AndroidRuntime(1733): at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
02-16 09:33:44.129: E/AndroidRuntime(1733): at android.view.View.<init>(View.java:2462)
02-16 09:33:44.129: E/AndroidRuntime(1733): at android.view.View.<init>(View.java:2401)
02-16 09:33:44.129: E/AndroidRuntime(1733): at android.view.ViewGroup.<init>(ViewGroup.java:359)
02-16 09:33:44.129: E/AndroidRuntime(1733): at android.widget.RelativeLayout.<init>(RelativeLayout.java:173)
02-16 09:33:44.129: E/AndroidRuntime(1733): ... 23 more
As I understand after googling this error is because of Manifest, any ideas?
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.home"
android:installLocation="preferExternal"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="8" />
<supports-screens
android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:anyDensity="true"/>
<application android:icon="#drawable/icon" android:label="#string/app_name">
<activity android:name=".Main"
android:label="#string/app_name"
android:screenOrientation="landscape"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
No, this is because of OutOfMemoryError exception. You're trying to load some heavy enough bitmap from your resources:
02-16 09:33:44.129: E/AndroidRuntime(1733): Caused by: java.lang.OutOfMemoryError
02-16 09:33:44.129: E/AndroidRuntime(1733): at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
02-16 09:33:44.129: E/AndroidRuntime(1733): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:577)
02-16 09:33:44.129: E/AndroidRuntime(1733): at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:445)
02-16 09:33:44.129: E/AndroidRuntime(1733): at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:738)
02-16 09:33:44.129: E/AndroidRuntime(1733): at android.content.res.Resources.loadDrawable(Resources.java:1869)
02-16 09:33:44.129: E/AndroidRuntime(1733): at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
02-16 09:33:44.129: E/AndroidRuntime(1733): at android.view.View.<init>(View.java:2462)
02-16 09:33:44.129: E/AndroidRuntime(1733): at android.view.View.<init>(View.java:2401)
02-16 09:33:44.129: E/AndroidRuntime(1733): at android.view.ViewGroup.<init>(ViewGroup.java:359)
02-16 09:33:44.129: E/AndroidRuntime(1733): at android.widget.RelativeLayout.<init>(RelativeLayout.java:173)
02-16 09:33:44.129: E/AndroidRuntime(1733): ... 23 more
Related
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.firstproject, PID: 6019
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.firstproject/com.example.firstproject.MainActivity}: android.view.InflateException: Binary XML file line #25: Error inflating class android.webkit.WebView
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2325)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
at android.app.ActivityThread.access$800(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
Caused by: android.view.InflateException: Binary XML file line #25: Error inflating class android.webkit.WebView
at android.view.LayoutInflater.createView(LayoutInflater.java:633)
at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:55)
at android.view.LayoutInflater.onCreateView(LayoutInflater.java:682)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:741)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:809)
at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:555)
at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:161)
at com.example.firstproject.MainActivity.onCreate(MainActivity.java:19)
at android.app.Activity.performCreate(Activity.java:5990)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
at android.app.ActivityThread.access$800(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.newInstance(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:288)
at android.view.LayoutInflater.createView(LayoutInflater.java:607)
at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:55)
at android.view.LayoutInflater.onCreateView(LayoutInflater.java:682)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:741)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:809)
at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:555)
at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:161)
at com.example.firstproject.MainActivity.onCreate(MainActivity.java:19)
at android.app.Activity.performCreate(Activity.java:5990)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
at android.app.ActivityThread.access$800(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
Caused by: android.content.res.Resources$NotFoundException: String resource ID #0x2040003
at android.content.res.Resources.getText(Resources.java:299)
at android.content.res.Resources.getString(Resources.java:385)
at com.android.org.chromium.content.browser.ContentViewCore.setContainerView(ContentViewCore.java:684)
at com.android.org.chromium.content.browser.ContentViewCore.initialize(ContentViewCore.java:608)
at com.android.org.chromium.android_webview.AwContents.createAndInitializeContentViewCore(AwContents.java:631)
at com.android.org.chromium.android_webview.AwContents.setNewAwContents(AwContents.java:780)
at com.android.org.chromium.android_webview.AwContents.(AwContents.java:619)
at com.android.org.chromium.android_webview.AwContents.(AwContents.java:556)
at com.android.webview.chromium.WebViewChromium.initForReal(WebViewChromium.java:311)
at com.android.webview.chromium.WebViewChromium.access$100(WebViewChromium.java:96)
at com.android.webview.chromium.WebViewChromium$1.run(WebViewChromium.java:263)
at com.android.webview.chromium.WebViewChromium$WebViewChromiumRunQueue.drainQueue(WebViewChromium.java:123)
at com.android.webview.chromium.WebViewChromium$WebViewChromiumRunQueue$1.run(WebViewChromium.java:110)
at com.android.org.chromium.base.ThreadUtils.runOnUiThread(ThreadUtils.java:144)
at com.android.webview.chromium.WebViewChromium$WebViewChromiumRunQueue.addTask(WebViewChromium.java:107)
at com.android.webview.chromium.WebViewChromium.init(WebViewChromium.java:260)
at android
public class MainActivity extends AppCompatActivity {
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
final WebView webView = (WebView) findViewById(R.id.web_view) ;
final EditText editText = (EditText) findViewById(R.id.etext) ;
webView.setWebViewClient (new WebViewClient() );
Button button = (Button)findViewById(R.id.btn_go) ;
button.setOnClickListener (new View.OnClickListener() {
#Override
public void onClick (View v){
webView.loadUrl(editText.getText().toString() ) ;
}
});
}
}
Here's XML code :
Here's Emulator :
I've played with the latest Spring Integration DSL and got stuck on the consumer configuration.
This is my consumer config:
#Configuration
public static class ConsumerConfiguration {
#Autowired
private KafkaConfig kafkaConfig;
private Log log = LogFactory.getLog(getClass());
#Bean
public ConsumerFactory<String, String> consumerFactory() {
Map<String, Object> props = new HashMap<>();
props.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, kafkaConfig.getBrokerAddress());
props.put(ConsumerConfig.GROUP_ID_CONFIG, "myGroup");
props.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class);
props.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class);
props.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "earliest");
props.put(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG, true);
return new DefaultKafkaConsumerFactory<>(props);
}
#Bean
IntegrationFlow consumer() {
log.info("starting consumer..");
KafkaMessageDrivenChannelAdapterListenerContainerSpec<String, String> kafkaMDCAListenerContainerSpec =
Kafka09.messageDriverChannelAdapter(consumerFactory(), kafkaConfig.getTopic());
return IntegrationFlows
.from(kafkaMDCAListenerContainerSpec)
.<Map<String, List<String>>>handle((payload, headers) -> {
payload.entrySet().forEach(e -> log.info(e.getKey() + '=' + e.getValue()));
return null;
})
.get();
}
}
During application startup I am getting the following exception:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'consumer' defined in class path resource [demo/DemoApplication$ConsumerConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.integration.dsl.IntegrationFlow]: Factory method 'consumer' threw exception; nested exception is java.lang.NoSuchMethodError: org.springframework.kafka.listener.adapter.MessagingMessageListenerAdapter.<init>(Ljava/lang/reflect/Method;)V
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:599) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1128) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1023) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:751) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:861) ~[spring-context-4.3.3.RELEASE.jar:4.3.3.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:541) ~[spring-context-4.3.3.RELEASE.jar:4.3.3.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:761) [spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:371) [spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) [spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1186) [spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1175) [spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE]
at demo.DemoApplication.main(DemoApplication.java:162) [classes/:na]
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.integration.dsl.IntegrationFlow]: Factory method 'consumer' threw exception; nested exception is java.lang.NoSuchMethodError: org.springframework.kafka.listener.adapter.MessagingMessageListenerAdapter.<init>(Ljava/lang/reflect/Method;)V
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE]
... 17 common frames omitted
Caused by: java.lang.NoSuchMethodError: org.springframework.kafka.listener.adapter.MessagingMessageListenerAdapter.<init>(Ljava/lang/reflect/Method;)V
at org.springframework.integration.dsl.kafka.Kafka09MessageDrivenChannelAdapter$IntegrationMessageListener.<init>(Kafka09MessageDrivenChannelAdapter.java:152) ~[spring-integration-java-dsl-1.2.0.M2.jar:na]
at org.springframework.integration.dsl.kafka.Kafka09MessageDrivenChannelAdapter.<init>(Kafka09MessageDrivenChannelAdapter.java:50) ~[spring-integration-java-dsl-1.2.0.M2.jar:na]
at org.springframework.integration.dsl.kafka.Kafka09MessageDrivenChannelAdapterSpec.<init>(Kafka09MessageDrivenChannelAdapterSpec.java:54) ~[spring-integration-java-dsl-1.2.0.M2.jar:na]
at org.springframework.integration.dsl.kafka.Kafka09MessageDrivenChannelAdapterSpec$KafkaMessageDrivenChannelAdapterListenerContainerSpec.<init>(Kafka09MessageDrivenChannelAdapterSpec.java:71) ~[spring-integration-java-dsl-1.2.0.M2.jar:na]
at org.springframework.integration.dsl.kafka.Kafka09.messageDriverChannelAdapter(Kafka09.java:148) ~[spring-integration-java-dsl-1.2.0.M2.jar:na]
at org.springframework.integration.dsl.kafka.Kafka09.messageDriverChannelAdapter(Kafka09.java:123) ~[spring-integration-java-dsl-1.2.0.M2.jar:na]
at demo.DemoApplication$ConsumerConfiguration.consumer(DemoApplication.java:149) ~[classes/:na]
at demo.DemoApplication$ConsumerConfiguration$$EnhancerBySpringCGLIB$$845f73e4.CGLIB$consumer$0(<generated>) ~[classes/:na]
at demo.DemoApplication$ConsumerConfiguration$$EnhancerBySpringCGLIB$$845f73e4$$FastClassBySpringCGLIB$$64cb05f3.invoke(<generated>) ~[classes/:na]
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) ~[spring-core-4.3.3.RELEASE.jar:4.3.3.RELEASE]
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:356) ~[spring-context-4.3.3.RELEASE.jar:4.3.3.RELEASE]
at demo.DemoApplication$ConsumerConfiguration$$EnhancerBySpringCGLIB$$845f73e4.consumer(<generated>) ~[classes/:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_60]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_60]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_60]
at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_60]
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE]
... 18 common frames omitted
Any help is highly appreciated. Thanks in advance.
SOLUTION:
The updated and working code can be found here:
https://github.com/magiccrafter/spring-kafka09
See, you have as a dependency:
<dependency>
<groupId>org.springframework.kafka</groupId>
<artifactId>spring-kafka</artifactId>
<version>1.1.0.RELEASE</version>
<scope>compile</scope>
</dependency>
But that one is already for the Apache Kafka-0.10. The Spring Integration Java DSL isn't compatible with that yet.
We are planning to move there after Java DSL 1.2 RELEASE.
So, you have to switch to spring-kafka-1.0.x, or just use spring-integration-kafka-2.1.0.RELEASE directly, bypassing Kafka09 factory!
I ran into a little problem. I try to use a viewScoped managedBean in one of my page. I proced as follow:
My bean location
my bean :
#ManagedBean(name = "diagramManager")
#ViewScoped
public class DiagramManagerManagedBean {
private String toto = "toto";
public String getToto() {
return toto;
}
}
but in my page if i try a #{diagramManager.toto}
i've only got an error 500 'Error 500: Name comp/env/com.asdmt.bean.DiagramManagerManagedBean not found in context "java:".
I had already tried to declare the managedbean in my faceconfig.xml i've got the same error.
I'm on wepshere 6.1 usign JSF2
Full stack trace
[17/02/16 09:50:45:816 CET] 0000002e ServletWrappe E SRVE0068E: Exception non interceptée émise par une des méthodes de service du servlet : Faces Servlet. Exception : javax.servlet.ServletException: Name comp/env/com.asdmt.bean.DiagramManagerManagedBean not found in context "java:".
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:229)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1223)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1158)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:145)
at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:79)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:130)
at usinor.web.A2CSecurityFilter.doFilter(A2CSecurityFilter.java:108)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:130)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:850)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:693)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:656)
at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:535)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3673)
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:269)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:831)
at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1478)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:133)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:457)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:515)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:300)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:271)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:196)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:751)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:881)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1560)
---- Begin backtrace for Nested Throwables
javax.naming.NameNotFoundException: Name comp/env/com.asdmt.bean.DiagramManagerManagedBean not found in context "java:".
at com.ibm.ws.naming.ipbase.NameSpace.getParentCtxInternal(NameSpace.java:1767)
at com.ibm.ws.naming.ipbase.NameSpace.lookupInternal(NameSpace.java:1083)
at com.ibm.ws.naming.ipbase.NameSpace.lookup(NameSpace.java:991)
at com.ibm.ws.naming.urlbase.UrlContextImpl.lookup(UrlContextImpl.java:1263)
at com.ibm.ws.naming.java.javaURLContextImpl.lookup(javaURLContextImpl.java:384)
at com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:205)
at com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:145)
at javax.naming.InitialContext.lookup(InitialContext.java:363)
at org.apache.myfaces.config.annotation.ResourceAnnotationLifecycleProvider.lookupFieldResource(ResourceAnnotationLifecycleProvider.java:189)
at org.apache.myfaces.config.annotation.AllAnnotationLifecycleProvider.checkFieldAnnotation(AllAnnotationLifecycleProvider.java:83)
at org.apache.myfaces.config.annotation.ResourceAnnotationLifecycleProvider.checkAnnotation(ResourceAnnotationLifecycleProvider.java:139)
at org.apache.myfaces.config.annotation.ResourceAnnotationLifecycleProvider.processAnnotations(ResourceAnnotationLifecycleProvider.java:100)
at org.apache.myfaces.config.annotation.NoInjectionAnnotationLifecycleProvider.newInstance(NoInjectionAnnotationLifecycleProvider.java:91)
at org.apache.myfaces.config.ManagedBeanBuilder.buildManagedBean(ManagedBeanBuilder.java:156)
at org.apache.myfaces.el.unified.resolver.ManagedBeanResolver.createManagedBean(ManagedBeanResolver.java:333)
at org.apache.myfaces.el.unified.resolver.ManagedBeanResolver.getValue(ManagedBeanResolver.java:296)
at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:175)
at org.apache.myfaces.el.unified.resolver.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:179)
at com.sun.el.parser.AstIdentifier.getValue(AstIdentifier.java:99)
at com.sun.el.parser.AstValue.getValue(AstValue.java:158)
at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:219)
at org.apache.myfaces.view.facelets.el.ELText$ELTextVariable.writeText(ELText.java:219)
at org.apache.myfaces.view.facelets.el.ELText$ELTextComposite.writeText(ELText.java:131)
at org.apache.myfaces.view.facelets.compiler.TextInstruction.write(TextInstruction.java:45)
at org.apache.myfaces.view.facelets.compiler.UIInstructions.encodeBegin(UIInstructions.java:46)
at org.apache.myfaces.view.facelets.compiler.UILeaf.encodeAll(UILeaf.java:505)
at javax.faces.component.UIComponentBase.encodeAll(UIComponentBase.java:541)
at javax.faces.component.UIComponentBase.encodeAll(UIComponentBase.java:541)
at org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage.renderView(FaceletViewDeclarationLanguage.java:1981)
at org.apache.myfaces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:285)
at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:116)
at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:241)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:199)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1223)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1158)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:145)
at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:79)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:130)
at usinor.web.A2CSecurityFilter.doFilter(A2CSecurityFilter.java:108)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:130)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:850)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:693)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:656)
at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:535)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3673)
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:269)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:831)
at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1478)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:133)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:457)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:515)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:300)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:271)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:196)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:751)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:881)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1560)
[17/02/16 09:50:45:831 CET] 0000002e WebApp E [Servlet Error]-[Faces Servlet]: javax.naming.NameNotFoundException: Name comp/env/com.asdmt.bean.DiagramManagerManagedBean not found in context "java:".
at com.ibm.ws.naming.ipbase.NameSpace.getParentCtxInternal(NameSpace.java:1767)
at com.ibm.ws.naming.ipbase.NameSpace.lookupInternal(NameSpace.java:1083)
at com.ibm.ws.naming.ipbase.NameSpace.lookup(NameSpace.java:991)
at com.ibm.ws.naming.urlbase.UrlContextImpl.lookup(UrlContextImpl.java:1263)
at com.ibm.ws.naming.java.javaURLContextImpl.lookup(javaURLContextImpl.java:384)
at com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:205)
at com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:145)
at javax.naming.InitialContext.lookup(InitialContext.java:363)
at org.apache.myfaces.config.annotation.ResourceAnnotationLifecycleProvider.lookupFieldResource(ResourceAnnotationLifecycleProvider.java:189)
at org.apache.myfaces.config.annotation.AllAnnotationLifecycleProvider.checkFieldAnnotation(AllAnnotationLifecycleProvider.java:83)
at org.apache.myfaces.config.annotation.ResourceAnnotationLifecycleProvider.checkAnnotation(ResourceAnnotationLifecycleProvider.java:139)
at org.apache.myfaces.config.annotation.ResourceAnnotationLifecycleProvider.processAnnotations(ResourceAnnotationLifecycleProvider.java:100)
at org.apache.myfaces.config.annotation.NoInjectionAnnotationLifecycleProvider.newInstance(NoInjectionAnnotationLifecycleProvider.java:91)
at org.apache.myfaces.config.ManagedBeanBuilder.buildManagedBean(ManagedBeanBuilder.java:156)
at org.apache.myfaces.el.unified.resolver.ManagedBeanResolver.createManagedBean(ManagedBeanResolver.java:333)
at org.apache.myfaces.el.unified.resolver.ManagedBeanResolver.getValue(ManagedBeanResolver.java:296)
at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:175)
at org.apache.myfaces.el.unified.resolver.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:179)
at com.sun.el.parser.AstIdentifier.getValue(AstIdentifier.java:99)
at com.sun.el.parser.AstValue.getValue(AstValue.java:158)
at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:219)
at org.apache.myfaces.view.facelets.el.ELText$ELTextVariable.writeText(ELText.java:219)
at org.apache.myfaces.view.facelets.el.ELText$ELTextComposite.writeText(ELText.java:131)
at org.apache.myfaces.view.facelets.compiler.TextInstruction.write(TextInstruction.java:45)
at org.apache.myfaces.view.facelets.compiler.UIInstructions.encodeBegin(UIInstructions.java:46)
at org.apache.myfaces.view.facelets.compiler.UILeaf.encodeAll(UILeaf.java:505)
at javax.faces.component.UIComponentBase.encodeAll(UIComponentBase.java:541)
at javax.faces.component.UIComponentBase.encodeAll(UIComponentBase.java:541)
at org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage.renderView(FaceletViewDeclarationLanguage.java:1981)
at org.apache.myfaces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:285)
at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:116)
at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:241)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:199)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1223)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1158)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:145)
at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:79)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:130)
at usinor.web.A2CSecurityFilter.doFilter(A2CSecurityFilter.java:108)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:130)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:850)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:693)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:656)
at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:535)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3673)
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:269)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:831)
at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1478)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:133)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:457)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:515)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:300)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:271)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:196)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:751)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:881)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1560)
EDIT : as balusc said i was not runing the corect code
I am using injections but I have some problems :
HTTP Status 500 - javax.ejb.EJBException: The bean encountered a non-application exception; nested exception is:
type Exception report
message javax.ejb.EJBException: The bean encountered a non-application exception; nested exception is:
description The server encountered an internal error that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: javax.ejb.EJBException: The bean encountered a non-application exception; nested exception is:
java.lang.NullPointerException
javax.faces.webapp.FacesServlet.service(FacesServlet.java:321)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
root cause
javax.faces.el.EvaluationException: javax.ejb.EJBException: The bean encountered a non-application exception; nested exception is:
java.lang.NullPointerException
javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:98)
com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:98)
javax.faces.component.UICommand.broadcast(UICommand.java:311)
javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:781)
javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1246)
com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:77)
com.sun.faces.lifecycle.Phase.doPhase(Phase.java:97)
com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:114)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:308)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
root cause
javax.ejb.EJBException: The bean encountered a non-application exception; nested exception is:
java.lang.NullPointerException
org.apache.openejb.core.ivm.BaseEjbProxyHandler.convertException(BaseEjbProxyHandler.java:408)
org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:312)
pl.konrad.daoTest.ServiceUzytkownik$$LocalBeanProxy.dodaj(pl/konrad/daoTest/ServiceUzytkownik.java)
pl.konrad.beans.UzytkownikBean.dodajUzytkownika(UzytkownikBean.java:84)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
org.apache.el.parser.AstValue.invoke(AstValue.java:278)
org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:273)
com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:102)
javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:84)
com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:98)
javax.faces.component.UICommand.broadcast(UICommand.java:311)
javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:781)
javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1246)
com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:77)
com.sun.faces.lifecycle.Phase.doPhase(Phase.java:97)
com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:114)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:308)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
root cause
java.lang.NullPointerException
pl.konrad.daoTest.ServiceUzytkownik.dodaj(ServiceUzytkownik.java:17)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:192)
org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:173)
org.apache.openejb.monitoring.StatsInterceptor.record(StatsInterceptor.java:181)
org.apache.openejb.monitoring.StatsInterceptor.invoke(StatsInterceptor.java:100)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:192)
org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:173)
org.apache.openejb.core.interceptor.InterceptorStack.invoke(InterceptorStack.java:85)
org.apache.openejb.core.stateless.StatelessContainer._invoke(StatelessContainer.java:227)
org.apache.openejb.core.stateless.StatelessContainer.invoke(StatelessContainer.java:194)
org.apache.openejb.core.ivm.EjbObjectProxyHandler.synchronizedBusinessMethod(EjbObjectProxyHandler.java:308)
org.apache.openejb.core.ivm.EjbObjectProxyHandler.businessMethod(EjbObjectProxyHandler.java:303)
org.apache.openejb.core.ivm.EjbObjectProxyHandler._invoke(EjbObjectProxyHandler.java:92)
org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:308)
pl.konrad.daoTest.ServiceUzytkownik$$LocalBeanProxy.dodaj(pl/konrad/daoTest/ServiceUzytkownik.java)
pl.konrad.beans.UzytkownikBean.dodajUzytkownika(UzytkownikBean.java:84)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
org.apache.el.parser.AstValue.invoke(AstValue.java:278)
org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:273)
com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:102)
javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:84)
com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:98)
javax.faces.component.UICommand.broadcast(UICommand.java:311)
javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:781)
javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1246)
com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:77)
com.sun.faces.lifecycle.Phase.doPhase(Phase.java:97)
com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:114)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:308)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
note The full stack trace of the root cause is available in the Apache Tomcat (TomEE)/7.0.55 (1.7.1) logs.
And this is my Bean :
#ManagedBean(name = "uzytkownikBean")
#ViewScoped
public class UzytkownikBean implements Serializable {
private static final long serialVersionUID = 1L;
private Uzytkownik uzytkownik;
private DataModel<Uzytkownik> modelUzytkownicy;
#EJB
private ServiceUzytkownik serviceUzytkownik;
public Uzytkownik getUzytkownik() {
return uzytkownik;
}
public void setUzytkownik(Uzytkownik uzytkownik) {
this.uzytkownik = uzytkownik;
}
public DataModel<Uzytkownik> getModelUzytkownicy() {
return modelUzytkownicy;
}
public void setModelUzytkownicy(ArrayDataModel<Uzytkownik> modelUzytkownicy) {
this.modelUzytkownicy = modelUzytkownicy;
}
#PostConstruct
public void init() {
uzytkownik = new Uzytkownik();
}
public void dodajUzytkownika() {
serviceUzytkownik.dodaj(uzytkownik);
}
}
And my EJB class :
#Stateless
public class ServiceUzytkownik {
#PersistenceContext
private EntityManager em;
public void dodaj(Uzytkownik uzytkownik) {
em.persist(uzytkownik);
}
}
Whats wrong now? and if I should add it to persistence.xml. This is my config for Hibernate. When creating a dynamic web project, would add connection so maybe it is unnecessary. But for now, I have to get rid of this error. Error connecting to the database probably looks different.
<properties>
<property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver" />
<property name="javax.persistence.jdbc.user" value="konrad" />
<property name="javax.persistence.jdbc.password" value="konrad" />
<property name="javax.persistence.jdbc.url"
value="jdbc:mysql://localhost:3306/bazahealthhelper" />
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5Dialect" />
<property name="hibernate.hbm2ddl.auto" value="create" />
</properties>
log cat
01-16 20:29:48.904: D/dalvikvm(1008): GC_FOR_ALLOC freed 37K, 7% free 2585K/2768K, paused 110ms, total 113ms
01-16 20:29:48.944: D/AndroidRuntime(1008): Shutting down VM
01-16 20:29:48.944: W/dalvikvm(1008): threadid=1: thread exiting with uncaught exception (group=0x40a71930)
01-16 20:29:48.984: E/AndroidRuntime(1008): FATAL EXCEPTION: main
01-16 20:29:48.984: E/AndroidRuntime(1008): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.cuet.teachersroom/com.cuet.teachersroom.Teachers_Room}: android.view.InflateException: Binary XML file line #20: Error inflating class <unknown>
01-16 20:29:48.984: E/AndroidRuntime(1008): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180)
01-16 20:29:48.984: E/AndroidRuntime(1008): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
01-16 20:29:48.984: E/AndroidRuntime(1008): at android.app.ActivityThread.access$600(ActivityThread.java:141)
01-16 20:29:48.984: E/AndroidRuntime(1008): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
01-16 20:29:48.984: E/AndroidRuntime(1008): at android.os.Handler.dispatchMessage(Handler.java:99)
01-16 20:29:48.984: E/AndroidRuntime(1008): at android.os.Looper.loop(Looper.java:137)
01-16 20:29:48.984: E/AndroidRuntime(1008): at android.app.ActivityThread.main(ActivityThread.java:5041)
01-16 20:29:48.984: E/AndroidRuntime(1008): at java.lang.reflect.Method.invokeNative(Native Method)
01-16 20:29:48.984: E/AndroidRuntime(1008): at java.lang.reflect.Method.invoke(Method.java:511)
01-16 20:29:48.984: E/AndroidRuntime(1008): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
01-16 20:29:48.984: E/AndroidRuntime(1008): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
01-16 20:29:48.984: E/AndroidRuntime(1008): at dalvik.system.NativeStart.main(Native Method)
01-16 20:29:48.984: E/AndroidRuntime(1008): Caused by: android.view.InflateException: Binary XML file line #20: Error inflating class <unknown>
01-16 20:29:48.984: E/AndroidRuntime(1008): at android.view.LayoutInflater.createView(LayoutInflater.java:613)
01-16 20:29:48.984: E/AndroidRuntime(1008): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
01-16 20:29:48.984: E/AndroidRuntime(1008): at android.view.LayoutInflater.onCreateView(LayoutInflater.java:660)
01-16 20:29:48.984: E/AndroidRuntime(1008): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:685)
01-16 20:29:48.984: E/AndroidRuntime(1008): at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
01-16 20:29:48.984: E/AndroidRuntime(1008): at android.view.LayoutInflater.rInflate(LayoutInflater.java:749)
01-16 20:29:48.984: E/AndroidRuntime(1008): at android.view.LayoutInflater.rInflate(LayoutInflater.java:749)
01-16 20:29:48.984: E/AndroidRuntime(1008): at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
01-16 20:29:48.984: E/AndroidRuntime(1008): at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
01-16 20:29:48.984: E/AndroidRuntime(1008): at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
01-16 20:29:48.984: E/AndroidRuntime(1008): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:270)
01-16 20:29:48.984: E/AndroidRuntime(1008): at android.app.Activity.setContentView(Activity.java:1881)
01-16 20:29:48.984: E/AndroidRuntime(1008): at com.cuet.teachersroom.Teachers_Room.onCreate(Teachers_Room.java:38)
01-16 20:29:48.984: E/AndroidRuntime(1008): at android.app.Activity.performCreate(Activity.java:5104)
01-16 20:29:48.984: E/AndroidRuntime(1008): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
01-16 20:29:48.984: E/AndroidRuntime(1008): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
01-16 20:29:48.984: E/AndroidRuntime(1008): ... 11 more
01-16 20:29:48.984: E/AndroidRuntime(1008): Caused by: java.lang.reflect.InvocationTargetException
01-16 20:29:48.984: E/AndroidRuntime(1008): at java.lang.reflect.Constructor.constructNative(Native Method)
01-16 20:29:48.984: E/AndroidRuntime(1008): at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
01-16 20:29:48.984: E/AndroidRuntime(1008): at android.view.LayoutInflater.createView(LayoutInflater.java:587)
01-16 20:29:48.984: E/AndroidRuntime(1008): ... 26 more
01-16 20:29:48.984: E/AndroidRuntime(1008): Caused by: android.content.res.Resources$NotFoundException: File res/drawable-mdpi/white.png from drawable resource ID #0x7f020005: .xml extension required
01-16 20:29:48.984: E/AndroidRuntime(1008): at android.content.res.Resources.loadColorStateList(Resources.java:2094)
01-16 20:29:48.984: E/AndroidRuntime(1008): at android.content.res.TypedArray.getColorStateList(TypedArray.java:342)
01-16 20:29:48.984: E/AndroidRuntime(1008): at android.widget.TextView.<init>(TextView.java:904)
01-16 20:29:48.984: E/AndroidRuntime(1008): at android.widget.TextView.<init>(TextView.java:578)
01-16 20:29:48.984: E/AndroidRuntime(1008): ... 29 more
01-16 20:29:49.166: D/dalvikvm(1008): GC_CONCURRENT freed 508K, 21% free 2500K/3152K, paused 12ms+7ms, total 166ms
Your error log shows that there was an unknown error in inflating one of your classes.
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.cuet.teachersroom/com.cuet.teachersroom.Teachers_Room}: android.view.InflateException: Binary XML file line #20: Error inflating class <unknown>
So we'd really need to take a look at the associated xml file that com.cuet.teachersroom.Teachers_Room is calling to see what's going on.