error inflating class fragment Google Maps v2 - android-fragments

I've spent 24 hours trying to deploy a simple google maps v2 android apps. I've searched in a lot of forums (included stackoverflow)... but I'm desperated.
The error is:
android.view.InflateException: Binary XML file line #7: Error inflating class fragment
Here is the activity_main.xml
<?xml version="1.0" encoding="utf-8" ?>
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/map" android:layout_width="match_parent"
android:layout_height="match_parent"
class="com.google.android.gms.maps.SupportMapFragment" />
MainActivity.java
package com.gotme.gotmemaps;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.view.Menu;
public class MainActivity extends FragmentActivity {
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
#Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
}
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.gotme.gotmemaps"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="19" />
<permission
android:name="com.gotme.gotmemaps.permission.MAPS_RECEIVE"
android:protectionLevel="signature"/>
<uses-permission
android:name="com.gotme.gotmemaps.permission.MAPS_RECEIVE"/>
<uses-permission
android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.gotme.gotmemaps.MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyDHfwlSoRWb6xDrpowyMWWap9Du5LQCVRM"/>
</application>
</manifest>
I have installed the library *google_play_services_lib* but always get the same error...
Could somebody help me?
Thanks a lot!
UPDATE:
Here is my logcat:
11-19 12:25:23.745: E/AndroidRuntime(7163): FATAL EXCEPTION: main
11-19 12:25:23.745: E/AndroidRuntime(7163): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.gotme.gotmemaps/com.gotme.gotmemaps.MainActivity}: android.view.InflateException: Binary XML file line #7: Error inflating class fragment
11-19 12:25:23.745: E/AndroidRuntime(7163): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2100)
11-19 12:25:23.745: E/AndroidRuntime(7163): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2125)
11-19 12:25:23.745: E/AndroidRuntime(7163): at android.app.ActivityThread.access$600(ActivityThread.java:140)
11-19 12:25:23.745: E/AndroidRuntime(7163): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1227)
11-19 12:25:23.745: E/AndroidRuntime(7163): at android.os.Handler.dispatchMessage(Handler.java:99)
11-19 12:25:23.745: E/AndroidRuntime(7163): at android.os.Looper.loop(Looper.java:137)
11-19 12:25:23.745: E/AndroidRuntime(7163): at android.app.ActivityThread.main(ActivityThread.java:4898)
11-19 12:25:23.745: E/AndroidRuntime(7163): at java.lang.reflect.Method.invokeNative(Native Method)
11-19 12:25:23.745: E/AndroidRuntime(7163): at java.lang.reflect.Method.invoke(Method.java:511)
11-19 12:25:23.745: E/AndroidRuntime(7163): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1006)
11-19 12:25:23.745: E/AndroidRuntime(7163): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:773)
11-19 12:25:23.745: E/AndroidRuntime(7163): at dalvik.system.NativeStart.main(Native Method)
11-19 12:25:23.745: E/AndroidRuntime(7163): Caused by: android.view.InflateException: Binary XML file line #7: Error inflating class fragment
11-19 12:25:23.745: E/AndroidRuntime(7163): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
11-19 12:25:23.745: E/AndroidRuntime(7163): at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
11-19 12:25:23.745: E/AndroidRuntime(7163): at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
11-19 12:25:23.745: E/AndroidRuntime(7163): at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
11-19 12:25:23.745: E/AndroidRuntime(7163): at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
11-19 12:25:23.745: E/AndroidRuntime(7163): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:308)
11-19 12:25:23.745: E/AndroidRuntime(7163): at android.app.Activity.setContentView(Activity.java:1924)
11-19 12:25:23.745: E/AndroidRuntime(7163): at com.gotme.gotmemaps.MainActivity.onCreate(MainActivity.java:16)
11-19 12:25:23.745: E/AndroidRuntime(7163): at android.app.Activity.performCreate(Activity.java:5206)
11-19 12:25:23.745: E/AndroidRuntime(7163): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1083)
11-19 12:25:23.745: E/AndroidRuntime(7163): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2064)
11-19 12:25:23.745: E/AndroidRuntime(7163): ... 11 more
11-19 12:25:23.745: E/AndroidRuntime(7163): Caused by: java.lang.IllegalStateException: The meta-data tag in your app's AndroidManifest.xml does not have the right value. Expected 4030500 but found 0. You must have the following declaration within the <application> element: <meta-data android:name="com.google.android.gms.version" android:value="#integer/google_play_services_version" />
11-19 12:25:23.745: E/AndroidRuntime(7163): at com.google.android.gms.common.GooglePlayServicesUtil.n(Unknown Source)
11-19 12:25:23.745: E/AndroidRuntime(7163): at com.google.android.gms.common.GooglePlayServicesUtil.isGooglePlayServicesAvailable(Unknown Source)
11-19 12:25:23.745: E/AndroidRuntime(7163): at com.google.android.gms.maps.internal.q.v(Unknown Source)
11-19 12:25:23.745: E/AndroidRuntime(7163): at com.google.android.gms.maps.internal.q.u(Unknown Source)
11-19 12:25:23.745: E/AndroidRuntime(7163): at com.google.android.gms.maps.MapsInitializer.initialize(Unknown Source)
11-19 12:25:23.745: E/AndroidRuntime(7163): at com.google.android.gms.maps.SupportMapFragment$b.cE(Unknown Source)
11-19 12:25:23.745: E/AndroidRuntime(7163): at com.google.android.gms.maps.SupportMapFragment$b.a(Unknown Source)
11-19 12:25:23.745: E/AndroidRuntime(7163): at com.google.android.gms.dynamic.a.a(Unknown Source)
11-19 12:25:23.745: E/AndroidRuntime(7163): at com.google.android.gms.dynamic.a.onInflate(Unknown Source)
11-19 12:25:23.745: E/AndroidRuntime(7163): at com.google.android.gms.maps.SupportMapFragment.onInflate(Unknown Source)
11-19 12:25:23.745: E/AndroidRuntime(7163): at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:290)
11-19 12:25:23.745: E/AndroidRuntime(7163): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:676)
11-19 12:25:23.745: E/AndroidRuntime(7163): ... 21 more

Assuming you have got the correct jars..etc.
Your xml seems fine.
here is what you can try doing.
public class MainActivity extends android.support.v4.app.FragmentActivity {
private GoogleMap mMap;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// Try to obtain the map from the SupportMapFragment.
mMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map))
.getMap();
if (mMap== null)
{
Toast.makeText(this,"Google Maps not Available",
Toast.LENGTH_LONG).show();
}
}
Now, why this..
You have chosen min sdk as 8. FragmentActivity works only for API 11+, to make it compatible for below versions also, you need to extend it the way I have done.
Also, in your OnCreate I see absolutely nothing, there is no map instance created by you.
What are you expecting to show on the screen?

