I am quite new to spring mvc. I got this error the first time i ran my maven web project on window via spring-tool-suite for eclipse after configuring the webMVC project.
COMPILLER CONSOLE:
Exception in thread "main" java.lang.NullPointerException at
org.springframework.core.BridgeMethodResolver.findBridgedMethod(BridgeMethodResolver.java:64)
at
org.springframework.beans.GenericTypeAwarePropertyDescriptor.(GenericTypeAwarePropertyDescriptor.java:70)
at
org.springframework.beans.CachedIntrospectionResults.buildGenericTypeAwarePropertyDescriptor(CachedIntrospectionResults.java:366)
at
org.springframework.beans.CachedIntrospectionResults.(CachedIntrospectionResults.java:302)
at
org.springframework.beans.CachedIntrospectionResults.forClass(CachedIntrospectionResults.java:189)
at
org.springframework.beans.BeanUtils.getPropertyDescriptors(BeanUtils.java:354)
at
org.springframework.boot.bind.PropertiesConfigurationFactory.getNames(PropertiesConfigurationFactory.java:300)
at
org.springframework.boot.bind.PropertiesConfigurationFactory.doBindPropertiesToTarget(PropertiesConfigurationFactory.java:283)
at
org.springframework.boot.bind.PropertiesConfigurationFactory.bindPropertiesToTarget(PropertiesConfigurationFactory.java:256)
at
org.springframework.boot.context.config.ConfigFileApplicationListener.bindToSpringApplication(ConfigFileApplicationListener.java:232)
at
org.springframework.boot.context.config.ConfigFileApplicationListener.postProcessEnvironment(ConfigFileApplicationListener.java:183)
at
org.springframework.boot.context.config.ConfigFileApplicationListener.onApplicationEnvironmentPreparedEvent(ConfigFileApplicationListener.java:168)
at
org.springframework.boot.context.config.ConfigFileApplicationListener.onApplicationEvent(ConfigFileApplicationListener.java:154)
at
org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:166)
at
org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:138)
at
org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:121)
at
org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:68)
at
org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:54)
at
org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:337)
at
org.springframework.boot.SpringApplication.run(SpringApplication.java:308)
at
org.springframework.boot.SpringApplication.run(SpringApplication.java:1186)
at
org.springframework.boot.SpringApplication.run(SpringApplication.java:1175)
at com.nnokox.Application.main(Application.java:25)
Related
I want to build an app with Ionic V3 for Android but I have an issue when I build it on release.
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:mergeDebugResources'.
java.lang.NoClassDefFoundError: Could not initialize class sun.security.ssl.SSLContextImpl$TLSContext
Exception in thread "Build Event Notification" java.lang.NoClassDefFoundError: Could not initialize class sun.security.ssl.SSLContextImpl$TLSContext
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at java.security.Provider$Service.getImplClass(Provider.java:1728)
at java.security.Provider$Service.newInstance(Provider.java:1686)
at sun.security.jca.GetInstance.getInstance(GetInstance.java:236)
at sun.security.jca.GetInstance.getInstance(GetInstance.java:164)
at javax.net.ssl.SSLContext.getInstance(SSLContext.java:156)
at com.crashlytics.reloc.org.apache.http.ssl.SSLContexts.createDefault(SSLContexts.java:51)
at com.crashlytics.reloc.org.apache.http.impl.client.HttpClientBuilder.build(HttpClientBuilder.java:966)
at com.crashlytics.reloc.org.apache.http.impl.client.HttpClients.createDefault(HttpClients.java:56)
at com.crashlytics.api.net.proxy.ProxySettings.getClientFor(ProxySettings.java:56)
at com.crashlytics.api.RestfulWebApi.notifyBuildEvent(RestfulWebApi.java:1438)
at com.crashlytics.api.RestfulWebApi.access$100(RestfulWebApi.java:74)
at com.crashlytics.api.RestfulWebApi$10.run(RestfulWebApi.java:1371)
at java.lang.Thread.run(Thread.java:748)
It seems to be caused by Crashlytics (which I don't even use) which is integrated within this package https://github.com/dpa99c/cordova-plugin-firebasex.
When I build the app in debug mode, I still have the exception but the build proceed until the end and I still can run it on my phone.
How can I prevent this issue ? Is there anyway to disable entirely Crashlytics so I don't have this exception anymore ?
Thanks
Ok, so it was all because of the JDK version. I ended up updating the JDK and everything worked perfectly.
I have a problem to deploy EJB and WAR modules at the same time in NetBeans 8.2 on GlassFish 4.1.1. The following message is shown:
[[ Exception Occurred :Error occurred during deployment: Exception while preparing the app : Could not resolve a persistence unit corresponding to the persistence-context-ref-name [ejb.NewMessage/em] in the scope of the module called [TestEJB-ejb]. Please verify your application.. Please see server.log for more details.]]
When I checked server.log file of GlassFish server, I faced with the following erreor message:
[2018-07-28T12:59:45.406+0430] [glassfish 4.1] [SEVERE] [] [javax.enterprise.system.core] [tid: _ThreadID=427 _ThreadName=admin-listener(7)] [timeMillis: 1532766585406] [levelValue: 1000] [[
Exception while preparing the app : Could not resolve a persistence unit corresponding to the persistence-context-ref-name [ejb.NewEntityFacade/em] in the scope of the module called [TestEJB-ejb]. Please verify your application.]]
Is there any solution for that?
Thanks for your help.
If you did not start to create your app or if you did not choose your programming framework, you can switch to Java Spring with less headache!
Read the first paragraph of the following link:
https://en.wikipedia.org/wiki/Spring_Framework
My Project build in Intellij with maven and compiles fine and deployed in tomcat nothing problem in local system (window)
But after deployed war file in linux system. I tried to access method that throws, exception class not found.
exception
org.springframework.web.util.NestedServletException: Handler processing failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class net.sf.uadetector.service.UADetectorServiceFactory
root cause
java.lang.NoClassDefFoundError: Could not initialize class net.sf.uadetector.service.UADetectorServiceFactory
I can see there are libraries in WAR excluded directory in linux (where I deployed)
My Code
UserAgentStringParser parser = UADetectorServiceFactory.getResourceModuleParser();
ReadableUserAgent agent = parser.parse(httpServletRequest.getHeader("User-Agent"));
What might be the problem please say some solution
I am trying to build a sample spring MVC app using Maven and getting deployed in JBoss 7 application server.
While trying to build using maven, it builds fine without error. However while trying to deploy using JBoss 7, I am getting this following error.
Kindly help to give ideas what might be the cause of this error.
13:48:36,408 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC00001: Failed to start service jboss.deployment.unit."firstSpring-1.0-SNAPSHOT.war".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."firstSpring-1.0-SNAPSHOT.war".POST_MODULE: Failed to process phase POST_MODULE of deployment "firstSpring-1.0-SNAPSHOT.war"
Caused by: java.lang.RuntimeException: Error getting reflective information for class org.springframework.web.servlet.tags.EvalTag with ClassLoader ModuleClassLoader for Module "deployment.firstSpring-1.0-SNAPSHOT.war:main" from Service Module Loader
Caused by: java.lang.NoClassDefFoundError: org/springframework/expression/PropertyAccessor
Caused by: java.lang.ClassNotFoundException: org.springframework.expression.PropertyAccessor from [Module "deployment.firstSpring-1.0-SNAPSHOT.war:main" from Service Module Loader]
I used to be able to run my standalone java app that calls EJB and MQ using JNDI on RAD 7.5.5. I upgraded to RAD 8.5 and when I tried to run it, I received the error Failed to create InitialContext using factory specified in hashtable. I'm also using the same WAS 7.0.0.9 for both RAD version so I'm not sure why it's not working now.
Is there anything special that I need to do in RAD 8.5?
This is my bootstrap classpath entries: WAS v7.0 JRE, %WAS_RUNTIME%\com.ibm.ws.ejb.thinclient_7.0.0.jar, WAS v7.0 lib.
Below are the lines where I set up the environment (the second line seems to be needed for RAD 8.5):
System.setProperty(Context.PROVIDER_URL, "iiop://localhost:2809");
System.setProperty("com.ibm.ws.naming.wsn.factory.initial", "com.ibm.websphere.naming.WsnInitialContextFactory");
Below is the stack trace from my code:
2012-11-30 16:50:14,945 main FATAL ram.hs.edi.EDIDaemon(line 183) - Unable to get running status: javax.naming.NoInitialContextException: Failed to create InitialContext using factory specified in hashtable. Root exception is java.lang.NullPointerException
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:243)
at javax.naming.InitialContext.initializeDefaultInitCtx(InitialContext.java:327)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:357)
at javax.naming.InitialContext.internalInit(InitialContext.java:295)
at javax.naming.InitialContext.<init>(InitialContext.java:212)
at ram.hs.edi.utils.MQReader.open(MQReader.java:85)
at ram.hs.edi.EDIDaemon.isRunning(EDIDaemon.java:406)
at ram.hs.edi.EDIDaemon.run(EDIDaemon.java:168)
at ram.hs.edi.EDIDaemon.main(EDIDaemon.java:898)
Caused by: java.lang.NullPointerException
at com.ibm.ws.naming.util.CommonHelpers$2.run(CommonHelpers.java:268)
at com.ibm.ws.naming.util.CommonHelpers$2.run(CommonHelpers.java:264)
at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:63)
at com.ibm.ws.naming.util.CommonHelpers.mergeJndiProviderProperties(CommonHelpers.java:263)
at com.ibm.ws.naming.util.CommonHelpers.mergeWsnJndiProperties(CommonHelpers.java:159)
at com.ibm.websphere.naming.WsnInitialContextFactory.getInitialContext(WsnInitialContextFactory.java:186)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:235)
... 8 more
Thanks
This may be little late answering it but please try to do the following:
1) Add the jar "com.ibm.ws.orb_7.0.0.jar" or equivalent jar on the Bootstrap path of your standalone Java Class.
2) Add the jar "com.ibm.ws.webservices.thinclient_7.0.0" or equivalent jar on the JVM Class path.
After doing the above I was able to get the InitalContext successfully. Hope this helps.