Menu

#68 NPE in OneJarFile.getInputStream()

open
nobody
5
2012-06-04
2012-06-04
Anonymous
No

Hello,
i have this error when i run my one-jar application:

S:\Projekte\aquarium-manager>java -jar S:\Projekte\aquarium-manager\parent\target\aquarium-manager-parent-0.1-SNAPSHOT.one-jar.jar
JarClassLoader: Warning: Null manifest from input stream associated with: lib/aspectjrt-1.6.12.jar
JarClassLoader: Warning: Null manifest from input stream associated with: lib/javax.inject-1.jar
08:25:56.714 [pool-2-thread-1] ERROR d.b.a.gui.task.TaskPersistenceInitialisierung - Die Verbindung zur Datenbank konnte nicht hergestellt werden.
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'liquibase' defined in class de.bigmichi1.aquariummanager.configuration.LiquibaseConfiguration: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public liquibase.Liquibase de.bigmichi1.aquariummanager.configuration.LiquibaseConfiguration.liquibase() throws de.bigmichi1.aquariummanager.exceptions.AquariumManagerException] threw exception; nested exception is java.lang.ExceptionInInitializerError
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:581) ~[spring-beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1015) ~[spring-beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:911) ~[spring-beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485) ~[spring-beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) ~[spring-beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294) ~[spring-beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225) ~[spring-beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291) ~[spring-beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) ~[spring-beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585) ~[spring-beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913) ~[spring-context-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464) ~[spring-context-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at de.bigmichi1.aquariummanager.gui.task.TaskPersistenceInitialisierung.doInBackground(TaskPersistenceInitialisierung.java:89) [aquarium-manager-gui-0.1-SNAPSHOT.jar:na]
at de.bigmichi1.aquariummanager.gui.task.TaskPersistenceInitialisierung.doInBackground(TaskPersistenceInitialisierung.java:49) [aquarium-manager-gui-0.1-SNAPSHOT.jar:na]
at javax.swing.SwingWorker$1.call(Unknown Source) [na:1.6.0_31]
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) [na:1.6.0_31]
at java.util.concurrent.FutureTask.run(Unknown Source) [na:1.6.0_31]
at javax.swing.SwingWorker.run(Unknown Source) [na:1.6.0_31]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) [na:1.6.0_31]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [na:1.6.0_31]
at java.lang.Thread.run(Unknown Source) [na:1.6.0_31]
Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public liquibase.Liquibase de.bigmichi1.aquariummanager.configuration.LiquibaseConfiguration.liquibase() throws de.bigmichi1.aquariummanager.exceptions.AquariumManagerException] threw exception; nested exception is java.lang.ExceptionInInitializerError
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:169) ~[spring-beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:570) ~[spring-beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
... 20 common frames omitted
Caused by: java.lang.ExceptionInInitializerError: null
at de.bigmichi1.aquariummanager.configuration.LiquibaseConfiguration.liquibase(LiquibaseConfiguration.java:79) ~[aquarium-manager-persistence-0.1-SNAPSHOT.jar:na]
at de.bigmichi1.aquariummanager.configuration.LiquibaseConfiguration$$EnhancerByCGLIB$$cee3ffca.CGLIB$liquibase$0(<generated>) ~[cglib-2.2.2.jar:na]
at de.bigmichi1.aquariummanager.configuration.LiquibaseConfiguration$$EnhancerByCGLIB$$cee3ffca$$FastClassByCGLIB$$687fb0a1.invoke(<generated>) ~[cglib-2.2.2.jar:na]
at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) ~[cglib-2.2.2.jar:na]
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:280) ~[spring-context-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at de.bigmichi1.aquariummanager.configuration.LiquibaseConfiguration$$EnhancerByCGLIB$$cee3ffca.liquibase(<generated>) ~[cglib-2.2.2.jar:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.6.0_31]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.6.0_31]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.6.0_31]
at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.6.0_31]
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:149) ~[spring-beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
... 21 common frames omitted
Caused by: java.lang.NullPointerException: null
at com.simontuffs.onejar.OneJarFile.getInputStream(OneJarFile.java:116) ~[aquarium-manager-parent-0.1-SNAPSHOT.one-jar.jar:na]
at com.simontuffs.onejar.OneJarURLConnection.getInputStream(OneJarURLConnection.java:51) ~[aquarium-manager-parent-0.1-SNAPSHOT.one-jar.jar:na]
at java.net.URL.openStream(Unknown Source) ~[na:1.6.0_31]
at liquibase.servicelocator.ServiceLocator.setResourceAccessor(ServiceLocator.java:94) ~[liquibase-core-2.0.5.jar:na]
at liquibase.servicelocator.ServiceLocator.<init>(ServiceLocator.java:40) ~[liquibase-core-2.0.5.jar:na]
at liquibase.servicelocator.ServiceLocator.<clinit>(ServiceLocator.java:27) ~[liquibase-core-2.0.5.jar:na]
... 32 common frames omitted

S:\Projekte\aquarium-manager>

if you need the sourcecode, you can checkout http://code.google.com/p/aquarium-manager/
from my point of view i think the error has something to do with the two warnings when the application is startet about the missing manifest
can you please give me some hints how to fix these npe?

Discussion


Log in to post a comment.