try to add
<meta-data android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
into AndroidManifest.xml
It works for me!

Related

(Android) Xamarin Forms shell app crash after latest Xamarin update

So I have a Xamarin Forms Shell App, with Shellcontents set as like this:
<Shell etc etc>
<ShellContent ContentTemplate="Temp1" Route="routeA" Title="titleA" />
<ShellContent ContentTemplate="Temp2" Route="routeB" Title="titleB" />
<MenuItem Text="{x:Static rx:AppResources.Logout}" Command="{Binding LogoutCommand}"/>
</Shell>
When launched, ShellContent A shows up all good. But the moment I touch titleB, I get this stupid error.
I have not been able to figure it out, where is this error coming from. Any ideas where should I look?
No package ID ff found for ID 0xffffffff.
[AndroidRuntime] Shutting down VM
[AndroidRuntime] FATAL EXCEPTION: main
[AndroidRuntime] android.content.res.Resources$NotFoundException: Unable to find resource ID #0xffffffff
[AndroidRuntime] at android.content.res.ResourcesImpl.getResourceTypeName(ResourcesImpl.java:334)
[AndroidRuntime] at android.content.res.Resources.getResourceTypeName(Resources.java:2300)
[AndroidRuntime] at androidx.fragment.app.FragmentAnim.loadAnimation(FragmentAnim.java:79)
[AndroidRuntime] at androidx.fragment.app.DefaultSpecialEffectsController$AnimationInfo.getAnimation(DefaultSpecialEffectsController.java:774)
[AndroidRuntime] at androidx.fragment.app.DefaultSpecialEffectsController.startAnimations(DefaultSpecialEffectsController.java:144)
[AndroidRuntime] at androidx.fragment.app.DefaultSpecialEffectsController.executeOperations(DefaultSpecialEffectsController.java:120)
[AndroidRuntime] at androidx.fragment.app.SpecialEffectsController.executePendingOperations(SpecialEffectsController.java:294)
[AndroidRuntime] at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:2190)
[AndroidRuntime] at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:2088)
[AndroidRuntime] at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:1990)
[AndroidRuntime] at androidx.fragment.app.FragmentManager$5.run(FragmentManager.java:524)
[AndroidRuntime] at android.os.Handler.handleCallback(Handler.java:938)
[AndroidRuntime] at androidx.fragment.app.DefaultSpecialEffectsController.startAnimations(DefaultSpecialEffectsControlleer.dispatchMessage(Handler.java:99)
[AndroidRuntime] at android.os.Looper.loop(Looper.java:246)
[AndroidRuntime] at android.app.ActivityThread.main(ActivityThread.java:8430)
[AndroidRuntime] at java.lang.reflect.Method.invoke(Native Method)
[AndroidRuntime] at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:596)
[AndroidRuntime] at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)
I do not have the Temp1 and Temp2. I create a Shell tenplate to test. It works on myside. You could check the code below.
Xaml:
<ShellContent
Title="titleA"
ContentTemplate="{DataTemplate local:ItemsPage}"
Route="routeA" />
<ShellContent
Title="titleB"
ContentTemplate="{DataTemplate local:AboutPage}"
Route="routeB" />
<MenuItem Command="{Binding LogoutCommand}" Text="Page1" />
Code hebind:
public partial class AppShell : Xamarin.Forms.Shell
{
public ICommand LogoutCommand => new Command(async () => await Shell.Current.GoToAsync("page1"));
public AppShell()
{
InitializeComponent();
Routing.RegisterRoute("page1", typeof(Page1));
this.BindingContext = this;
}
}
I was able to correct this bug when I downgraded Xamarin.Google.Android.Material to v1.2.1.1 following a tip from here:
https://github.com/xamarin/Xamarin.Forms/issues/13843

Creating UWP app package results in errors

When I attempt to create a release UWP package for side loading I get the following error :-
1>C:\Program Files
(x86)\MSBuild\Microsoft.NetNative\x64\ilc\IlcInternals.targets(936,5):
error : System.NullReferenceException: Object reference not set to an
instance of an object. 1>C:\Program Files
(x86)\MSBuild\Microsoft.NetNative\x64\ilc\IlcInternals.targets(936,5):
error : at
System.Xml.Serialization.XmlSerializationWriterCodeGen.FindXmlnsIndex(MemberMapping[]
members) 1>C:\Program Files
(x86)\MSBuild\Microsoft.NetNative\x64\ilc\IlcInternals.targets(936,5):
error : at
System.Xml.Serialization.XmlSerializationWriterCodeGen.WriteStructMethod(StructMapping
mapping) 1>C:\Program Files
(x86)\MSBuild\Microsoft.NetNative\x64\ilc\IlcInternals.targets(936,5):
error : at
System.Xml.Serialization.XmlSerializationWriterCodeGen.GenerateMethod(TypeMapping
mapping) 1>C:\Program Files
(x86)\MSBuild\Microsoft.NetNative\x64\ilc\IlcInternals.targets(936,5):
error : at
System.Xml.Serialization.XmlSerializationCodeGen.GenerateReferencedMethods()
1>C:\Program Files
(x86)\MSBuild\Microsoft.NetNative\x64\ilc\IlcInternals.targets(936,5):
error : at
System.Xml.Serialization.XmlSerializationWriterCodeGen.GenerateEnd()
1>C:\Program Files
(x86)\MSBuild\Microsoft.NetNative\x64\ilc\IlcInternals.targets(936,5):
error : at
System.Xml.Serialization.TempAssembly.GenerateAssembly(XmlMapping[]
xmlMappings, Type[] types, String defaultNamespace, Evidence evidence,
XmlSerializerCompilerParameters parameters, Hashtable assemblies,
String outputDir, IEnumerable1 referenceDirectories, String
intermediateDir, Boolean loadAssembly) 1>C:\Program Files
(x86)\MSBuild\Microsoft\.NetNative\x64\ilc\IlcInternals.targets(936,5):
error : at
System.Xml.Serialization.XmlSerializer.GenerateSerializer(Type[]
types, XmlMapping[] mappings, CompilerParameters parameters, String
outputDir, IEnumerable1 referenceDirectories, String intermediateDir,
Boolean loadAssembly) 1>C:\Program Files
(x86)\MSBuild\Microsoft.NetNative\x64\ilc\IlcInternals.targets(936,5):
error : at
System.Xml.Serialization.XmlSerializer.GenerateSerializer(Type[]
types, String outputDir, IEnumerable1 referenceDirectories, String
intermediateDir, List1 wcfSerializers, Boolean loadAssembly)
1>C:\Program Files
(x86)\MSBuild\Microsoft.NetNative\x64\ilc\IlcInternals.targets(936,5):
error : at SerializationAssemblyGenerator.Program.Main(String[]
args) 1>C:\Program Files
(x86)\MSBuild\Microsoft.NetNative\x64\ilc\IlcInternals.targets(936,5):
error : Internal compiler error: One or more errors occurred.
My .appxmanifest file looks like:
<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" IgnorableNamespaces="uap mp">
<Identity Name="XXXXXXXXXX" Publisher="XXXXXXXXXX" Version="1.0.4.0" />
<mp:PhoneIdentity PhoneProductId="XXXXXXXXXX" PhonePublisherId="XXXXXXXXXX" />
<Properties>
<DisplayName>XXXXXXXXXX</DisplayName>
<PublisherDisplayName>XXXXXXXXXX</PublisherDisplayName>
<Logo>Assets\StoreLogo.png</Logo>
</Properties>
<Dependencies>
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
</Dependencies>
<Resources>
<Resource Language="x-generate" />
</Resources>
<Applications>
<Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="XXXXXXXXXX.App">
<uap:VisualElements DisplayName="XXXXXXXXXX" Square150x150Logo="Assets\Square150x150Logo.png" Square44x44Logo="Assets\Square44x44Logo.png" Description="XXXXXXXXXX" BackgroundColor="transparent">
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png">
</uap:DefaultTile>
<uap:SplashScreen Image="Assets\SplashScreen.png" />
</uap:VisualElements>
</Application>
</Applications>
<Capabilities>
<Capability Name="internetClient" />
<uap:Capability Name="phoneCall" />
<uap:Capability Name="picturesLibrary" />
<uap:Capability Name="userAccountInformation" />
<DeviceCapability Name="location" />
<DeviceCapability Name="proximity" />
<DeviceCapability Name="webcam" />
</Capabilities>
</Package>
Does anyone have any ideas why this happens?

