Flex Weblogic Blazeds Error - apache-flex

I have Flex/Parsley/Blazeds application deployed on weblogic 9.x. The following error appears in the weblogic logs the very first time I try connect to server side java class using remoting. After the first time the application works fine...bizzarre any ideas would be appreacited thanks.
FaultEvent fault=[RPC Fault faultString="Send failed" faultCode="Client.Error.MessageSend" faultDetail="Channel.Connect.Failed error NetConnection.Call.Failed: HTTP: Status 500: url: 'http://localhost:8001/ReviewItemsServer/messagebroker/amf'"] messageId="EA02DD33-22C2-A669-EB0C-EE377DBBC233" type="fault" bubbles=false cancelable=true eventPhase=2]
The weblogic logs show the following error:
<27-Oct-2010 13:22:45 o'clock BST> <Error> <HTTP> <BEA-101017> <[weblogic.servlet.internal.WebAppServletContext#227c0a6 - appName: 'ReviewItemsServer', name: 'ReviewItemsServer.war', context-path: '/ReviewItemsServer'] Root cause of ServletException.
java.lang.NoSuchMethodError: setExclusiveOwnerThread
at edu.emory.mathcs.backport.java.util.concurrent.locks.ReentrantLock$NonfairSync.lock(ReentrantLock.java:186)
at flex.messaging.HttpFlexSession.setHttpSession(HttpFlexSession.java:550)
I have included the WEB.XML for reference:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:web="http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4">
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/spring/applicationContext.xml,
/WEB-INF/spring/infrastructureContext.xml
</param-value>
</context-param>
<listener>
<listener-class>flex.messaging.HttpFlexSession</listener-class>
</listener>
<servlet>
<servlet-name>flexspring</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value></param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>flexspring</servlet-name>
<url-pattern>/messagebroker/*</url-pattern>
</servlet-mapping>
</web-app>
The weblogic console startup is shown below:
[Flex]Using MBeanServerLocator: flex.management.PlatformMBeanServerLocator
[Flex]No login command was found for 'WebLogic Server 9.2 Fri Jun 23 20:47:26 EDT 2006 783464 '. Please ensure that the login-command tag has the correct server attribute value, or use 'all' to use the login command regardless of the server.
[Flex]Endpoint 'my-streaming-amf' created with security: None
at URL: http://{server.name}:{server.port}/{context.root}/messagebroker/streamingamf
[Flex]Endpoint 'my-amf' created with security: None
at URL: http://{server.name}:{server.port}/{context.root}/messagebroker/amf
[Flex]Endpoint 'my-polling-amf' created with security: None
at URL: http://{server.name}:{server.port}/{context.root}/messagebroker/amfpolling
[Flex]MessageBroker id: _messageBroker classLoader is: the MessageBroker's class loader and the context class loader (classLoader hashCode: 61418221 (parent hashCode: 61416508 (parent hashCode: 61416374 (parent hashCode: 44613654 (parent hashCode: 36679827 (parent system)))))
[Flex]Service with id 'authentication-service' is starting.
[Flex]Service with id 'authentication-service' is ready (startup time: '0' ms)
[Flex]Service with id 'message-service' is starting.
[Flex]Service with id 'message-service' is ready (startup time: '0' ms)
[Flex]Service with id 'remoting-service' is starting.
[Flex]Service with id 'remoting-service' is ready (startup time: '0' ms)
Flex Debug - turned on - WITH INITIAL REMOTING ERROR
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_04-b05)
BEA JRockit(R) (build R26.0.0-189_CR269406-59389-1.5.0_04-20060322-1120-win-ia32, )
Starting WLS with line:
C:\bea\JROCKI~2\bin\java -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=1044,server=y,suspend=n -jrockit -Xms256m -Xmx512m -Xverify:none -da -Dplatform.home=C:\bea\weblogic\9.2 -Dwls.home=C:\bea\weblogic\9.2\server -Dwli.home=C:\bea\weblogic\9.2\integration -Dweblogic.management.disc
over=true -Dwlw.iterativeDev= -Dwlw.testConsole= -Dwlw.logErrorsToConsole= -Dweblogic.ext.dirs=C:\bea\patch_weblogic920\profiles\default\sysext_manifest_classpath -Dweblogic.Name=AdminServer -Djava.security.policy=C:\bea\weblogic\9.2\server\lib\weblogic.policy weblogic.Server
<14-Dec-2010 14:53:26 o'clock GMT> <Notice> <WebLogicServer> <BEA-000395> <Following extensions directory contents added to the end of the classpath:
C:\bea\weblogic\9.2\platform\lib\p13n\p13n-schemas.jar;C:\bea\weblogic\9.2\platform\lib\p13n\p13n_common.jar;C:\bea\weblogic\9.2\platform\lib\p13n\p13n_system.jar;C:\bea\weblogic\9.2\platform\lib\wlp\netuix_common.jar;C:\bea\weblogic\9.2\platform\lib\wlp\netuix_schemas.jar;C:\bea\weblogic\9.2\platfo
rm\lib\wlp\netuix_system.jar;C:\bea\weblogic\9.2\platform\lib\wlp\wsrp-common.jar>
<14-Dec-2010 14:53:26 o'clock GMT> <Info> <WebLogicServer> <BEA-000377> <Starting WebLogic Server with BEA JRockit(R) Version R26.0.0-189_CR269406-59389-1.5.0_04-20060322-1120-win-ia32 from BEA Systems, Inc.>
<14-Dec-2010 14:53:27 o'clock GMT> <Info> <Management> <BEA-141107> <Version: WebLogic Server 9.2 Fri Jun 23 20:47:26 EDT 2006 783464 >
<14-Dec-2010 14:53:28 o'clock GMT> <Info> <WebLogicServer> <BEA-000215> <Loaded License : C:\bea\license.bea>
<14-Dec-2010 14:53:28 o'clock GMT> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING>
<14-Dec-2010 14:53:28 o'clock GMT> <Info> <WorkManager> <BEA-002900> <Initializing self-tuning thread pool>
<14-Dec-2010 14:53:28 o'clock GMT> <Notice> <Log Management> <BEA-170019> <The server log file C:\bea\user_projects_91\domains\base_domain\servers\AdminServer\logs\AdminServer.log is opened. All server side log events will be written to this file.>
<14-Dec-2010 14:53:29 o'clock GMT> <Notice> <Security> <BEA-090082> <Security initializing using security realm myrealm.>
<14-Dec-2010 14:53:31 o'clock GMT> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STANDBY>
<14-Dec-2010 14:53:31 o'clock GMT> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING>
<14-Dec-2010 14:53:32 o'clock GMT> <Warning> <JMS> <BEA-040456> <An entity of type "ForeignServers" with name "SMO JMS Server" in JMS module "SMO_MODULE" is not targeted. There is no sub-deployment with name "SMO-Subdeployment" in the configuration repository (config.xml), and so this entity will no
t exist anywhere in the domain.>
[Flex]The class loader could not locate the string resource property file 'flex/messaging/errors_en_GB.properties'. This may not be an issue if a property file is available for a less specific locale or the default locale.
[Flex]The class loader could not locate the string resource property file 'flex/data/errors_en_GB.properties'. This may not be an issue if a property file is available for a less specific locale or the default locale.
[Flex]The class loader could not locate the string resource property file 'flex/messaging/errors_en.properties'. This may not be an issue if a property file is available for a less specific locale or the default locale.
[Flex]Not using MBeanServerLocator: flex.management.WebSphereMBeanServerLocator. Reason: Cannot create class of type 'com.ibm.websphere.management.AdminServiceFactory'.
[Flex]Using MBeanServerLocator: flex.management.PlatformMBeanServerLocator
[Flex]No login command was found for 'WebLogic Server 9.2 Fri Jun 23 20:47:26 EDT 2006 783464 '. Please ensure that the login-command tag has the correct server attribute value, or use 'all' to use the login command regardless of the server.
[Flex]Endpoint 'my-streaming-amf' created with security: None
at URL: http://{server.name}:{server.port}/{context.root}/messagebroker/streamingamf
[Flex]Endpoint 'my-amf' created with security: None
at URL: http://{server.name}:{server.port}/{context.root}/messagebroker/amf
[Flex]Endpoint 'my-polling-amf' created with security: None
at URL: http://{server.name}:{server.port}/{context.root}/messagebroker/amfpolling
[Flex]MessageBroker id: _messageBroker classLoader is: the MessageBroker's class loader and the context class loader (classLoader hashCode: 62652490 (parent hashCode: 62650777 (parent hashCode: 62650643 (parent hashCode: 44614166 (parent hashCode: 36679827 (parent system)))))
[Flex]Service with id 'authentication-service' is starting.
[Flex]Service with id 'authentication-service' is ready (startup time: '0' ms)
[Flex]Service with id 'message-service' is starting.
[Flex]Service with id 'message-service' is ready (startup time: '16' ms)
[Flex]Service with id 'remoting-service' is starting.
[Flex]Service with id 'remoting-service' is ready (startup time: '0' ms)
<14-Dec-2010 14:53:37 o'clock GMT> <Notice> <Log Management> <BEA-170027> <The server initialized the domain log broadcaster successfully. Log messages will now be broadcasted to the domain log.>
<14-Dec-2010 14:53:37 o'clock GMT> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to ADMIN>
<14-Dec-2010 14:53:37 o'clock GMT> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RESUMING>
<14-Dec-2010 14:53:37 o'clock GMT> <Notice> <Server> <BEA-002613> <Channel "Default[1]" is now listening on 127.0.0.1:8001 for protocols iiop, t3, ldap, http.>
<14-Dec-2010 14:53:37 o'clock GMT> <Notice> <Server> <BEA-002613> <Channel "Default" is now listening on 147.201.146.91:8001 for protocols iiop, t3, ldap, http.>
<14-Dec-2010 14:53:37 o'clock GMT> <Notice> <WebLogicServer> <BEA-000331> <Started WebLogic Admin Server "AdminServer" for domain "base_domain" running in Development Mode>
<14-Dec-2010 14:53:37 o'clock GMT> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RUNNING>
<14-Dec-2010 14:53:37 o'clock GMT> <Notice> <WebLogicServer> <BEA-000360> <Server started in RUNNING mode>
2010-12-14 14:53:38,593INFO org.apache.beehive.netui.util.config.parser.NetUIConfigParser [Loading the default NetUI config file. The runtime will be configured with a set of minimum parameters.]
2010-12-14 14:53:38,593INFO org.apache.beehive.netui.util.config.parser.NetUIConfigParser [NetUIConfigParser -- load config: org/apache/beehive/netui/util/config/internal/beehive-netui-config-default.xml]
2010-12-14 14:53:38,640INFO org.apache.beehive.netui.pageflow.internal.AdapterManager [No ServletContainerAdapter specified or discovered; using class org.apache.beehive.netui.pageflow.DefaultServletContainerAdapter]
2010-12-14 14:53:38,671INFO org.apache.beehive.netui.pageflow.ProcessPopulate [Register RequestParameterHandler with
prefix: checkbox_key
handler: org.apache.beehive.netui.tags.html.CheckBox$CheckBoxPrefixHandler]
2010-12-14 14:53:38,671INFO org.apache.beehive.netui.pageflow.ProcessPopulate [Register RequestParameterHandler with
prefix: checkbox_group_key
handler: org.apache.beehive.netui.tags.html.CheckBoxGroup$CheckboxGroupPrefixHandler]
2010-12-14 14:53:38,671INFO org.apache.beehive.netui.pageflow.ProcessPopulate [Register RequestParameterHandler with
prefix: radio_button_group_key
handler: org.apache.beehive.netui.tags.html.RadioButtonGroup$RadioButtonGroupPrefixHandler]
2010-12-14 14:53:38,671INFO org.apache.beehive.netui.pageflow.ProcessPopulate [Register RequestParameterHandler with
prefix: select_key
handler: org.apache.beehive.netui.tags.html.Select$SelectPrefixHandler]
2010-12-14 14:53:38,686INFO org.apache.beehive.netui.pageflow.internal.DefaultURLTemplatesFactory [Running without URL template descriptor, /WEB-INF/beehive-url-template-config.xml]
2010-12-14 14:53:38,718DEBUGorg.apache.struts.util.PropertyMessageResources [Initializing, config='org.apache.struts.action.ActionResources', returnNull=true]
2010-12-14 14:53:38,733DEBUGorg.apache.struts.action.ActionServlet [Scanning web.xml for controller servlet mapping]
2010-12-14 14:53:38,749DEBUGorg.apache.struts.action.ActionServlet [Process servletName=action, urlPattern=*.do]
2010-12-14 14:53:38,749DEBUGorg.apache.struts.action.ActionServlet [Process servletName=XmlHttpRequestServlet, urlPattern=*.xhr]
2010-12-14 14:53:38,749DEBUGorg.apache.struts.action.ActionServlet [Process servletName=XmlHttpRequestServlet, urlPattern=*.render]
2010-12-14 14:53:38,749DEBUGorg.apache.struts.action.ActionServlet [Mapping for servlet 'action' = '*.do']
2010-12-14 14:53:38,765DEBUGorg.apache.beehive.netui.pageflow.AutoRegisterActionServlet [Initializing module path '' configuration from '/WEB-INF/classes/_pageflow/struts-config.xml']
2010-12-14 14:53:38,890DEBUGorg.apache.struts.action.ActionServlet [Initializing module path '' message resources from 'org.apache.beehive.netui.pageflow.validation.defaultMessages']
2010-12-14 14:53:38,890DEBUGorg.apache.struts.util.PropertyMessageResources [Initializing, config='org.apache.beehive.netui.pageflow.validation.defaultMessages', returnNull=true]
2010-12-14 14:53:38,890DEBUGorg.apache.struts.action.ActionServlet [Initializing module path '' data sources]
2010-12-14 14:53:38,890DEBUGorg.apache.struts.action.ActionServlet [Initializing module path '' plug ins]
<14-Dec-2010 14:53:56 o'clock GMT> <Error> <HTTP> <BEA-101017> <[weblogic.servlet.internal.WebAppServletContext#3a979c2 - appName: 'ReviewItemsServer', name: 'ReviewItemsServer.war', context-path: '/ReviewItemsServer'] Root cause of ServletException.
java.lang.NoSuchMethodError: setExclusiveOwnerThread
at edu.emory.mathcs.backport.java.util.concurrent.locks.ReentrantLock$NonfairSync.lock(ReentrantLock.java:186)
at edu.emory.mathcs.backport.java.util.concurrent.locks.ReentrantLock.lock(ReentrantLock.java:266)
at edu.emory.mathcs.backport.java.util.concurrent.ConcurrentHashMap$Segment.put(ConcurrentHashMap.java:418)
at edu.emory.mathcs.backport.java.util.concurrent.ConcurrentHashMap.put(ConcurrentHashMap.java:884)
at flex.messaging.HttpFlexSession.setHttpSessio (HttpFlexSession.java:550)
Truncated. see log file for complete stacktrace
>
Flex Debug - turned on - WITH SUCCESSFUL REMOTING CALL
[Flex]Deserializing AMF/HTTP request
Version: 3
(Message #0 targetURI=null, responseURI=/1)
(Array #0)
[0] = (Typed Object #0 'flex.messaging.messages.CommandMessage')
operation = 5
correlationId = ""
headers = (Object #1)
DSId = "nil"
DSMessagingVersion = 1
timestamp = 0
body = (Object #2)
clientId = null
destination = ""
messageId = "47D7323A-E6FC-AEC4-5584-E55FAF2E778F"
timeToLive = 0
[Flex]FlexClient created with id '9BFE9C7A-4A0A-0B0A-1764-5544D742138B'.
[Flex]Executed command: (default service)
commandMessage: Flex Message (flex.messaging.messages.CommandMessage)
operation = client_ping
clientId = 9BFE9C7A-4A1B-4999-ED3D-4866B9919E89
correlationId =
destination =
messageId = 47D7323A-E6FC-AEC4-5584-E55FAF2E778F
timestamp = 1292338442249
timeToLive = 0
body = {}
hdr(DSEndpoint) = my-amf
hdr(DSId) = nil
hdr(DSMessagingVersion) = 1
replyMessage: Flex Message (flex.messaging.messages.AcknowledgeMessage)
clientId = 9BFE9C7A-4A1B-4999-ED3D-4866B9919E89
correlationId = 47D7323A-E6FC-AEC4-5584-E55FAF2E778F
destination = null
messageId = 9BFE9CED-090E-DFC5-54A6-1F968D5CB445
timestamp = 1292338442265
timeToLive = 0
body = null
hdr(DSId) = 9BFE9C7A-4A0A-0B0A-1764-5544D742138B
hdr(DSMessagingVersion) = 1.0
[Flex]Serializing AMF/HTTP response
Version: 3
(Message #0 targetURI=/1/onResult, responseURI=)
(Externalizable Object #0 'DSK')
(Object #1)
DSId = "9BFE9C7A-4A0A-0B0A-1764-5544D742138B"
DSMessagingVersion = 1.0
1.292338442265E12
(Byte Array #2, Length 16)
(Byte Array #3, Length 16)
(Byte Array #4, Length 16)
[Flex]Deserializing AMF/HTTP request
Version: 3
(Message #0 targetURI=null, responseURI=/2)
(Array #0)
[0] = (Typed Object #0 'flex.messaging.messages.RemotingMessage')
operation = "setReviewItemsParams"
source = null
headers = (Object #1)
DSRemoteCredentials = ""
DSEndpoint = null
DSRemoteCredentialsCharset = null
DSId = "9BFE9C7A-4A0A-0B0A-1764-5544D742138B"
timestamp = 0
body = (Array #2)
[0] = 11162
[1] = 2
clientId = null
destination = "remoteReviewItemsService"
messageId = "9E33D197-6D2A-7507-DBCA-E55FAEFFC8AB"
timeToLive = 0
[Flex]Before invoke service: remoting-service
incomingMessage: Flex Message (flex.messaging.messages.RemotingMessage)
operation = setReviewItemsParams
clientId = 9BFEA163-9D0F-10F2-D003-4609CD6AE1AA
destination = remoteReviewItemsService
messageId = 9E33D197-6D2A-7507-DBCA-E55FAEFFC8AB
timestamp = 1292338442733
timeToLive = 0
body =
[
11162,
2
]
hdr(DSEndpoint) = my-amf
hdr(DSId) = 9BFE9C7A-4A0A-0B0A-1764-5544D742138B
hdr(DSRemoteCredentials) =
[Flex]Adapter 'java-object' called 'null.setReviewItemsParams(java.util.Arrays$ArrayList (Collection size:2)
[0] = 11162
[1] = 2
)'
[Flex]Result: 'null'
[Flex]After invoke service: remoting-service
reply: null
[Flex]Serializing AMF/HTTP response
Version: 3
(Message #0 targetURI=/2/onResult, responseURI=)
(Externalizable Object #0 'DSK')
1.292338442874E12
(Byte Array #1, Length 16)
(Byte Array #2, Length 16)
(Byte Array #3, Length 16)

You can check backport-util-concurrent.jar which must match your JDK.

It looks like you are calling a method that either doesn't exist or you are calling it with non-matching parameters.

Related

java.util.concurrent.TimeoutException: Request timeout after 60000 ms when using camel-ahc

I have a simple web service, ws1, that just has a setBody to "hello world" which is exposed by netty. I want to call this web service asynchronously with the help of camel-ahc.
for doing that, I have a main camel context that call the ws1 every 6 seconds, but after calling ws1 in another thread, the control of the program is not returning to the main camel context thread and it seems camel-ahc component is not working and after 60 seconds a request timeout exception is happening.
in my pom i have added:
camel-ahc
camel-reactive-streams
<camelContext trace="true" id="mainCamelContext" xmlns="http://camel.apache.org/schema/blueprint" >
<route id="ahc-route-first-api">
<from uri="timer://webinar?period=6000"/>
<log message="this is body: ${body}"/>
<to uri="ahc:http://192.168.100.232:9999/ws1"/>
<log message="this is body after call: ${body}"/>
</route>
</camelContext>
when install bundle in Fuse:
10:35:18.914 INFO [Camel (mainCamelContext) thread #316 -
timer://webinar] this is body: 10:35:18.914 INFO [Camel
(mainCamelContext) thread #316 - timer://webinar]
ID-localhost-localdomain-1552973873885-38-116 >>>
(ahc-route-first-api) log[this is body: ${body}] -->
ahc://http://192.168.100.232:9999/api?throwExceptionOnFailure=false
<<< Pattern:InOnly,
Headers:{breadcrumbId=ID-localhost-localdomain-1552973873885-38-116,
firedTime=Sat Apr 06 10:35:18 IRDT 2019}, BodyType:null, Body:[Body is
null] 10:35:19.202 WARN [AsyncHttpClient-timer-87-1] Error processing
exchange. Exchange[ID-localhost-localdomain-1552973873885-38-114].
Caused by: [java.util.concurrent.TimeoutException - Request timeout to
192.168.100.232/192.168.100.232:9999 after 60000 ms] java.util.concurrent.TimeoutException: Request timeout to
192.168.100.232/192.168.100.232:9999 after 60000 ms at org.asynchttpclient.netty.timeout.TimeoutTimerTask.expire(TimeoutTimerTask.java:43)
[1990:wrap_file__home_ossl_.m2_repository_org_asynchttpclient_async-http-client_2.4.3_async-http-client-2.4.3.jar_Export-Package_org.asynchttpclient.__version_2.4.3:0.0.0]
at
org.asynchttpclient.netty.timeout.RequestTimeoutTimerTask.run(RequestTimeoutTimerTask.java:50)
[1990:wrap_file__home_ossl_.m2_repository_org_asynchttpclient_async-http-client_2.4.3_async-http-client-2.4.3.jar_Export-Package_org.asynchttpclient.__version_2.4.3:0.0.0]
at
io.netty.util.HashedWheelTimer$HashedWheelTimeout.expire(HashedWheelTimer.java:663)
[654:io.netty.common:4.1.16.Final-redhat-2] at
io.netty.util.HashedWheelTimer$HashedWheelBucket.expireTimeouts(HashedWheelTimer.java:738)
[654:io.netty.common:4.1.16.Final-redhat-2] at
io.netty.util.HashedWheelTimer$Worker.run(HashedWheelTimer.java:466)
[654:io.netty.common:4.1.16.Final-redhat-2] at
io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:138)
[654:io.netty.common:4.1.16.Final-redhat-2] at
java.lang.Thread.run(Thread.java:748) [?:?] 10:35:19.203 ERROR
[AsyncHttpClient-timer-87-1] Failed delivery for (MessageId:
ID-localhost-localdomain-1552973873885-38-117 on ExchangeId:
ID-localhost-localdomain-1552973873885-38-114). Exhausted after
delivery attempt: 1 caught: java.util.concurrent.TimeoutException:
Request timeout to 192.168.100.232/192.168.100.232:9999 after 60000 ms

Change Glassfish Servlet Encoding/Charset

I'm sending a Serializable object to Servlet on Glassfish 4.1 server, the object has String fields with Arabic chars, when I try to log the Arabic values I got (?????)
I've read This and This and many other posts but nothing solved the problem, I've tried the same codes on Tomcat 8 Server and it works fine
What should I do with Glassfish server or my Servlet to read UTF-8 chars correctly?
Sending the Serializable object:
url = new URL(ServerInfo.STORABLE_RECEIVER_URL);
http = (HttpURLConnection) url.openConnection();
http.setRequestProperty("content-type", "application/x-object; charset=utf-8");
http.setRequestProperty("Accept-Charset", "UTF-8");
http.setDoOutput(true);
http.setDoInput(true);
out = new ObjectOutputStream(http.getOutputStream());
out.writeObject(t);
web.xml
<filter>
<filter-name>Set Response Character Encoding</filter-name>
<filter-class>net.abdullahcodes.serv.MyFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>Set Response Character Encoding</filter-name>
<url-pattern>/TradableReceiver</url-pattern>
<url-pattern>/*</url-pattern>
<url-pattern>/</url-pattern>
</filter-mapping>
<locale-encoding-mapping-list>
<locale-encoding-mapping>
<locale>ar</locale>
<encoding>UTF-8</encoding>
</locale-encoding-mapping>
<locale-encoding-mapping>
<locale>en</locale>
<encoding>UTF-8</encoding>
</locale-encoding-mapping>
</locale-encoding-mapping-list>
MyFilter
Copied from Omri Spector answer on This
glassfish-web.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE glassfish-web-app PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Servlet 3.0//EN" "http://glassfish.org/dtds/glassfish-web-app_3_0-1.dtd">
<glassfish-web-app>
<jsp-config>
</jsp-config>
<parameter-encoding default-charset="UTF-8" />
</glassfish-web-app>
Servlet test received Serializable object:
log("sys: "+System.getProperty("file.encoding"));
log("def: "+Charset.defaultCharset());
log("size: "+b.totalRowsCount()+", "+b.totalColumnsCount());
log("test arabic: هلوووووووووويااا");
System.out.println("test sysout: اوووه خطبها نصيب");
while (b.hasNext()) {
Position p = new Position();
p.setEn(b.next());
p.setAr(b.next());
log("p: "+p.toString());
}
Console output on Glassfish:
log():net.abdullahcodes.serv.TradableReceiver: sys: Cp1252
log():net.abdullahcodes.serv.TradableReceiver: def: windows-1252
log():net.abdullahcodes.serv.TradableReceiver: size: 4, 2
log():net.abdullahcodes.serv.TradableReceiver: test arabic: ????????????????
Info: test sysout: ????? ????? ????
log():net.abdullahcodes.serv.TradableReceiver: p: id: 0, en: fatima, ar: abod
log():net.abdullahcodes.serv.TradableReceiver: p: id: 0, en: maryam, ar: nora
log():net.abdullahcodes.serv.TradableReceiver: p: id: 0, en: ????, ar: ????
log():net.abdullahcodes.serv.TradableReceiver: p: id: 0, en: ????, ar: ????
Console output on Tomcat:
log INFO: net.abdullahcodes.serv.TradableReceiver: sys: UTF-8
log INFO: net.abdullahcodes.serv.TradableReceiver: def: UTF-8
log INFO: net.abdullahcodes.serv.TradableReceiver: size: 4, 2
log INFO: net.abdullahcodes.serv.TradableReceiver: test arabic: هلوووووووووويااا
test sysout: اوووه خطبها نصيب
log INFO: net.abdullahcodes.serv.TradableReceiver: p: id: 0, en: fatima, ar: abod
log INFO: net.abdullahcodes.serv.TradableReceiver: p: id: 0, en: maryam, ar: nora
log INFO: net.abdullahcodes.serv.TradableReceiver: p: id: 0, en: احمد, ar: صالح
log INFO: net.abdullahcodes.serv.TradableReceiver: p: id: 0, en: حسين, ar:
You need to set the command line property:
-Dfile.encoding=UTF-8
when starting Glassfish.
If you're starting from your IDE then you need to add this setting to the launch configuration.
If Glassfish is being started as a service then you need to set an environment variable:
JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8

Wildfly 8.2.0 invocate secured remote ejb

i'm trying to invocate a secured remote ejb but i can't. I'm using ejb-client-API.
The application is deployed in a ear named som.ear.
I'm using Wildfly 8.2.0 final
Code client:
public class SomTestClient {
public static void main(String[] args) throws Exception {
invokeStatelessBean();
}
private static void invokeStatelessBean() throws NamingException {
final RemoteCalculator statelessRemoteCalculator = lookupRemoteStatelessCalculator();
int a = 204;
int b = 340;
int sum = statelessRemoteCalculator.add(a, b);
System.out.println("Remote calculator returned sum = " + sum);
}
private static RemoteCalculator lookupRemoteStatelessCalculator()
throws NamingException {
final Hashtable jndiProperties = new Hashtable();
jndiProperties.put(Context.URL_PKG_PREFIXES,
"org.jboss.ejb.client.naming");
Context context = new InitialContext(jndiProperties);
String jdniLookup = "ejb:som/platform_api_service/CalculatorBean!"
+ RemoteCalculator.class.getName();
return (RemoteCalculator) context.lookup(jdniLookup);
}
}
jboss-ejb-client.properies
remote.connections=default
remote.connection.default.host=127.0.0.1
remote.connection.default.port=8080
remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false
remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOPLAINTEXT=false
remote.connection.default.username=admin
remote.connection.default.password=scheduler
EJB
#Stateless
#SecurityDomain("som_security_domain")
#DeclareRoles("tms_login")
#RolesAllowed("tms_login")
#Remote(RemoteCalculator.class)
public class CalculatorBean implements RemoteCalculator {
#Override
public int add(int a, int b) {
return a + b;
}
#Override
public int subtract(int a, int b) {
return a - b;
}
}
standalone.xml
<security-realms>
....
<security-realm name="SomRealm">
<authentication>
<jaas name="som_security_domain"/>
</authentication>
</security-realm>
....
</security-realms>
....
<subsystem xmlns="urn:jboss:domain:remoting:2.0">
<endpoint worker="default"/>
<http-connector name="http-remoting-connector" connector-ref="default" security-realm="SomRealm"/>
</subsystem>
....
<security-domains>
<security-domain name="som_security_domain" cache-type="default">
<authentication>
<login-module code="Database" flag="required">
<module-option name="dsJndiName" value="java:jboss/datasources/TMSDS"/>
<module-option name="principalsQuery" value="select Password from TMSUser where UserName=?"/>
<module-option name="rolesQuery" value="select A.role,'Roles' from (select userName,'tms_login' as role from TMSUser where active = 1 union select userName,'tms_security_admin' as role from TMSUser where active = 1 and isSecurityAdmin = 1) A where A.userName=?"/>
</login-module>
</authentication>
</security-domain>
</security-domains>
Server log
2015-06-23 13:30:24,108 DEBUG [org.jboss.remotingjmx.DelegatingRemotingConnectorServer] (Remoting "darioschmidtpc:MANAGEMENT" task-3) Client version 2.0.0.Final
2015-06-23 13:30:24,134 DEBUG [org.jboss.remotingjmx.DelegatingRemotingConnectorServer] (Remoting "darioschmidtpc:MANAGEMENT" task-2) Chosen version 0x02
2015-06-23 13:30:24,139 DEBUG [org.jboss.remotingjmx.protocol.v2.ParameterProxy] (Remoting "darioschmidtpc:MANAGEMENT" task-2) Created connection - ID to be established after parameter negotiation.
2015-06-23 13:30:24,153 DEBUG [org.jboss.remotingjmx.protocol.v2.ServerProxy] (pool-2-thread-1) Created connectionID edb2b548-f8b0-4b5c-8531-1bafd5c86cd9
2015-06-23 13:30:24,153 DEBUG [org.jboss.remotingjmx.RemotingConnectorServer] (pool-2-thread-1) Connection 'edb2b548-f8b0-4b5c-8531-1bafd5c86cd9' now opened.
2015-06-23 13:30:34,529 TRACE [org.jboss.security] (default task-1) PBOX000200: Begin isValid, principal: admin, cache entry: null
2015-06-23 13:30:34,529 TRACE [org.jboss.security] (default task-1) PBOX000209: defaultLogin, principal: admin
2015-06-23 13:30:34,530 TRACE [org.jboss.security] (default task-1) PBOX000221: Begin getAppConfigurationEntry(som_security_domain), size: 4
2015-06-23 13:30:34,531 TRACE [org.jboss.security] (default task-1) PBOX000224: End getAppConfigurationEntry(som_security_domain), AuthInfo: AppConfigurationEntry[]:
[0]
LoginModule Class: org.jboss.security.auth.spi.DatabaseServerLoginModule
ControlFlag: LoginModuleControlFlag: required
Options:
name=dsJndiName, value=java:jboss/datasources/TMSDS
name=principalsQuery, value=select Password from TMSUser where UserName=?
name=rolesQuery, value=select A.role,'Roles' from (select userName,'tms_login' as role from TMSUser where active = 1 union select userName,'tms_security_admin' as role from TMSUser where active = 1 and isSecurityAdmin = 1) A where A.userName=?
2015-06-23 13:30:34,534 TRACE [org.jboss.security] (default task-1) PBOX000236: Begin initialize method
2015-06-23 13:30:34,534 TRACE [org.jboss.security] (default task-1) PBOX000262: Module options [dsJndiName: java:jboss/datasources/TMSDS, principalsQuery: select Password from TMSUser where UserName=?, rolesQuery: select A.role,'Roles' from (select userName,'tms_login' as role from TMSUser where active = 1 union select userName,'tms_security_admin' as role from TMSUser where active = 1 and isSecurityAdmin = 1) A where A.userName=?, suspendResume: true]
2015-06-23 13:30:34,535 TRACE [org.jboss.security] (default task-1) PBOX000240: Begin login method
2015-06-23 13:30:34,541 TRACE [org.jboss.security] (default task-1) PBOX000263: Executing query select Password from TMSUser where UserName=? with username admin
2015-06-23 13:30:34,548 FINE [com.microsoft.sqlserver.jdbc.internals.SQLServerStatement] (default task-1) SQLServerPreparedStatement:2 created by (ConnectionID:2 ClientConnectionId: 2fdf752a-850a-415a-8eb6-d900b16854cd)
2015-06-23 13:30:34,560 FINE [com.microsoft.sqlserver.jdbc.internals.SQLServerStatement] (default task-1) SQLServerPreparedStatement:2: calling sp_prepexec: PreparedHandle:0, SQL:select Password from TMSUser where UserName=#P0
2015-06-23 13:30:34,563 FINE [com.microsoft.sqlserver.jdbc.internals.SQLServerResultSet] (default task-1) SQLServerResultSet:2 created by (SQLServerPreparedStatement:2)
2015-06-23 13:30:34,568 TRACE [org.jboss.security] (default task-1) PBOX000241: End login method, isValid: true
2015-06-23 13:30:34,568 TRACE [org.jboss.security] (default task-1) PBOX000242: Begin commit method, overall result: true
2015-06-23 13:30:34,568 TRACE [org.jboss.security] (default task-1) PBOX000263: Executing query select A.role,'Roles' from (select userName,'tms_login' as role from TMSUser where active = 1 union select userName,'tms_security_admin' as role from TMSUser where active = 1 and isSecurityAdmin = 1) A where A.userName=? with username admin
2015-06-23 13:30:34,570 TRACE [org.jboss.security] (default task-1) PBOX000263: Executing query select A.role,'Roles' from (select userName,'tms_login' as role from TMSUser where active = 1 union select userName,'tms_security_admin' as role from TMSUser where active = 1 and isSecurityAdmin = 1) A where A.userName=? with username admin
2015-06-23 13:30:34,570 FINE [com.microsoft.sqlserver.jdbc.internals.SQLServerStatement] (default task-1) SQLServerPreparedStatement:3 created by (ConnectionID:3 ClientConnectionId: 884a76af-268c-4742-859b-9087141727a2)
2015-06-23 13:30:34,571 FINE [com.microsoft.sqlserver.jdbc.internals.SQLServerStatement] (default task-1) SQLServerPreparedStatement:3: calling sp_prepexec: PreparedHandle:0, SQL:select A.role,'Roles' from (select userName,'tms_login' as role from TMSUser where active = 1 union select userName,'tms_security_admin' as role from TMSUser where active = 1 and isSecurityAdmin = 1) A where A.userName=#P0
2015-06-23 13:30:34,576 FINE [com.microsoft.sqlserver.jdbc.internals.SQLServerResultSet] (default task-1) SQLServerResultSet:3 created by (SQLServerPreparedStatement:3)
2015-06-23 13:30:34,579 TRACE [org.jboss.security] (default task-1) PBOX000210: defaultLogin, login context: javax.security.auth.login.LoginContext#7660e36, subject: Subject(1245810797).principals=org.jboss.security.SimplePrincipal#489131543(admin)org.jboss.security.SimpleGroup#870530995(Roles(members:tms_login,tms_security_admin))org.jboss.security.SimpleGroup#870530995(CallerPrincipal(members:admin))
2015-06-23 13:30:34,580 TRACE [org.jboss.security] (default task-1) PBOX000207: updateCache, input subject: Subject(1245810797).principals=org.jboss.security.SimplePrincipal#489131543(admin)org.jboss.security.SimpleGroup#870530995(Roles(members:tms_login,tms_security_admin))org.jboss.security.SimpleGroup#870530995(CallerPrincipal(members:admin)), cached subject: Subject(1494215433).principals=org.jboss.security.SimplePrincipal#489131543(admin)org.jboss.security.SimpleGroup#870530995(Roles(members:tms_login,tms_security_admin))org.jboss.security.SimpleGroup#870530995(CallerPrincipal(members:admin))
2015-06-23 13:30:34,580 TRACE [org.jboss.security] (default task-1) PBOX000208: Inserted cache info: org.jboss.security.authentication.JBossCachedAuthenticationManager$DomainInfo#bee0537
2015-06-23 13:30:34,580 TRACE [org.jboss.security] (default task-1) PBOX000201: End isValid, result = true
2015-06-23 13:30:34,581 TRACE [org.jboss.security.audit] (default task-1) [Success]principal=admin;Action=authentication;Source=org.jboss.as.security.service.SimpleSecurityManager;
2015-06-23 13:30:34,621 DEBUG [org.jboss.as.ejb3] (default task-3) Client with protocol version 2 and marshalling strategy river trying to communicate on Channel ID 67b58316 (inbound) of Remoting connection 274a0859 to /127.0.0.1:63598
2015-06-23 13:30:34,625 DEBUG [org.jboss.as.ejb3] (default task-3) Sending initial module availability message, containing 5 module(s) to channel Channel ID 67b58316 (inbound) of Remoting connection 274a0859 to /127.0.0.1:63598
2015-06-23 13:30:34,627 DEBUG [org.jboss.as.ejb3] (default task-3) Writing out cluster formation message for 0 clusters, to channel Channel ID 67b58316 (inbound) of Remoting connection 274a0859 to /127.0.0.1:63598
2015-06-23 13:30:34,737 TRACE [org.jboss.security] (EJB default - 1) PBOX000200: Begin isValid, principal: admin, cache entry: org.jboss.security.authentication.JBossCachedAuthenticationManager$DomainInfo#bee0537
2015-06-23 13:30:34,737 TRACE [org.jboss.security] (EJB default - 1) PBOX000204: Begin validateCache, domainInfo: org.jboss.security.authentication.JBossCachedAuthenticationManager$DomainInfo#bee0537, credential class: class java.lang.String
2015-06-23 13:30:34,738 TRACE [org.jboss.security] (EJB default - 1) PBOX000205: End validateCache, result = true
2015-06-23 13:30:34,738 TRACE [org.jboss.security] (EJB default - 1) PBOX000201: End isValid, result = true
2015-06-23 13:30:34,738 TRACE [org.jboss.security.audit] (EJB default - 1) [Success]principal=admin;Action=authentication;Source=org.jboss.as.security.service.SimpleSecurityManager;
2015-06-23 13:30:34,738 TRACE [org.jboss.security] (EJB default - 1) PBOX000354: Setting security roles ThreadLocal: {}
2015-06-23 13:30:34,750 ERROR [stderr] (EJB default - 1) Jun 23, 2015 1:30:34 PM nl.tudelft.simulation.naming.JVMContextFactory getInitialContext
2015-06-23 13:30:34,750 ERROR [stderr] (EJB default - 1) WARNING: unused environment variables in jndi.properties
2015-06-23 13:30:34,754 TRACE [org.jboss.as.security] (EJB default - 1) Look up of JNDI for som_security_domain/authorizationMgr failed with java:jboss not found.
2015-06-23 13:30:34,755 TRACE [org.jboss.as.security] (EJB default - 1) Exception getting AuthorizationManager for domain=
2015-06-23 13:30:34,755 TRACE [org.jboss.security] (EJB default - 1) PBOX000354: Setting security roles ThreadLocal: null
2015-06-23 13:30:34,755 ERROR [org.jboss.as.ejb3.invocation] (EJB default - 1) JBAS014134: EJB Invocation failed on component CalculatorBean for method public abstract int com.soteica.platform.api.tests.RemoteCalculator.add(int,int): java.lang.RuntimeException: java.lang.IllegalStateException: PBOX000075: The property AuthorizationManager is null
at org.jboss.as.security.service.SimpleSecurityManager.authorize(SimpleSecurityManager.java:305) [wildfly-security-8.2.0.Final.jar:8.2.0.Final]
at org.jboss.as.ejb3.security.AuthorizationInterceptor.processInvocation(AuthorizationInterceptor.java:133) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
at org.jboss.as.ejb3.security.SecurityContextInterceptor.processInvocation(SecurityContextInterceptor.java:95) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
at org.jboss.as.ejb3.component.interceptors.ShutDownInterceptorFactory$1.processInvocation(ShutDownInterceptorFactory.java:64) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:59) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:55) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
at org.jboss.invocation.ContextClassLoaderInterceptor.processInvocation(ContextClassLoaderInterceptor.java:64)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:326)
at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:448)
at org.jboss.invocation.AccessCheckingInterceptor.processInvocation(AccessCheckingInterceptor.java:61)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:326)
at org.jboss.invocation.PrivilegedWithCombinerInterceptor.processInvocation(PrivilegedWithCombinerInterceptor.java:80)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:185)
at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler.invokeMethod(MethodInvocationMessageHandler.java:330) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]
at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler.access$100(MethodInvocationMessageHandler.java:70) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]
at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler$1.run(MethodInvocationMessageHandler.java:203) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [rt.jar:1.8.0_25]
at java.util.concurrent.FutureTask.run(Unknown Source) [rt.jar:1.8.0_25]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [rt.jar:1.8.0_25]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.8.0_25]
at java.lang.Thread.run(Unknown Source) [rt.jar:1.8.0_25]
at org.jboss.threads.JBossThread.run(JBossThread.java:122)
Caused by: java.lang.IllegalStateException: PBOX000075: The property AuthorizationManager is null
at org.jboss.security.plugins.javaee.EJBAuthorizationHelper.authorize(EJBAuthorizationHelper.java:298) [picketbox-4.0.21.Final.jar:4.0.21.Final]
at org.jboss.as.security.service.SimpleSecurityManager.authorize(SimpleSecurityManager.java:303) [wildfly-security-8.2.0.Final.jar:8.2.0.Final]
... 32 more
Client log
Jun 23, 2015 1:30:34 PM nl.tudelft.simulation.naming.JVMContextFactory getInitialContext
WARNING: unused environment variables in jndi.properties
Jun 23, 2015 1:30:34 PM org.jboss.ejb.client.EJBClient <clinit>
INFO: JBoss EJB Client version 2.0.1.Final
Jun 23, 2015 1:30:34 PM org.xnio.Xnio <clinit>
INFO: XNIO version 3.3.0.Final
Jun 23, 2015 1:30:34 PM org.xnio.nio.NioXnio <clinit>
INFO: XNIO NIO Implementation Version 3.3.0.Final
Jun 23, 2015 1:30:34 PM org.jboss.remoting3.EndpointImpl <clinit>
INFO: JBoss Remoting version 4.0.6.Final
Jun 23, 2015 1:30:34 PM org.jboss.ejb.client.remoting.VersionReceiver handleMessage
INFO: EJBCLIENT000017: Received server version 2 and marshalling strategies [river]
Jun 23, 2015 1:30:34 PM org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver associate
INFO: EJBCLIENT000013: Successful version handshake completed for receiver context EJBReceiverContext{clientContext=org.jboss.ejb.client.EJBClientContext#306279ee, receiver=Remoting connection EJB receiver [connection=org.jboss.ejb.client.remoting.ConnectionPool$PooledConnection#545997b1,channel=jboss.ejb,nodename=darioschmidtpc]} on channel Channel ID e7b58316 (outbound) of Remoting connection 3eecc1af to /127.0.0.1:8080
Exception in thread "main" java.lang.RuntimeException: java.lang.IllegalStateException: PBOX000075: The property AuthorizationManager is null
at org.jboss.as.security.service.SimpleSecurityManager.authorize(SimpleSecurityManager.java:305)
at org.jboss.as.ejb3.security.AuthorizationInterceptor.processInvocation(AuthorizationInterceptor.java:133)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
at org.jboss.as.ejb3.security.SecurityContextInterceptor.processInvocation(SecurityContextInterceptor.java:95)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
at org.jboss.as.ejb3.component.interceptors.ShutDownInterceptorFactory$1.processInvocation(ShutDownInterceptorFactory.java:64)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:59)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:55)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
at org.jboss.invocation.ContextClassLoaderInterceptor.processInvocation(ContextClassLoaderInterceptor.java:64)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:326)
at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:448)
at org.jboss.invocation.AccessCheckingInterceptor.processInvocation(AccessCheckingInterceptor.java:61)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:326)
at org.jboss.invocation.PrivilegedWithCombinerInterceptor.processInvocation(PrivilegedWithCombinerInterceptor.java:80)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:185)
at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler.invokeMethod(MethodInvocationMessageHandler.java:330)
at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler.access$100(MethodInvocationMessageHandler.java:70)
at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler$1.run(MethodInvocationMessageHandler.java:203)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
at org.jboss.threads.JBossThread.run(JBossThread.java:122)
at ...asynchronous invocation...(Unknown Source)
at org.jboss.ejb.client.remoting.InvocationExceptionResponseHandler$MethodInvocationExceptionResultProducer.getResult(InvocationExceptionResponseHandler.java:96)
at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:276)
at org.jboss.ejb.client.EJBObjectInterceptor.handleInvocationResult(EJBObjectInterceptor.java:64)
at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:290)
at org.jboss.ejb.client.EJBHomeInterceptor.handleInvocationResult(EJBHomeInterceptor.java:88)
at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:290)
at org.jboss.ejb.client.TransactionInterceptor.handleInvocationResult(TransactionInterceptor.java:46)
at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:290)
at org.jboss.ejb.client.ReceiverInterceptor.handleInvocationResult(ReceiverInterceptor.java:129)
at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:265)
at org.jboss.ejb.client.EJBClientInvocationContext.awaitResponse(EJBClientInvocationContext.java:453)
at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:202)
at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:181)
at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:144)
at com.sun.proxy.$Proxy0.add(Unknown Source)
at com.soteica.som.client.test.SomTestClient.invokeStatelessBean(SomTestClient.java:24)
at com.soteica.som.client.test.SomTestClient.main(SomTestClient.java:16)
Caused by: java.lang.IllegalStateException: PBOX000075: The property AuthorizationManager is null
at org.jboss.security.plugins.javaee.EJBAuthorizationHelper.authorize(EJBAuthorizationHelper.java:298)
at org.jboss.as.security.service.SimpleSecurityManager.authorize(SimpleSecurityManager.java:303)
at org.jboss.as.ejb3.security.AuthorizationInterceptor.processInvocation(AuthorizationInterceptor.java:133)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
at org.jboss.as.ejb3.security.SecurityContextInterceptor.processInvocation(SecurityContextInterceptor.java:95)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
at org.jboss.as.ejb3.component.interceptors.ShutDownInterceptorFactory$1.processInvocation(ShutDownInterceptorFactory.java:64)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:59)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:55)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
at org.jboss.invocation.ContextClassLoaderInterceptor.processInvocation(ContextClassLoaderInterceptor.java:64)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:326)
at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:448)
at org.jboss.invocation.AccessCheckingInterceptor.processInvocation(AccessCheckingInterceptor.java:61)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:326)
at org.jboss.invocation.PrivilegedWithCombinerInterceptor.processInvocation(PrivilegedWithCombinerInterceptor.java:80)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:185)
at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler.invokeMethod(MethodInvocationMessageHandler.java:330)
at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler.access$100(MethodInvocationMessageHandler.java:70)
at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler$1.run(MethodInvocationMessageHandler.java:203)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
at org.jboss.threads.JBossThread.run(JBossThread.java:122)
I can see that the configuration of the security domain "som_security_domain" is used because it runs the query to obtains the password and the roles of the principal, but fails when try to execute a lookup of the AuthenticationManager of the security domain. In log i can see:
[org.jboss.as.security] (EJB default - 1) Look up of JNDI for som_security_domain/authorizationMgr failed with java:jboss not found.
Thanks in advance
The problem was a library of DSOL Simulation Environment in the folder lib (naming-2.0.9.jar). The library included a file jndi.properties. Once i delete the file, all was ok. I can invocate the ejb remote with a annotation of security domain.

IIS8 The Just-In-Time debugger was launched without necessary security permissions

Windows Server 2012 64 bit
IIS8
ASP.NET Framework 4
Trying to run an unmanaged DLL from my aspx page
Executing the DLL Function call gives:
The Just-In-Time debugger was launched without necessary security permissions. To debug this process, the Just-In-Time debugger must be run as an Administrator. Would you like to debug this process?
There is no debugger that I know of on the web server, trying to launch it gives errors.
Why is my call to my DLL crashing my aspnet worker process?
How can I tell IIS8 there is no debugger?
I have googled this extensively, and all the help seems to be about Visual Studio, not IIS. There is no Visual Studio on the web sever.
Here is the offending code.
private string regname = "";
private string fingerprint = "";
private string unlockingcode = "";
/// <summary>
/// called from page_load
/// </summary>
private void CreateUnlockingCode()
{
UInt32 lfp;
string sfp = fingerprint.Remove(4, 1);
lfp = Convert.ToUInt32(sfp, 16);
string bindir = Server.MapPath(#"~/bin/CodeGen64.dll"); //full path to the DLL "P:\\AFI2013\\bin\\CodeGen64.dll"
IntPtr pDll = NativeMethods.LoadLibrary(bindir); //attempt to load the library
try
{
IntPtr pAddressOfFunctionToCall = NativeMethods.GetProcAddress(pDll, "CreateCode2A");
CreateCode2 createCode2 = (CreateCode2)Marshal.GetDelegateForFunctionPointer(
pAddressOfFunctionToCall,
typeof(CreateCode2));
//THIS LINE CRASHES THE ASPNET WORKER PROCESS
unlockingcode = createCode2(1, regname, encrypt_template, lfp, (UInt16)0, (UInt16)0, (UInt16)0, (UInt16)0, (UInt16)0);
}
finally
{
bool result = NativeMethods.FreeLibrary(pDll);
}
}
And here is the Error from the Event Viewer.
Log Name: Application
Source: Application Error
Date: 7/10/2013 11:34:30 AM
Event ID: 1000
Task Category: (100)
Level: Error
Keywords: Classic
User: N/A
Computer: owl.INT.local
Description:
Faulting application name: w3wp.exe, version: 8.0.9200.16384, time stamp: 0x50108835
Faulting module name: ntdll.dll, version: 6.2.9200.16579, time stamp: 0x51637f77
Exception code: 0xc0000374
Fault offset: 0x00000000000ebd59
Faulting process id: 0x2608
Faulting application start time: 0x01ce7d9c1d409343
Faulting application path: c:\windows\system32\inetsrv\w3wp.exe
Faulting module path: C:\Windows\SYSTEM32\ntdll.dll
Report Id: 5b36e881-e98f-11e2-9406-000c2908dae4
Faulting package full name:
Faulting package-relative application ID:
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="Application Error" />
<EventID Qualifiers="0">1000</EventID>
<Level>2</Level>
<Task>100</Task>
<Keywords>0x80000000000000</Keywords>
<TimeCreated SystemTime="2013-07-10T18:34:30.000000000Z" />
<EventRecordID>54586</EventRecordID>
<Channel>Application</Channel>
<Computer>owl.INT.local</Computer>
<Security />
</System>
<EventData>
<Data>w3wp.exe</Data>
<Data>8.0.9200.16384</Data>
<Data>50108835</Data>
<Data>ntdll.dll</Data>
<Data>6.2.9200.16579</Data>
<Data>51637f77</Data>
<Data>c0000374</Data>
<Data>00000000000ebd59</Data>
<Data>2608</Data>
<Data>01ce7d9c1d409343</Data>
<Data>c:\windows\system32\inetsrv\w3wp.exe</Data>
<Data>C:\Windows\SYSTEM32\ntdll.dll</Data>
<Data>5b36e881-e98f-11e2-9406-000c2908dae4</Data>
<Data>
</Data>
<Data>
</Data>
</EventData>
</Event>

spring hibernate sessionFactory NullPointerException

Hi I'm writing an application and I'm getting the following error.
Edit: Complete log
`
Aug 20, 2012 6:37:22 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre7\bin;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;F:\SVN\bin\;F:\SVN\Python25\;C:\Program Files\PHP\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\MySQL\MySQL Server 5.5\bin;D:\apache-ant-1.8.2\bin;C:\Program Files\Java\jdk1.7.0\bin;C:\Program Files\QuickTime\QTSystem\
Aug 20, 2012 6:37:22 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:yogamandir1' did not find a matching property.
Aug 20, 2012 6:37:22 PM org.apache.coyote.AbstractProtocolHandler init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Aug 20, 2012 6:37:23 PM org.apache.coyote.AbstractProtocolHandler init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Aug 20, 2012 6:37:23 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1277 ms
Aug 20, 2012 6:37:23 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Aug 20, 2012 6:37:23 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.8
Aug 20, 2012 6:37:27 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jstl/core_rt is already defined
Aug 20, 2012 6:37:27 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jstl/core is already defined
Aug 20, 2012 6:37:27 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/core is already defined
Aug 20, 2012 6:37:27 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jstl/fmt_rt is already defined
Aug 20, 2012 6:37:27 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jstl/fmt is already defined
Aug 20, 2012 6:37:27 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/fmt is already defined
Aug 20, 2012 6:37:27 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/functions is already defined
Aug 20, 2012 6:37:27 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://jakarta.apache.org/taglibs/standard/permittedTaglibs is already defined
Aug 20, 2012 6:37:27 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://jakarta.apache.org/taglibs/standard/scriptfree is already defined
Aug 20, 2012 6:37:27 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jstl/sql_rt is already defined
Aug 20, 2012 6:37:27 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jstl/sql is already defined
Aug 20, 2012 6:37:27 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/sql is already defined
Aug 20, 2012 6:37:27 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jstl/xml_rt is already defined
Aug 20, 2012 6:37:27 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jstl/xml is already defined
Aug 20, 2012 6:37:27 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/xml is already defined
Aug 20, 2012 6:37:27 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
INFO : org.springframework.web.context.ContextLoader - Root WebApplicationContext: initialization started
INFO : org.springframework.web.context.support.XmlWebApplicationContext - Refreshing Root WebApplicationContext: startup date [Mon Aug 20 18:37:28 IST 2012]; root of context hierarchy
INFO : org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from ServletContext resource [/WEB-INF/spring/root-context.xml]
INFO : org.springframework.beans.factory.support.DefaultListableBeanFactory - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory#d9ceea: defining beans []; root of factory hierarchy
INFO : org.springframework.web.context.ContextLoader - Root WebApplicationContext: initialization completed in 582 ms
Aug 20, 2012 6:37:28 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring FrameworkServlet 'appServlet'
INFO : org.springframework.web.servlet.DispatcherServlet - FrameworkServlet 'appServlet': initialization started
INFO : org.springframework.web.context.support.XmlWebApplicationContext - Refreshing WebApplicationContext for namespace 'appServlet-servlet': startup date [Mon Aug 20 18:37:28 IST 2012]; parent: Root WebApplicationContext
INFO : org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from ServletContext resource [/WEB-INF/spring/appServlet/servlet-context.xml]
INFO : org.springframework.context.annotation.ClassPathBeanDefinitionScanner - JSR-330 'javax.inject.Named' annotation found and supported for component scanning
INFO : org.springframework.beans.factory.config.PropertyPlaceholderConfigurer - Loading properties file from class path resource [jdbc.properties]
INFO : org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor - JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
INFO : org.springframework.beans.factory.support.DefaultListableBeanFactory - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory#659078: defining beans [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping#0,org.springframework.format.support.FormattingConversionServiceFactoryBean#0,org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter#0,org.springframework.web.servlet.handler.MappedInterceptor#0,org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver#0,org.springframework.web.servlet.mvc.annotation.ResponseStatusExceptionResolver#0,org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver#0,org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping,org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter,org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter,org.springframework.web.servlet.resource.ResourceHttpRequestHandler#0,org.springframework.web.servlet.handler.SimpleUrlHandlerMapping#0,org.springframework.web.servlet.view.InternalResourceViewResolver#0,studentDAO,homeController,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalPersistenceAnnotationProcessor,org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping#1,org.springframework.format.support.FormattingConversionServiceFactoryBean#1,org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter#1,org.springframework.web.servlet.handler.MappedInterceptor#1,org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver#1,org.springframework.web.servlet.mvc.annotation.ResponseStatusExceptionResolver#1,org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver#1,org.springframework.beans.factory.config.PropertyPlaceholderConfigurer#0,dataSource,sessionFactory,transactionManager,multipartResolver,org.springframework.aop.config.internalAutoProxyCreator,org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0,org.springframework.transaction.interceptor.TransactionInterceptor#0,org.springframework.transaction.config.internalTransactionAdvisor,org.springframework.context.annotation.ConfigurationClassPostProcessor$ImportAwareBeanPostProcessor#0]; parent: org.springframework.beans.factory.support.DefaultListableBeanFactory#d9ceea
INFO : org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping - Mapped "{[/register],methods=[POST],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.String com.omkar.yogamandir.web.controllers.HomeController.register(java.util.Locale,org.springframework.ui.Model,com.omkar.yogamandir.web.beans.Student,org.springframework.web.multipart.MultipartFile,org.springframework.validation.BindingResult)
INFO : org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping - Mapped "{[/],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.String com.omkar.yogamandir.web.controllers.HomeController.home(java.util.Locale,org.springframework.ui.Model)
INFO : org.springframework.web.servlet.handler.SimpleUrlHandlerMapping - Mapped URL path [/resources/**] onto handler 'org.springframework.web.servlet.resource.ResourceHttpRequestHandler#0'
INFO : org.springframework.jdbc.datasource.DriverManagerDataSource - Loaded JDBC driver: com.mysql.jdbc.Driver
INFO : org.hibernate.cfg.annotations.Version - Hibernate Annotations 3.3.1.GA
INFO : org.hibernate.cfg.Environment - Hibernate 3.2.6
INFO : org.hibernate.cfg.Environment - hibernate.properties not found
INFO : org.hibernate.cfg.Environment - Bytecode provider name : cglib
INFO : org.hibernate.cfg.Environment - using JDK 1.4 java.sql.Timestamp handling
INFO : org.hibernate.cfg.AnnotationBinder - Binding entity from annotated class: com.omkar.yogamandir.entity.beans.BatchDTO
INFO : org.hibernate.cfg.annotations.EntityBinder - Bind entity com.omkar.yogamandir.entity.beans.BatchDTO on table batch
INFO : org.hibernate.cfg.AnnotationBinder - Binding entity from annotated class: com.omkar.yogamandir.entity.beans.StudentDTO
INFO : org.hibernate.cfg.annotations.EntityBinder - Bind entity com.omkar.yogamandir.entity.beans.StudentDTO on table student
INFO : org.hibernate.cfg.AnnotationConfiguration - Hibernate Validator not found: ignoring
INFO : org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean - Building new Hibernate SessionFactory
INFO : org.hibernate.connection.ConnectionProviderFactory - Initializing connection provider: org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider
INFO : org.hibernate.cfg.SettingsFactory - RDBMS: MySQL, version: 5.5.8
INFO : org.hibernate.cfg.SettingsFactory - JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-5.1.15 ( Revision: ${bzr.revision-id} )
INFO : org.hibernate.dialect.Dialect - Using dialect: org.hibernate.dialect.MySQLDialect
INFO : org.hibernate.transaction.TransactionFactoryFactory - Transaction strategy: org.springframework.orm.hibernate3.SpringTransactionFactory
INFO : org.hibernate.transaction.TransactionManagerLookupFactory - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
INFO : org.hibernate.cfg.SettingsFactory - Automatic flush during beforeCompletion(): disabled
INFO : org.hibernate.cfg.SettingsFactory - Automatic session close at end of transaction: disabled
INFO : org.hibernate.cfg.SettingsFactory - JDBC batch size: 15
INFO : org.hibernate.cfg.SettingsFactory - JDBC batch updates for versioned data: disabled
INFO : org.hibernate.cfg.SettingsFactory - Scrollable result sets: enabled
INFO : org.hibernate.cfg.SettingsFactory - JDBC3 getGeneratedKeys(): enabled
INFO : org.hibernate.cfg.SettingsFactory - Connection release mode: auto
INFO : org.hibernate.cfg.SettingsFactory - Maximum outer join fetch depth: 2
INFO : org.hibernate.cfg.SettingsFactory - Default batch fetch size: 1
INFO : org.hibernate.cfg.SettingsFactory - Generate SQL with comments: disabled
INFO : org.hibernate.cfg.SettingsFactory - Order SQL updates by primary key: disabled
INFO : org.hibernate.cfg.SettingsFactory - Order SQL inserts for batching: disabled
INFO : org.hibernate.cfg.SettingsFactory - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
INFO : org.hibernate.hql.ast.ASTQueryTranslatorFactory - Using ASTQueryTranslatorFactory
INFO : org.hibernate.cfg.SettingsFactory - Query language substitutions: {}
INFO : org.hibernate.cfg.SettingsFactory - JPA-QL strict compliance: disabled
INFO : org.hibernate.cfg.SettingsFactory - Second-level cache: enabled
INFO : org.hibernate.cfg.SettingsFactory - Query cache: disabled
INFO : org.hibernate.cfg.SettingsFactory - Cache provider: org.hibernate.cache.NoCacheProvider
INFO : org.hibernate.cfg.SettingsFactory - Optimize cache for minimal puts: disabled
INFO : org.hibernate.cfg.SettingsFactory - Structured second-level cache entries: disabled
INFO : org.hibernate.cfg.SettingsFactory - Echoing all SQL to stdout
INFO : org.hibernate.cfg.SettingsFactory - Statistics: disabled
INFO : org.hibernate.cfg.SettingsFactory - Deleted entity synthetic identifier rollback: disabled
INFO : org.hibernate.cfg.SettingsFactory - Default entity-mode: pojo
INFO : org.hibernate.cfg.SettingsFactory - Named query checking : enabled
INFO : org.hibernate.impl.SessionFactoryImpl - building session factory
INFO : org.hibernate.impl.SessionFactoryObjectFactory - Not binding factory to JNDI, no JNDI name configured
INFO : org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping - Mapped "{[/register],methods=[POST],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.String com.omkar.yogamandir.web.controllers.HomeController.register(java.util.Locale,org.springframework.ui.Model,com.omkar.yogamandir.web.beans.Student,org.springframework.web.multipart.MultipartFile,org.springframework.validation.BindingResult)
INFO : org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping - Mapped "{[/],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.String com.omkar.yogamandir.web.controllers.HomeController.home(java.util.Locale,org.springframework.ui.Model)
INFO : org.springframework.orm.hibernate3.HibernateTransactionManager - Using DataSource [org.springframework.jdbc.datasource.DriverManagerDataSource#89eb77] of Hibernate SessionFactory for HibernateTransactionManager
INFO : org.springframework.web.servlet.DispatcherServlet - FrameworkServlet 'appServlet': initialization completed in 6021 ms
Aug 20, 2012 6:37:34 PM org.apache.coyote.AbstractProtocolHandler start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Aug 20, 2012 6:37:34 PM org.apache.coyote.AbstractProtocolHandler start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Aug 20, 2012 6:37:34 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 11556 ms
INFO : com.omkar.yogamandir.web.controllers.HomeController - Welcome home! the client locale is en_US
INFO : com.omkar.yogamandir.web.controllers.HomeController - Welcome home! the client locale is en_US
INFO : com.omkar.yogamandir.web.controllers.HomeController - Student Registration!
INFO : com.omkar.yogamandir.entity.dao.StudentDAO - Start: saveStudent() in StudentDAO class
java.lang.NullPointerException
at com.omkar.yogamandir.entity.dao.StudentDAO.saveStudent(StudentDAO.java:27)
at com.omkar.yogamandir.business.StudentBusinessAdapter.insertStudent(StudentBusinessAdapter.java:30)
at com.omkar.yogamandir.web.controllers.HomeController.register(HomeController.java:59)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:213)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:126)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:96)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:617)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:578)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:789)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:306)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:541)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:383)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:243)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:166)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:288)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
`
My StudentDAO class:
`package com.omkar.yogamandir.entity.dao;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
import com.omkar.yogamandir.entity.beans.StudentDTO;
#Repository
#Transactional
public class StudentDAO {
private static final Logger logger = LoggerFactory
.getLogger(StudentDAO.class);
#Autowired
private SessionFactory sessionFactory;
public void saveStudent(StudentDTO studentDTO) {
try{
logger.info("Start: saveStudent() in StudentDAO class");
Session session = sessionFactory.getCurrentSession();
session.save(studentDTO);
logger.info("Successfully saved the student!!!");
} catch(Exception e){
e.printStackTrace();
}
}
}`
servlet-context.xml
`<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/mvc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">
<!-- DispatcherServlet Context: defines this servlet's request-processing
infrastructure -->
<!-- Enables the Spring MVC #Controller programming model -->
<annotation-driven />
<!-- Handles HTTP GET requests for /resources/** by efficiently serving
up static resources in the ${webappRoot}/resources directory -->
<resources mapping="/resources/**" location="/resources/" />
<!-- Resolves views selected for rendering by #Controllers to .jsp resources
in the /WEB-INF/views directory -->
<beans:bean
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<beans:property name="prefix" value="/WEB-INF/views/" />
<beans:property name="suffix" value=".jsp" />
</beans:bean>
<context:component-scan base-package="com.omkar.yogamandir" />
<annotation-driven />
<context:property-placeholder location="classpath:jdbc.properties"></context:property-placeholder>
<beans:bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<beans:property name="driverClassName" value="${jdbc.driverClassName}" />
<beans:property name="url" value="${jdbc.url}" />
<beans:property name="username" value="${jdbc.username}" />
<beans:property name="password" value="${jdbc.password}" />
</beans:bean>
<beans:bean id="sessionFactory"
class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<beans:property name="dataSource" ref="dataSource"></beans:property>
<beans:property name="hibernateProperties">
<beans:props>
<beans:prop key="hibernate.dialect">${hibernate.dialect}</beans:prop>
<beans:prop key="hibernate.show_sql">${hibernate.show_sql}</beans:prop>
</beans:props>
</beans:property>
<beans:property name="packagesToScan" value="com.omkar.yogamandir"></beans:property>
</beans:bean>
<beans:bean id="transactionManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<beans:property name="sessionFactory" ref="sessionFactory"></beans:property>
</beans:bean>
<beans:bean id="multipartResolver"
class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
<beans:property name="maxUploadSize" value="5000000" />
</beans:bean>
<tx:annotation-driven />
</beans:beans>`
I have all the required jars in classpath. Please have a look at this issue.
sessionFactory is null when I use sessionFactory.getCurrentSession();
You couldn't inject the sessionFactory to studentDAO calss. Check on it

Resources