getting error opening servlet context xml in spring

My application is throwing exception for servlet-config.xml. I think all my jar versions are correct. Below are the jars. I've see an lot for questions similar to this and tried the solutions but none seemed to work.
junit-3.8.1.jar
spring-webmvc-4.3.3.RELEASE.jar
spring-aop-4.3.3.RELEASE.jar
spring-beans-4.3.3.RELEASE.jar
spring-context-4.3.3.RELEASE.jar
spring-core-4.3.3.RELEASE.jar
commons-logging-1.2.jar
spring-expression-4.3.3.RELEASE.jar
spring-web-4.3.3.RELEASE.jar
servlet-api-2.5.jar
jstl-1.2.jar
servlet-config.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.3.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<mvc:annotation-driven/>
<context:component-scan base-package="com.black.controller"/>
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/jsp/"/>
<property name="suffix" value=".jsp"/>
</bean>
</beans>
my web.xml
<servlet>
<servlet-name>fitTrackerSerlvet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/config/servlet-config.xml</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>fitTrackerSerlvet</servlet-name>
<url-pattern>*.html</url-pattern>
</servlet-mapping>
Below is the exception that I get
javax.servlet.ServletException: Servlet.init() for servlet fitTrackerSerlvet threw exception
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
java.lang.Thread.run(Thread.java:748)
root cause
org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from ServletContext resource [/WEB-INF/config/servlet-config.xml]; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/config/servlet-config.xml]
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:344)
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:304)
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:181)
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:217)
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:188)
org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:125)
org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94)
org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:129)
org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:612)
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:513)
org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:668)
org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:634)
org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:682)
org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:553)
org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:494)
org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136)
javax.servlet.GenericServlet.init(GenericServlet.java:160)
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
java.lang.Thread.run(Thread.java:748)
root cause
java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/config/servlet-config.xml]
org.springframework.web.context.support.ServletContextResource.getInputStream(ServletContextResource.java:141)
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:330)
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:304)
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:181)
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:217)
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:188)
org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:125)
org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94)
org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:129)
org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:612)
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:513)
org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:668)
org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:634)
org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:682)
org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:553)
org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:494)
org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136)
javax.servlet.GenericServlet.init(GenericServlet.java:160)
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
Well, I found the answer. The reason for failure is a typo. I named the file servlet-config..xml. Renaming it worked. Thanks

Unable to save form data to database in spring mvc

I am building a Spring MVC application where someone can fill up the form and if clicks Send then form data will save in database. I am using spring-data-jpa. But when I fill up the form and click send it shows HTTP Status 500 error. I followed every steps but its not working. Here is my Contact model, Contact service and Contact repository and the error --->
Error::::
HTTP Status 500 - Request processing failed; nested exception is org.springframework.dao.InvalidDataAccessResourceUsageException: error performing isolated work; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: error performing isolated work
type Exception report
message Request processing failed; nested exception is org.springframework.dao.InvalidDataAccessResourceUsageException: error performing isolated work; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: error performing isolated work
description The server encountered an internal error that prevented it from fulfilling this request.
exception
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.dao.InvalidDataAccessResourceUsageException: error performing isolated work; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: error performing isolated work
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:982)
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872)
javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
root cause
org.springframework.dao.InvalidDataAccessResourceUsageException: error performing isolated work; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: error performing isolated work
org.springframework.orm.jpa.vendor.HibernateJpaDialect.convertHibernateAccessException(HibernateJpaDialect.java:261)
org.springframework.orm.jpa.vendor.HibernateJpaDialect.translateExceptionIfPossible(HibernateJpaDialect.java:244)
org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.translateExceptionIfPossible(AbstractEntityManagerFactoryBean.java:488)
org.springframework.dao.support.ChainedPersistenceExceptionTranslator.translateExceptionIfPossible(ChainedPersistenceExceptionTranslator.java:59)
org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:213)
org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:147)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor$CrudMethodMetadataPopulatingMethodInterceptor.invoke(CrudMethodMetadataPostProcessor.java:133)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
org.springframework.data.repository.core.support.SurroundingTransactionDetectorMethodInterceptor.invoke(SurroundingTransactionDetectorMethodInterceptor.java:57)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
com.sun.proxy.$Proxy30.save(Unknown Source)
com.learningspring.service.Impl.ContactServiceImpl.saveMail(ContactServiceImpl.java:27)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:498)
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333)
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282)
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
com.sun.proxy.$Proxy31.saveMail(Unknown Source)
com.learningspring.controller.ContactsController.submitContactForm(ContactsController.java:40)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:498)
org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)
org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133)
org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:116)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738)
org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:963)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872)
javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
root cause
org.hibernate.exception.SQLGrammarException: error performing isolated work
org.hibernate.exception.internal.SQLExceptionTypeDelegate.convert(SQLExceptionTypeDelegate.java:63)
org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:42)
org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:111)
org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:97)
org.hibernate.resource.transaction.backend.jdbc.internal.JdbcIsolationDelegate.delegateWork(JdbcIsolationDelegate.java:79)
org.hibernate.id.enhanced.TableStructure$1.getNextValue(TableStructure.java:125)
org.hibernate.id.enhanced.NoopOptimizer.generate(NoopOptimizer.java:40)
org.hibernate.id.enhanced.SequenceStyleGenerator.generate(SequenceStyleGenerator.java:432)
org.hibernate.event.internal.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:105)
org.hibernate.jpa.event.internal.core.JpaPersistEventListener.saveWithGeneratedId(JpaPersistEventListener.java:67)
org.hibernate.event.internal.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:189)
org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:132)
org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:58)
org.hibernate.internal.SessionImpl.firePersist(SessionImpl.java:780)
org.hibernate.internal.SessionImpl.persist(SessionImpl.java:765)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:498)
org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:298)
com.sun.proxy.$Proxy28.persist(Unknown Source)
org.springframework.data.jpa.repository.support.SimpleJpaRepository.save(SimpleJpaRepository.java:508)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:498)
org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.executeMethodOn(RepositoryFactorySupport.java:504)
org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:489)
org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:461)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:61)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282)
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:136)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor$CrudMethodMetadataPopulatingMethodInterceptor.invoke(CrudMethodMetadataPostProcessor.java:133)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
org.springframework.data.repository.core.support.SurroundingTransactionDetectorMethodInterceptor.invoke(SurroundingTransactionDetectorMethodInterceptor.java:57)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
com.sun.proxy.$Proxy30.save(Unknown Source)
com.learningspring.service.Impl.ContactServiceImpl.saveMail(ContactServiceImpl.java:27)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:498)
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333)
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282)
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
com.sun.proxy.$Proxy31.saveMail(Unknown Source)
com.learningspring.controller.ContactsController.submitContactForm(ContactsController.java:40)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:498)
org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)
org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133)
org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:116)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738)
org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:963)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872)
javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
root cause
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table'learningspring.hibernate_sequence' doesn't exist
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
java.lang.reflect.Constructor.newInstance(Constructor.java:423)
com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
com.mysql.jdbc.Util.getInstance(Util.java:408)
com.mysql.jdbc.SQLError.createSQLException(SQLError.java:943)
com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3970)
com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3906)
com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2524)
com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2677)
com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2549)
com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1861)
com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1962)
org.hibernate.id.enhanced.TableStructure.executeQuery(TableStructure.java:216)
org.hibernate.id.enhanced.TableStructure.access$300(TableStructure.java:46)
org.hibernate.id.enhanced.TableStructure$1$1.execute(TableStructure.java:138)
org.hibernate.id.enhanced.TableStructure$1$1.execute(TableStructure.java:126)
org.hibernate.jdbc.WorkExecutor.executeReturningWork(WorkExecutor.java:55)
org.hibernate.jdbc.AbstractReturningWork.accept(AbstractReturningWork.java:34)
org.hibernate.resource.transaction.backend.jdbc.internal.JdbcIsolationDelegate.delegateWork(JdbcIsolationDelegate.java:57)
org.hibernate.id.enhanced.TableStructure$1.getNextValue(TableStructure.java:125)
org.hibernate.id.enhanced.NoopOptimizer.generate(NoopOptimizer.java:40)
org.hibernate.id.enhanced.SequenceStyleGenerator.generate(SequenceStyleGenerator.java:432)
org.hibernate.event.internal.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:105)
org.hibernate.jpa.event.internal.core.JpaPersistEventListener.saveWithGeneratedId(JpaPersistEventListener.java:67)
org.hibernate.event.internal.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:189)
org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:132)
org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:58)
org.hibernate.internal.SessionImpl.firePersist(SessionImpl.java:780)
org.hibernate.internal.SessionImpl.persist(SessionImpl.java:765)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:498)
org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:298)
com.sun.proxy.$Proxy28.persist(Unknown Source)
org.springframework.data.jpa.repository.support.SimpleJpaRepository.save(SimpleJpaRepository.java:508)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:498)
org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.executeMethodOn(RepositoryFactorySupport.java:504)
org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:489)
org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:461)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:61)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282)
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:136)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor$CrudMethodMetadataPopulatingMethodInterceptor.invoke(CrudMethodMetadataPostProcessor.java:133)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
org.springframework.data.repository.core.support.SurroundingTransactionDetectorMethodInterceptor.invoke(SurroundingTransactionDetectorMethodInterceptor.java:57)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
com.sun.proxy.$Proxy30.save(Unknown Source)
com.learningspring.service.Impl.ContactServiceImpl.saveMail(ContactServiceImpl.java:27)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:498)
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333)
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282)
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
com.sun.proxy.$Proxy31.saveMail(Unknown Source)
com.learningspring.controller.ContactsController.submitContactForm(ContactsController.java:40)
Contact Model::::
#Entity
#Table(name = "contacts")
public class Contact {
#Id
#GeneratedValue
#Column(name = "id")
private Long id;
#Column(name = "name")
private String name;
#Column(name = "email")
private String email;
#Column(name = "website")
private String website;
#Column(name = "subject")
private String subject;
#Column(name = "message")
private String message;
Getters and Setters ...
}
ContactServiceImpl class::::
#Service("contactService")
public class ContactServiceImpl implements ContactService {
#Qualifier("contactRepository")
#Autowired
private ContactRepository contactRepository;
#Transactional
public Contact saveMail(Contact contact) {
System.out.println("Inside Contact Service impl");
return contactRepository.save(contact);
}
}
ContactRepository Class::::
#Repository("contactRepository")
public interface ContactRepository extends JpaRepository<Contact, Long> {
}
I noticed that in Contact model, I noticed table name is not resolved. some problem with datasource.
Here is my persistence.xml:::
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
version="2.0">
<persistence-unit name="punit">
</persistence-unit>
</persistence>
and Jpa-config.xml:::
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:jpa="http://www.springframework.org/schema/data/jpa"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">
<context:annotation-config />
<context:component-scan base-package="com.learningspring" />
<jpa:repositories base-package="com.learningspring.repository" />
<bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" />
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="com.mysql.jdbc.Driver" />
<property name="url" value="jdbc:mysql://localhost:3306/learning?autoReconnect=true" />
<property name="username" value="learning" />
<property name="password" value="learning" />
</bean>
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="persistenceUnitName" value="punit" />
<property name="dataSource" ref="dataSource" />
<property name="jpaVendorAdapter">
<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
<property name="showSql" value="true" />
</bean>
</property>
<property name="jpaPropertyMap">
<map>
<entry key="hibernate.dialect" value="org.hibernate.dialect.MySQL5InnoDBDialect" />
<entry key="hibernate.hbm2ddl" value="none" />
<entry key="hibernate.format_sql" value="true" />
</map>
</property>
</bean>
<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
<property name="entityManagerFactory" ref="entityManagerFactory" />
</bean>
<tx:annotation-driven transaction-manager="transactionManager" />
</beans>
and web.xml where I configured jpa and dispatcher servlet:::
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:/jpa-config.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet>
<servlet-name>learningspringServlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/config/servlet-config.xml</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>learningspringServlet</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
Please help me solve this issue. Thanks in advance.
As promise, here how you could configure your project. Spring-data is a really nice tool which prevents from old-school processes.
Let's assume that your entities are in this package : org.myproject.entities This is the package where the EntityManager will look up entities to persist. And your respositories interfaces here : org.myproject.repositories
So in your Jpa-config.xml you'll have :
<beans:bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<beans:property name="dataSource" ref="dataSource"/>
<beans:property name="packagesToScan" value="org.myproject.entities"/> <!--Your package(s) here-->
<!--Other configs-->
</beans:bean>
<jpa:repositories base-package="org.myproject.repositories"/> <!--You should add "jpa" namespace-->
Now you can delete your persistence.xml and remove your the annotation #Repository("contactRepository") (all interfaces in the 'org.myproject.repositories' package will be scanned and added in the bean's container).
In the web.xml try :
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:jpa-config.xml</param-value><!--Is it Jpa-config.xml or jpa-config.xml?-->
</context-param>
EDIT :
Try a new datasource configuration using a connection pool. E.g. try using BoneCP.
Dependencies :
<dependency>
<groupId>com.jolbox</groupId>
<artifactId>bonecp</artifactId>
<version>0.8.0.RELEASE</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>19.0</version>
</dependency>
Configuration in jpa-config.xml
<beans:bean id="poolingDataSource" class="com.jolbox.bonecp.BoneCPDataSource" >
<beans:property name="poolName" value="giveTheNameYouWant"/>
<beans:property name="driverClass" value="com.mysql.jdbc.Driver"/>
<beans:property name="jdbcUrl" value="jdbc:mysql://localhost:3306/learning?useSSL=false&?zeroDateTimeBehavior=convertToNull&?autoReconnect=true&?useUnicode=yes&characterEncoding=UTF-8"/>
<beans:property name="user" value="learning"/>
<beans:property name="password" value="learning"/>
<!--...There are lot of properties that you can config-->
</beans:bean>
Then
<beans:bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<beans:property name="dataSource" ref="poolingDataSource"/>
<!--.... -->
</beans:bean>
Let us know...

Arquillian Glassfish embedded - NameNotFoundException

I am trying to create integration tests for my application using arquillian but I am currently having issues regarding the use of #Resource SessionContext.
Here is my config:
My pom.xml arquillian dependecies:
.
.
.
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jboss.arquillian</groupId>
<artifactId>arquillian-bom</artifactId>
<version>1.1.1.Final</version>
<scope>import</scope>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>
.
.
.
<dependencies>
<!-- Arquilian junit ejb tests -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<!-- In order to log to STDOUT Glassfish events -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.junit</groupId>
<artifactId>arquillian-junit-container</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.container</groupId>
<artifactId>arquillian-glassfish-embedded-3.1</artifactId>
<version>1.0.0.CR4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.glassfish.main.extras</groupId>
<artifactId>glassfish-embedded-all</artifactId>
<version>3.1.2.2</version>
<scope>test</scope>
</dependency>
.
.
.
<dependencies>
arquillian.xml
<?xml version="1.0" encoding="UTF-8"?>
<arquillian xmlns="http://jboss.org/schema/arquillian"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
<container qualifier="glassfish-embedded" default="true">
<configuration>
<property name="resourcesXml">src/test/resources/glassfish-resources.xml</property>
</configuration>
</container>
</arquillian>
glassfish-resources.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE resources PUBLIC
"-//GlassFish.org//DTD GlassFish Application Server 3.1 Resource Definitions//EN"
"http://glassfish.org/dtds/glassfish-resources_1_5.dtd">
<resources>
.
.
.
<jdbc-resource pool-name="xxx" jndi-name="jdbc/xxx" />
<jdbc-resource pool-name="xxx" jndi-name="jdbc/xxx" />
<jdbc-resource pool-name="xxx" jndi-name="jdbc/xxx" />
<jdbc-resource pool-name="xxx" jndi-name="jdbc/xxx" />
<!-- JMS QUEUES -->
<admin-object-resource enabled="true" jndi-name="jms/Exxx" object-type="user" res-adapter="jmsra" res-type="javax.jms.Queue">
<description />
<property name="Name" value="PhysicalQueue" />
</admin-object-resource>
<admin-object-resource enabled="true" jndi-name="jms/xxx" object-type="user" res-adapter="jmsra" res-type="javax.jms.Queue">
<description />
<property name="Name" value="PhysicalQueue" />
</admin-object-resource>
<admin-object-resource enabled="true" jndi-name="jms/xxx" object-type="user" res-adapter="jmsra" res-type="javax.jms.Queue">
<description />
<property name="Name" value="PhysicalQueue" />
</admin-object-resource>
<admin-object-resource enabled="true" jndi-name="jms/xxx" object-type="user" res-adapter="jmsra" res-type="javax.jms.Queue">
<description />
<property name="Name" value="PhysicalQueue" />
</admin-object-resource>
<admin-object-resource enabled="true" jndi-name="jms/xxx" object-type="user" res-adapter="jmsra" res-type="javax.jms.Queue">
<description />
<property name="Name" value="PhysicalQueue" />
</admin-object-resource>
<admin-object-resource enabled="true" jndi-name="jms/xxx" object-type="user" res-adapter="jmsra" res-type="javax.jms.Queue">
<description />
<property name="Name" value="PhysicalQueue" />
</admin-object-resource>
<connector-connection-pool name="jms/xxx" connection-definition-name="javax.jms.QueueConnectionFactory" resource-adapter-name="jmsra" />
<connector-resource enabled="true" jndi-name="jms/xxx" pool-name="jms/DmalConnectionFactoryPool" object-type="system-all" />
<!-- Mail Session -->
<mail-resource jndi-name="xxx" host="xxx" debug="true" user="xxx" from="xxx>
<property name="mail.debug" value="true" />
<property name="mail.smtp.port" value="25" />
<property name="mail.smtp.host" value="xxxx />
<property name="mail.transport.protocol" value="smtp" />
</mail-resource>
</resources>
test-persistence.xml
<?xml version="1.0" encoding="UTF-8" ?>
<persistence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
version="2.0" xmlns="http://java.sun.com/xml/ns/persistence">
<persistence-unit name="Dmal" transaction-type="JTA">
<jta-data-source>jdbc/xxx</jta-data-source>
</persistence-unit>
<persistence-unit name="DocSearch" transaction-type="JTA">
<jta-data-source>jdbc/xxxx</jta-data-source>
</persistence-unit>
<persistence-unit name="Adobe" transaction-type="JTA">
<jta-data-source>jdbc/xxx</jta-data-source>
</persistence-unit>
</persistence>
InboundFileImportTest.java
package com.dfs.business.inbound;
import java.util.UUID;
import javax.ejb.EJB;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.shrinkwrap.api.Filters;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.asset.EmptyAsset;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.junit.Test;
import org.junit.runner.RunWith;
#RunWith(Arquillian.class)
public class InboundFileImportTest {
#EJB
private InboundFileImportBO inboundFileImportBO;
#Deployment
public static JavaArchive createDmalBasicArchive() {
System.setProperty("dmalframework.ejb.interceptor.SecurityInterceptorEnabled","false");
JavaArchive javaArchive = ShrinkWrap.create(JavaArchive.class, "test.jar")
.addPackages(true, Filters.exclude(".*Mock.*|.*Test.*"), "com.dfs", "dmalframework")
.addAsManifestResource("test-persistence.xml", "persistence.xml")
.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
return javaArchive;
}
#Test
public void startInbountImportTest() {
inboundFileImportBO.startInboundFileImport(UUID.randomUUID().toString());
}
}
InboundReprocessBOImpl.java
#Stateless
public class InboundReprocessBOImpl implements InboundReprocessBO {
#Resource
protected SessionContext sessionContext;
.
.
.
}
Here is the ERROR I am getting:
[03 Dec 2016 15:11:29,904] [ERROR] [__ejb-thread-pool1] [com.dfs.business.inbound.InboundFileImportBO] [startAsyncInboundFileImport] [96] Error starting reprocessing file process. Message: javax.ejb.EJBException: javax.ejb.CreateException: Could not create stateless EJB, Correlation ID: 0c0de843-7377-4ad2-ac42-0ac6dc1cda87
javax.ejb.EJBException: javax.ejb.EJBException: javax.ejb.CreateException: Could not create stateless EJB
at com.sun.ejb.containers.StatelessSessionContainer._getContext(StatelessSessionContainer.java:454) ~[glassfish-embedded-all-3.1.2.2.jar:?]
at com.sun.ejb.containers.BaseContainer.getContext(BaseContainer.java:2547) ~[glassfish-embedded-all-3.1.2.2.jar:?]
at com.sun.ejb.containers.BaseContainer.preInvoke(BaseContainer.java:1899) ~[glassfish-embedded-all-3.1.2.2.jar:?]
at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:212) ~[glassfish-embedded-all-3.1.2.2.jar:?]
at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:89) ~[glassfish-embedded-all-3.1.2.2.jar:?]
at com.sun.proxy.$Proxy220.startInboundReprocess(Unknown Source) ~[?:?]
at com.dfs.business.inbound.AsyncInboundFileImportBOImpl.startAsyncInboundFileImport(AsyncInboundFileImportBOImpl.java:94) [classes/:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_79]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[?:1.7.0_79]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.7.0_79]
at java.lang.reflect.Method.invoke(Method.java:606) ~[?:1.7.0_79]
at org.glassfish.ejb.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1052) [glassfish-embedded-all-3.1.2.2.jar:?]
at org.glassfish.ejb.security.application.EJBSecurityManager.invoke(EJBSecurityManager.java:1124) [glassfish-embedded-all-3.1.2.2.jar:?]
at com.sun.ejb.containers.BaseContainer.invokeBeanMethod(BaseContainer.java:5388) [glassfish-embedded-all-3.1.2.2.jar:?]
at com.sun.ejb.EjbInvocation.invokeBeanMethod(EjbInvocation.java:619) [glassfish-embedded-all-3.1.2.2.jar:?]
at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:800) [glassfish-embedded-all-3.1.2.2.jar:?]
at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:571) [glassfish-embedded-all-3.1.2.2.jar:?]
at org.jboss.weld.ejb.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:49) [glassfish-embedded-all-3.1.2.2.jar:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_79]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[?:1.7.0_79]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.7.0_79]
at java.lang.reflect.Method.invoke(Method.java:606) ~[?:1.7.0_79]
at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:861) [glassfish-embedded-all-3.1.2.2.jar:?]
at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:800) [glassfish-embedded-all-3.1.2.2.jar:?]
at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:571) [glassfish-embedded-all-3.1.2.2.jar:?]
at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.doAround(SystemInterceptorProxy.java:162) [glassfish-embedded-all-3.1.2.2.jar:?]
at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.aroundInvoke(SystemInterceptorProxy.java:144) [glassfish-embedded-all-3.1.2.2.jar:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_79]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[?:1.7.0_79]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.7.0_79]
at java.lang.reflect.Method.invoke(Method.java:606) ~[?:1.7.0_79]
at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:861) [glassfish-embedded-all-3.1.2.2.jar:?]
at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:800) [glassfish-embedded-all-3.1.2.2.jar:?]
at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:370) [glassfish-embedded-all-3.1.2.2.jar:?]
at com.sun.ejb.containers.BaseContainer.__intercept(BaseContainer.java:5360) [glassfish-embedded-all-3.1.2.2.jar:?]
at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:5348) [glassfish-embedded-all-3.1.2.2.jar:?]
at com.sun.ejb.containers.EjbAsyncTask.call(EjbAsyncTask.java:101) [glassfish-embedded-all-3.1.2.2.jar:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:262) [?:1.7.0_79]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [?:1.7.0_79]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [?:1.7.0_79]
at java.lang.Thread.run(Thread.java:745) [?:1.7.0_79]
Caused by: javax.ejb.EJBException: javax.ejb.CreateException: Could not create stateless EJB
at com.sun.ejb.containers.StatelessSessionContainer$SessionContextFactory.create(StatelessSessionContainer.java:726) ~[glassfish-embedded-all-3.1.2.2.jar:?]
at com.sun.ejb.containers.util.pool.NonBlockingPool.getObject(NonBlockingPool.java:247) ~[glassfish-embedded-all-3.1.2.2.jar:?]
at com.sun.ejb.containers.StatelessSessionContainer._getContext(StatelessSessionContainer.java:449) ~[glassfish-embedded-all-3.1.2.2.jar:?]
... 40 more
Caused by: javax.ejb.CreateException: Could not create stateless EJB
at com.sun.ejb.containers.StatelessSessionContainer.createStatelessEJB(StatelessSessionContainer.java:534) ~[glassfish-embedded-all-3.1.2.2.jar:?]
at com.sun.ejb.containers.StatelessSessionContainer.access$000(StatelessSessionContainer.java:95) ~[glassfish-embedded-all-3.1.2.2.jar:?]
at com.sun.ejb.containers.StatelessSessionContainer$SessionContextFactory.create(StatelessSessionContainer.java:724) ~[glassfish-embedded-all-3.1.2.2.jar:?]
at com.sun.ejb.containers.util.pool.NonBlockingPool.getObject(NonBlockingPool.java:247) ~[glassfish-embedded-all-3.1.2.2.jar:?]
at com.sun.ejb.containers.StatelessSessionContainer._getContext(StatelessSessionContainer.java:449) ~[glassfish-embedded-all-3.1.2.2.jar:?]
... 40 more
Caused by: java.lang.IllegalStateException: Exception attempting to inject Env-Prop: com.dfs.business.inbound.InboundReprocessBOImpl/sessionContext#Field-Injectable Resource. Class name = com.dfs.business.inbound.InboundReprocessBOImpl Field name=sessionContext#java.lang.String#com.dfs.business.inbound.InboundReprocessBOImpl/sessionContext## into class com.dfs.business.inbound.InboundReprocessBOImpl: Lookup failed for 'java:comp/env/com.dfs.business.inbound.InboundReprocessBOImpl/sessionContext' in SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl, java.naming.factory.url.pkgs=com.sun.enterprise.naming}
at org.glassfish.weld.services.InjectionServicesImpl.aroundInject(InjectionServicesImpl.java:137) ~[glassfish-embedded-all-3.1.2.2.jar:?]
at org.jboss.weld.injection.InjectionContextImpl.run(InjectionContextImpl.java:46) ~[glassfish-embedded-all-3.1.2.2.jar:?]
at org.jboss.weld.bean.SessionBean$SessionBeanInjectionTarget.inject(SessionBean.java:177) ~[glassfish-embedded-all-3.1.2.2.jar:?]
at org.glassfish.weld.services.JCDIServiceImpl.injectEJBInstance(JCDIServiceImpl.java:223) ~[glassfish-embedded-all-3.1.2.2.jar:?]
at com.sun.ejb.containers.BaseContainer.injectEjbInstance(BaseContainer.java:1678) ~[glassfish-embedded-all-3.1.2.2.jar:?]
at com.sun.ejb.containers.StatelessSessionContainer.createStatelessEJB(StatelessSessionContainer.java:494) ~[glassfish-embedded-all-3.1.2.2.jar:?]
at com.sun.ejb.containers.StatelessSessionContainer.access$000(StatelessSessionContainer.java:95) ~[glassfish-embedded-all-3.1.2.2.jar:?]
at com.sun.ejb.containers.StatelessSessionContainer$SessionContextFactory.create(StatelessSessionContainer.java:724) ~[glassfish-embedded-all-3.1.2.2.jar:?]
at com.sun.ejb.containers.util.pool.NonBlockingPool.getObject(NonBlockingPool.java:247) ~[glassfish-embedded-all-3.1.2.2.jar:?]
at com.sun.ejb.containers.StatelessSessionContainer._getContext(StatelessSessionContainer.java:449) ~[glassfish-embedded-all-3.1.2.2.jar:?]
... 40 more
Caused by: com.sun.enterprise.container.common.spi.util.InjectionException: Exception attempting to inject Env-Prop: com.dfs.business.inbound.InboundReprocessBOImpl/sessionContext#Field-Injectable Resource. Class name = com.dfs.business.inbound.InboundReprocessBOImpl Field name=sessionContext#java.lang.String#com.dfs.business.inbound.InboundReprocessBOImpl/sessionContext## into class com.dfs.business.inbound.InboundReprocessBOImpl: Lookup failed for 'java:comp/env/com.dfs.business.inbound.InboundReprocessBOImpl/sessionContext' in SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl, java.naming.factory.url.pkgs=com.sun.enterprise.naming}
at com.sun.enterprise.container.common.impl.util.InjectionManagerImpl._inject(InjectionManagerImpl.java:703) ~[glassfish-embedded-all-3.1.2.2.jar:?]
at com.sun.enterprise.container.common.impl.util.InjectionManagerImpl.inject(InjectionManagerImpl.java:470) ~[glassfish-embedded-all-3.1.2.2.jar:?]
at com.sun.enterprise.container.common.impl.util.InjectionManagerImpl.injectInstance(InjectionManagerImpl.java:171) ~[glassfish-embedded-all-3.1.2.2.jar:?]
at org.glassfish.weld.services.InjectionServicesImpl.aroundInject(InjectionServicesImpl.java:130) ~[glassfish-embedded-all-3.1.2.2.jar:?]
at org.jboss.weld.injection.InjectionContextImpl.run(InjectionContextImpl.java:46) ~[glassfish-embedded-all-3.1.2.2.jar:?]
at org.jboss.weld.bean.SessionBean$SessionBeanInjectionTarget.inject(SessionBean.java:177) ~[glassfish-embedded-all-3.1.2.2.jar:?]
at org.glassfish.weld.services.JCDIServiceImpl.injectEJBInstance(JCDIServiceImpl.java:223) ~[glassfish-embedded-all-3.1.2.2.jar:?]
at com.sun.ejb.containers.BaseContainer.injectEjbInstance(BaseContainer.java:1678) ~[glassfish-embedded-all-3.1.2.2.jar:?]
at com.sun.ejb.containers.StatelessSessionContainer.createStatelessEJB(StatelessSessionContainer.java:494) ~[glassfish-embedded-all-3.1.2.2.jar:?]
at com.sun.ejb.containers.StatelessSessionContainer.access$000(StatelessSessionContainer.java:95) ~[glassfish-embedded-all-3.1.2.2.jar:?]
at com.sun.ejb.containers.StatelessSessionContainer$SessionContextFactory.create(StatelessSessionContainer.java:724) ~[glassfish-embedded-all-3.1.2.2.jar:?]
at com.sun.ejb.containers.util.pool.NonBlockingPool.getObject(NonBlockingPool.java:247) ~[glassfish-embedded-all-3.1.2.2.jar:?]
at com.sun.ejb.containers.StatelessSessionContainer._getContext(StatelessSessionContainer.java:449) ~[glassfish-embedded-all-3.1.2.2.jar:?]
... 40 more
Caused by: javax.naming.NamingException: Lookup failed for 'java:comp/env/com.dfs.business.inbound.InboundReprocessBOImpl/sessionContext' in SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl, java.naming.factory.url.pkgs=com.sun.enterprise.naming}
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:518) ~[glassfish-embedded-all-3.1.2.2.jar:?]
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:455) ~[glassfish-embedded-all-3.1.2.2.jar:?]
at javax.naming.InitialContext.lookup(InitialContext.java:411) ~[?:1.7.0_79]
at com.sun.enterprise.container.common.impl.util.InjectionManagerImpl._inject(InjectionManagerImpl.java:599) ~[glassfish-embedded-all-3.1.2.2.jar:?]
at com.sun.enterprise.container.common.impl.util.InjectionManagerImpl.inject(InjectionManagerImpl.java:470) ~[glassfish-embedded-all-3.1.2.2.jar:?]
at com.sun.enterprise.container.common.impl.util.InjectionManagerImpl.injectInstance(InjectionManagerImpl.java:171) ~[glassfish-embedded-all-3.1.2.2.jar:?]
at org.glassfish.weld.services.InjectionServicesImpl.aroundInject(InjectionServicesImpl.java:130) ~[glassfish-embedded-all-3.1.2.2.jar:?]
at org.jboss.weld.injection.InjectionContextImpl.run(InjectionContextImpl.java:46) ~[glassfish-embedded-all-3.1.2.2.jar:?]
at org.jboss.weld.bean.SessionBean$SessionBeanInjectionTarget.inject(SessionBean.java:177) ~[glassfish-embedded-all-3.1.2.2.jar:?]
at org.glassfish.weld.services.JCDIServiceImpl.injectEJBInstance(JCDIServiceImpl.java:223) ~[glassfish-embedded-all-3.1.2.2.jar:?]
at com.sun.ejb.containers.BaseContainer.injectEjbInstance(BaseContainer.java:1678) ~[glassfish-embedded-all-3.1.2.2.jar:?]
at com.sun.ejb.containers.StatelessSessionContainer.createStatelessEJB(StatelessSessionContainer.java:494) ~[glassfish-embedded-all-3.1.2.2.jar:?]
at com.sun.ejb.containers.StatelessSessionContainer.access$000(StatelessSessionContainer.java:95) ~[glassfish-embedded-all-3.1.2.2.jar:?]
at com.sun.ejb.containers.StatelessSessionContainer$SessionContextFactory.create(StatelessSessionContainer.java:724) ~[glassfish-embedded-all-3.1.2.2.jar:?]
at com.sun.ejb.containers.util.pool.NonBlockingPool.getObject(NonBlockingPool.java:247) ~[glassfish-embedded-all-3.1.2.2.jar:?]
at com.sun.ejb.containers.StatelessSessionContainer._getContext(StatelessSessionContainer.java:449) ~[glassfish-embedded-all-3.1.2.2.jar:?]
... 40 more
Caused by: javax.naming.NameNotFoundException: No object bound to name java:comp/env/com.dfs.business.inbound.InboundReprocessBOImpl/sessionContext
at com.sun.enterprise.naming.impl.GlassfishNamingManagerImpl.lookup(GlassfishNamingManagerImpl.java:772) ~[glassfish-embedded-all-3.1.2.2.jar:?]
at com.sun.enterprise.naming.impl.GlassfishNamingManagerImpl.lookup(GlassfishNamingManagerImpl.java:744) ~[glassfish-embedded-all-3.1.2.2.jar:?]
at com.sun.enterprise.naming.impl.JavaURLContext.lookup(JavaURLContext.java:169) ~[glassfish-embedded-all-3.1.2.2.jar:?]
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:498) ~[glassfish-embedded-all-3.1.2.2.jar:?]
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:455) ~[glassfish-embedded-all-3.1.2.2.jar:?]
at javax.naming.InitialContext.lookup(InitialContext.java:411) ~[?:1.7.0_79]
at com.sun.enterprise.container.common.impl.util.InjectionManagerImpl._inject(InjectionManagerImpl.java:599) ~[glassfish-embedded-all-3.1.2.2.jar:?]
at com.sun.enterprise.container.common.impl.util.InjectionManagerImpl.inject(InjectionManagerImpl.java:470) ~[glassfish-embedded-all-3.1.2.2.jar:?]
at com.sun.enterprise.container.common.impl.util.InjectionManagerImpl.injectInstance(InjectionManagerImpl.java:171) ~[glassfish-embedded-all-3.1.2.2.jar:?]
at org.glassfish.weld.services.InjectionServicesImpl.aroundInject(InjectionServicesImpl.java:130) ~[glassfish-embedded-all-3.1.2.2.jar:?]
at org.jboss.weld.injection.InjectionContextImpl.run(InjectionContextImpl.java:46) ~[glassfish-embedded-all-3.1.2.2.jar:?]
at org.jboss.weld.bean.SessionBean$SessionBeanInjectionTarget.inject(SessionBean.java:177) ~[glassfish-embedded-all-3.1.2.2.jar:?]
at org.glassfish.weld.services.JCDIServiceImpl.injectEJBInstance(JCDIServiceImpl.java:223) ~[glassfish-embedded-all-3.1.2.2.jar:?]
at com.sun.ejb.containers.BaseContainer.injectEjbInstance(BaseContainer.java:1678) ~[glassfish-embedded-all-3.1.2.2.jar:?]
at com.sun.ejb.containers.StatelessSessionContainer.createStatelessEJB(StatelessSessionContainer.java:494) ~[glassfish-embedded-all-3.1.2.2.jar:?]
at com.sun.ejb.containers.StatelessSessionContainer.access$000(StatelessSessionContainer.java:95) ~[glassfish-embedded-all-3.1.2.2.jar:?]
at com.sun.ejb.containers.StatelessSessionContainer$SessionContextFactory.create(StatelessSessionContainer.java:724) ~[glassfish-embedded-all-3.1.2.2.jar:?]
at com.sun.ejb.containers.util.pool.NonBlockingPool.getObject(NonBlockingPool.java:247) ~[glassfish-embedded-all-3.1.2.2.jar:?]
at com.sun.ejb.containers.StatelessSessionContainer._getContext(StatelessSessionContainer.java:449) ~[glassfish-embedded-all-3.1.2.2.jar:?]
Could someone help??
Thanks

Resources