wso2 apimanager 1.7 Publishing HTTPS API - wso2-api-manager

Using API Manager 1.7 I have published a public API that I want subscribers to access using only HTTPS. When configuring the API I set the Transports as https only and point at a valid Rest URL for example https://en.wikipedia.org/w/api.php
When I subscribe to the API from the API Manager Store I see my API but it has both http and https endpoints available even though I only specified https.
http://192.168.104.42:8280/wiki/1.0.0
https://192.168.104.42:8243/wiki/1.0.0
When I subscribe to the API and test using the built in REST Client or standalone via CURL I am able to access the HTTP endpoint successfully but get a 403 Forbidden when I try and access the HTTPS endpoint. Any help resolving this issue is much appreciated?
In the server logs I see:
[2014-07-08 16:13:34,339] ERROR - XMLHttpRequestHostObject Stream closed
java.io.IOException: Stream closed
at java.io.BufferedInputStream.getBufIfOpen(BufferedInputStream.java:162
)
at java.io.BufferedInputStream.read(BufferedInputStream.java:325)
at org.apache.commons.httpclient.ContentLengthInputStream.read(ContentLe
ngthInputStream.java:170)
at java.io.FilterInputStream.read(FilterInputStream.java:133)
at org.apache.commons.httpclient.AutoCloseInputStream.read(AutoCloseInpu
tStream.java:108)
at java.io.FilterInputStream.read(FilterInputStream.java:107)
at org.apache.commons.httpclient.AutoCloseInputStream.read(AutoCloseInpu
tStream.java:127)
at org.apache.commons.httpclient.HttpMethodBase.getResponseBody(HttpMeth
odBase.java:690)
at org.jaggeryjs.hostobjects.xhr.XMLHttpRequestHostObject.executeRequest
(XMLHttpRequestHostObject.java:528)
at org.jaggeryjs.hostobjects.xhr.XMLHttpRequestHostObject.send(XMLHttpRe
questHostObject.java:517)
at org.jaggeryjs.hostobjects.xhr.XMLHttpRequestHostObject.jsFunction_sen
d(XMLHttpRequestHostObject.java:278)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:126)
at org.mozilla.javascript.FunctionObject.call(FunctionObject.java:386)
at org.mozilla.javascript.optimizer.OptRuntime.callProp0(OptRuntime.java
:85)
at org.jaggeryjs.rhino.store.site.blocks.api.tryit.ajax.c0._c_anonymous_
1(/store/site/blocks/api/tryit/ajax/api-tryit.jag:42)
at org.jaggeryjs.rhino.store.site.blocks.api.tryit.ajax.c0.call(/store/s
ite/blocks/api/tryit/ajax/api-tryit.jag)
at org.mozilla.javascript.optimizer.OptRuntime.call0(OptRuntime.java:23)
at org.jaggeryjs.rhino.store.site.blocks.api.tryit.ajax.c0._c_script_0(/
store/site/blocks/api/tryit/ajax/api-tryit.jag:5)
at org.jaggeryjs.rhino.store.site.blocks.api.tryit.ajax.c0.call(/store/s
ite/blocks/api/tryit/ajax/api-tryit.jag)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:3
94)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:309
1)
at org.jaggeryjs.rhino.store.site.blocks.api.tryit.ajax.c0.call(/store/s
ite/blocks/api/tryit/ajax/api-tryit.jag)
at org.jaggeryjs.rhino.store.site.blocks.api.tryit.ajax.c0.exec(/store/s
ite/blocks/api/tryit/ajax/api-tryit.jag)
at org.jaggeryjs.scriptengine.engine.RhinoEngine.execScript(RhinoEngine.
java:570)
at org.jaggeryjs.scriptengine.engine.RhinoEngine.exec(RhinoEngine.java:2
73)
at org.jaggeryjs.jaggery.core.manager.WebAppManager.execute(WebAppManage
r.java:432)
at org.jaggeryjs.jaggery.core.JaggeryServlet.doPost(JaggeryServlet.java:
29)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:755)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:210)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDisp
atcher.java:749)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(Applica
tionDispatcher.java:487)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationD
ispatcher.java:379)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDis
patcher.java:339)
at org.jaggeryjs.jaggery.core.JaggeryFilter.doFilter(JaggeryFilter.java:
21)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authentica
torBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:99)
at org.wso2.carbon.tomcat.ext.valves.CompositeValve.continueInvocation(C
ompositeValve.java:178)
at org.wso2.carbon.tomcat.ext.valves.CarbonTomcatValve$1.invoke(CarbonTo
mcatValve.java:47)
at org.wso2.carbon.webapp.mgt.TenantLazyLoaderValve.invoke(TenantLazyLoa
derValve.java:56)
at org.wso2.carbon.tomcat.ext.valves.TomcatValveContainer.invokeValves(T
omcatValveContainer.java:47)
at org.wso2.carbon.tomcat.ext.valves.CompositeValve.invoke(CompositeValv
e.java:141)
at org.wso2.carbon.tomcat.ext.valves.CarbonStuckThreadDetectionValve.inv
oke(CarbonStuckThreadDetectionValve.java:156)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:
936)
at org.wso2.carbon.tomcat.ext.valves.CarbonContextCreatorValve.invoke(Ca
rbonContextCreatorValve.java:52)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
a:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp
11Processor.java:1004)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(
AbstractProtocol.java:589)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoin
t.java:1653)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:615)
at java.lang.Thread.run(Thread.java:744)

Related

ERROR - DataEndpointConnectionWorker Error while trying to connect to the endpoint. Cannot borrow client for ssl://localhost:7712

There was two similar question in stackoverflow but cloud't help me to solve the probelm.
I want to use loadbalancing for two nodes of wso2 api manager 3.2.0 using Nginx. I configured api manager as following :
could you please guide me?
[transport.https.properties]
proxyPort = 443
[server]
hostname = "api.am.wso2.com"
node_ip = "127.0.0.1"
#offset=0
mode = "single" #single or ha
[super_admin]
username = "admin"
password = "admin"
create_admin_account = true
[user_store]
type = "database_unique_id"
[apim.throttling]
event_duplicate_url = ["tcp://172.24.64.115:5673"]
[[apim.throttling.url_group]]
traffic_manager_urls = ["tcp://172.24.64.114:9611"]
traffic_manager_auth_urls = ["ssl://172.24.64.114:9711"]
type = "loadbalance"
[[apim.throttling.url_group]]
traffic_manager_urls = ["tcp://172.24.64.115:9612"]
traffic_manager_auth_urls = ["ssl://172.24.64.115:9712"]
type = "loadbalance"
[apim.analytics]
enable = true
store_api_url = "https://localhost:7444"
#username = "$ref{super_admin.username}"
#password = "$ref{super_admin.password}"
event_publisher_type = "default"
event_publisher_impl = "org.wso2.carbon.apimgt.usage.publisher.APIMgtUsageDataBridgeDataPublisher"
publish_response_size = true
[[apim.analytics.url_group]]
analytics_url =["tcp://172.25.129.69:7611","tcp://172.25.129.70:7611"]
analytics_auth_url =["ssl://172.25.129.69:7711","ssl://172.25.129.70:7711"]
type = "loadbalance"
#[[apim.analytics.url_group]]
#analytics_url =["tcp://analytics1:7612","tcp://analytics2:7612"]
#analytics_auth_url =["ssl://analytics1:7712","ssl://analytics2:7712"]
#type = "failover"
.
While ruuning wso2server.sh faced following exception :
StandardEngine[Catalina].StandardHost[localhost].StandardContext[/keymanager-operations].File[/opt/v1/wso2am-3.2.0/repository/deployment/server/webapps/keymanager-operations.war]
[2021-07-28 16:29:32,729] WARN - DataEndpointGroup No receiver is reachable at reconnection, will try to reconnect every 30 sec
[2021-07-28 16:29:32,732] ERROR - DataEndpointConnectionWorker Error while trying to connect to the endpoint. Cannot borrow client for ssl://localhost:7712
org.wso2.carbon.databridge.agent.exception.DataEndpointAuthenticationException: Cannot borrow client for ssl://localhost:7712
at org.wso2.carbon.databridge.agent.endpoint.DataEndpointConnectionWorker.connect(DataEndpointConnectionWorker.java:147) ~[org.wso2.carbon.databridge.agent_5.2.26.jar:?]
at org.wso2.carbon.databridge.agent.endpoint.DataEndpointConnectionWorker.run(DataEndpointConnectionWorker.java:59) [org.wso2.carbon.databridge.agent_5.2.26.jar:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_291]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_291]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_291]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_291]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_291]
Caused by: org.wso2.carbon.databridge.agent.exception.DataEndpointSecurityException: Error while trying to connect to ssl://localhost:7712
at org.wso2.carbon.databridge.agent.endpoint.thrift.ThriftSecureClientPoolFactory.createClient(ThriftSecureClientPoolFactory.java:81) ~[org.wso2.carbon.databridge.agent_5.2.26.jar:?]
at org.wso2.carbon.databridge.agent.client.AbstractClientPoolFactory.makeObject(AbstractClientPoolFactory.java:39) ~[org.wso2.carbon.databridge.agent_5.2.26.jar:?]
at org.apache.commons.pool.impl.GenericKeyedObjectPool.borrowObject(GenericKeyedObjectPool.java:1212) ~[commons-pool_1.5.6.wso2v1.jar:?]
at org.wso2.carbon.databridge.agent.endpoint.DataEndpointConnectionWorker.connect(DataEndpointConnectionWorker.java:137) ~[org.wso2.carbon.databridge.agent_5.2.26.jar:?]
... 6 more
Caused by: org.apache.thrift.transport.TTransportException: Could not connect to localhost on port 7712
at org.apache.thrift.transport.TSSLTransportFactory.createClient(TSSLTransportFactory.java:273) ~[libthrift_0.12.0.wso2v1.jar:?]
at org.apache.thrift.transport.TSSLTransportFactory.getClientSocket(TSSLTransportFactory.java:173) ~[libthrift_0.12.0.wso2v1.jar:?]
at org.wso2.carbon.databridge.agent.endpoint.thrift.ThriftSecureClientPoolFactory.createClient(ThriftSecureClientPoolFactory.java:64) ~[org.wso2.carbon.databridge.agent_5.2.26.jar:?]
at org.wso2.carbon.databridge.agent.client.AbstractClientPoolFactory.makeObject(AbstractClientPoolFactory.java:39) ~[org.wso2.carbon.databridge.agent_5.2.26.jar:?]
at org.apache.commons.pool.impl.GenericKeyedObjectPool.borrowObject(GenericKeyedObjectPool.java:1212) ~[commons-pool_1.5.6.wso2v1.jar:?]
at org.wso2.carbon.databridge.agent.endpoint.DataEndpointConnectionWorker.connect(DataEndpointConnectionWorker.java:137) ~[org.wso2.carbon.databridge.agent_5.2.26.jar:?]
... 6 more
Caused by: java.net.ConnectException: Connection refused (Connection refused)
at java.net.PlainSocketImpl.socketConnect(Native Method) ~[?:1.8.0_291]
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:476) ~[?:1.8.0_291]
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:218) ~[?:1.8.0_291]
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:200) ~[?:1.8.0_291]
Server (69) & Server(70) as following:
# Carbon Configuration Parameters
wso2.carbon:
type: wso2-apim-analytics
# value to uniquely identify a server
id: wso2-am-analytics
# server name
name: WSO2 API Manager Analytics Server
# ports used by this server
ports:
# port offset
offset: 1
wso2.transport.http:
transportProperties:
-
name: "server.bootstrap.socket.timeout"
value: 60
-
name: "client.bootstrap.socket.timeout"
value: 60
-
name: "latency.metrics.enabled"
value: true
-
# Data receiver configuration
dataReceiver:
# Data receiver type
# THIS IS A MANDATORY FIELD
type: Thrift
# Data receiver properties
properties:
tcpPort: '7611'
sslPort: '7711'
-
# Data receiver configuration
dataReceiver:
# Data receiver type
# THIS IS A MANDATORY FIELD
type: Binary
# Data receiver properties
properties:
tcpPort: '9611'
sslPort: '9711'
tcpReceiverThreadPoolSize: '100'
sslReceiverThreadPoolSize: '100'
hostName: 0.0.0.0
Clould you please help me ?
If you have configured the Analytics node with an offset than the default, it is required to configure both analytics_url and analytics_auth_url under apim.analytics.url_group configuration pointing to the correct Hostname and Ports of the Analytics server.
To fail to do so, we can observe the above-mentioned Connection Refused error in the API Manager side, as it was trying to communicate with the Analytics and there aren't any ports opened to listen to the communication channel. Therefore, please make sure that you have configured the analytics_url and analytics_auth_url pointing to the Analytics node in both of your API Manager nodes. You can refer to the following docs for instructions.

Can't get management instance of graph

I connect to gremlin server from gremlin console:
:remote connect tinkerpop.server config/connect_config.yaml
I can execute queries like:
:> graph.getGraphName()
:> g.V().count().next()
:> g.V().drop().iterate()
:> g.V().values('LOL')
and many others. g - GraphTraversalSource, graph - StandardJanusGraph.
I need to configure schema of graph:
:> mg = graph.openManagenet()
but when i try to execute this query, i get exception:
gremlin> :> mngmt = graph.openManagement()
Server could not serialize the result requested. Server error - Error during serialization: Class is not registered: org.janusgraph.graphdb.database.management.ManagementSystem
Note: To register this class use: kryo.register(org.janusgraph.graphdb.database.management.ManagementSystem.class);. Note that the class must be serializable by the client and server for proper operation.
Type ':help' or ':h' for help.
Display stack trace? [yN]y
org.apache.tinkerpop.gremlin.groovy.plugin.RemoteException: Server could not serialize the result requested. Server error - Error during serialization: Class is not registered: org.janusgraph.graphdb.database.management.ManagementSystem
Note: To register this class use: kryo.register(org.janusgraph.graphdb.database.management.ManagementSystem.class);. Note that the class must be serializable by the client and server for proper operation.
at org.apache.tinkerpop.gremlin.console.groovy.plugin.DriverRemoteAcceptor.submit(DriverRemoteAcceptor.java:186)
at org.apache.tinkerpop.gremlin.console.commands.SubmitCommand.execute(SubmitCommand.groovy:41)
at org.codehaus.groovy.tools.shell.Shell.execute(Shell.groovy:104)
at org.codehaus.groovy.tools.shell.Groovysh.super$2$execute(Groovysh.groovy)
at sun.reflect.GeneratedMethodAccessor15.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1225)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:145)
at org.codehaus.groovy.tools.shell.Groovysh.executeCommand(Groovysh.groovy:273)
at org.codehaus.groovy.tools.shell.Groovysh.execute(Groovysh.groovy:164)
at org.apache.tinkerpop.gremlin.console.GremlinGroovysh.super$3$execute(GremlinGroovysh.groovy)
at sun.reflect.GeneratedMethodAccessor14.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1225)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:145)
at org.apache.tinkerpop.gremlin.console.GremlinGroovysh.execute(GremlinGroovysh.groovy:72)
at org.codehaus.groovy.tools.shell.Shell.leftShift(Shell.groovy:122)
at org.codehaus.groovy.tools.shell.ShellRunner.work(ShellRunner.groovy:95)
at org.codehaus.groovy.tools.shell.InteractiveShellRunner.super$2$work(InteractiveShellRunner.groovy)
at sun.reflect.GeneratedMethodAccessor35.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1225)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:145)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:165)
at org.codehaus.groovy.tools.shell.InteractiveShellRunner.work(InteractiveShellRunner.groovy:130)
at org.codehaus.groovy.tools.shell.ShellRunner.run(ShellRunner.groovy:59)
at org.codehaus.groovy.tools.shell.InteractiveShellRunner.super$2$run(InteractiveShellRunner.groovy)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1225)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:145)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:165)
at org.codehaus.groovy.tools.shell.InteractiveShellRunner.run(InteractiveShellRunner.groovy:89)
at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:236)
at org.apache.tinkerpop.gremlin.console.Console.<init>(Console.groovy:169)
at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:236)
at org.apache.tinkerpop.gremlin.console.Console.main(Console.groovy:481)
Can somebody say me what i must do to fix this problem?
I'm not sure that the ManagementSystem is serializable so that's why you are getting that error. There are at least two ways to sort it out. First, you didn't post what is in your config/connect_config.yaml but I assume it is not using this sort of configuration option for the serializer:
hosts: [localhost]
port: 8182
serializer: { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0, config: { serializeResultToString: true }}
By using the serializeResultToString option (and assuming that serializer is configured in Gremlin Server in its configuration) you tell Gremlin Server to take any result you get and call toString() on it before it is returned. In that way, you never get serialization errors.
But, the downside is that you only get String values back. Generally speaking, I would think that is ok for most Gremlin Console interactions (especially administrative ones like the one you are trying to execute with the ManagementSystem API. So, if you wanted to continue using your current configuration which tries to serialize actual "objects" you just need to be sure your scripts only return data that is serializable so instead of:
:> mg = graph.openManagement()
do
:> mg = graph.openManagement();[]
which doesn't return mg, but rather an empty list.

error in JSF deployment with external JAR

I try to add an external JAR library to my JSF project.
My Project structure Looks like this:
XXX (EAR)
XXXWeb
XXXEJB
When I deploy my Project I get the following error from my Wildfly 10.1 console:
15:42:52,338 WARN [org.jboss.modules] (default task-185) Failed to define class de.sqs.topInterface.IAPIException in Module "deployment.sqs-selfservice.ear.sqs-selfserviceWeb.war:main" from Service Module Loader: java.lang.NoClassDefFoundError: Failed to link de/sqs/topInterface/IAPIException (Module "deployment.sqs-selfservice.ear.sqs-selfserviceWeb.war:main" from Service Module Loader): org/omg/CORBA/UserException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:446)
at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:274)
at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:78)
at org.jboss.modules.Module.loadModuleClass(Module.java:606)
15:42:52,338 ERROR [org.jboss.as.ejb3.invocation] (default task-185) WFLYEJB0034: EJB Invocation failed on component SQSBean for method public java.lang.String de.ruv.sqs usc.web.beans.SQSBean.connect(): javax.ejb.EJBException: WFLYEJB0442: Unexpected Error
at org.jboss.as.ejb3.tx.CMTTxInterceptor.handleExceptionInOurTx(CMTTxInterceptor.java:184)
at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:277)
at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:327)
at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:239)
Caused by: java.lang.NoClassDefFoundError: Failed to link de/sqs/topInterface/IAPIException (Module "deployment.sqs-selfservice.ear.sqs-selfserviceWeb.war:main" from Service Module Loader): org/omg/CORBA/UserException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:446)
at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:274)
at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:78)
at org.jboss.modules.Module.loadModuleClass(Module.java:606)
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:363)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:351)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:93)
at de.ruv.sqsusc.web.beans.SQSBean.connect(SQSBean.java:23)
SQSBean.java:
import de.ruv.sqs.connector.SQS_Connector;
#Stateless
#Named("sqs")
public class SQSBean {
public String connect() {
SQS_Connector sc = new SQS_Connector(); // <<-- 23
}
}
At first I tried to add the libraries to EJB. After that I added it to WEB-INF/lib and to EAR/lib. But the error remains the same.
So where and how do I have to include external JAR library files with a common Software API to have access to them in my JSF Webaplication?
If you have an example or how to, it would be very, very nice!
Thank you!

Classloader issue with Spring and Websphere

I'm trying to configure My App which is using Spring MVC, and Hibernate one Websphere application Server V8.5. Once I start Websphere application server. I get CalssNotFoundException for all Spring Classes. Seems like WAS in unable to find my Sping Classes. I have checked and Spring Jars are been added to Lib, also it's been added to classpath. Please also note that application is working fine with Apache Tomcat, I'm getting these exceptions when I start WAS only.
[10/20/14 14:49:40:675 EET] 0000005a InjectionProc W CWNEN0047W: Resource annotations on the fields of the org.springframework.web.servlet.FrameworkServlet class will be ignored. The annotations could not be obtained because of the exception : java.lang.NoClassDefFoundError: org.springframework.web.context.WebApplicationContext
at java.lang.Class.getDeclaredFieldsImpl(Native Method)
at java.lang.Class.getDeclaredFields(Class.java:568)
at com.ibm.wsspi.injectionengine.InjectionProcessor.getAllDeclaredFields(InjectionProcessor.java:554)
at com.ibm.wsspi.injectionengine.InjectionProcessor.processAllAnnotations(InjectionProcessor.java:722)
at com.ibm.wsspi.injectionengine.InjectionProcessorContextImpl.processAllAnnotations(InjectionProcessorContextImpl.java:50)
at com.ibm.ws.injectionengine.AbstractInjectionEngine.processAnnotations(AbstractInjectionEngine.java:727)
at com.ibm.ws.injectionengine.AbstractInjectionEngine.processInjectionMetaData(AbstractInjectionEngine.java:536)
at com.ibm.ws.injectionengine.SharedInjectionEngineImpl.processInjectionMetaData(SharedInjectionEngineImpl.java:208)
at com.ibm.ws.injectionengine.ReferenceContextImpl.process(ReferenceContextImpl.java:835)
at com.ibm.ws.webcontainer.webapp.WebAppImpl.populateJavaNameSpace(WebAppImpl.java:1112)
at com.ibm.ws.webcontainer.webapp.WebAppImpl.initialize(WebAppImpl.java:328)
at com.ibm.ws.webcontainer.webapp.WebGroupImpl.addWebApplication(WebGroupImpl.java:88)
at com.ibm.ws.webcontainer.VirtualHostImpl.addWebApplication(VirtualHostImpl.java:169)
at com.ibm.ws.webcontainer.WSWebContainer.addWebApp(WSWebContainer.java:746)
at com.ibm.ws.webcontainer.WSWebContainer.addWebApplication(WSWebContainer.java:634)
at com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:426)
at com.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImpl.java:718)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1170)
at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1370)
at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:638)
at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:968)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:769)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplicationDynamically(ApplicationMgrImpl.java:1364)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:2169)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:445)
at com.ibm.ws.runtime.component.CompositionUnitImpl.start(CompositionUnitImpl.java:123)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:388)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.access$500(CompositionUnitMgrImpl.java:116)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl$1.run(CompositionUnitMgrImpl.java:663)
at com.ibm.ws.security.auth.ContextManagerImpl.runAs(ContextManagerImpl.java:5339)
at com.ibm.ws.security.auth.ContextManagerImpl.runAsSystem(ContextManagerImpl.java:5555)
at com.ibm.ws.security.core.SecurityContext.runAsSystem(SecurityContext.java:255)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.startCompositionUnit(CompositionUnitMgrImpl.java:677)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.startCompositionUnit(CompositionUnitMgrImpl.java:621)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:1256)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:88)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
at java.lang.reflect.Method.invoke(Method.java:613)
at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:67)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:88)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
at java.lang.reflect.Method.invoke(Method.java:613)
at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:275)
at javax.management.modelmbean.RequiredModelMBean.invokeMethod(RequiredModelMBean.java:1196)
at javax.management.modelmbean.RequiredModelMBean.invoke(RequiredModelMBean.java:1060)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:831)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:803)
at com.ibm.ws.management.AdminServiceImpl$1.run(AdminServiceImpl.java:1335)
at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118)
at com.ibm.ws.management.AdminServiceImpl.invoke(AdminServiceImpl.java:1228)
at com.ibm.ws.management.application.AppManagementImpl._startApplication(AppManagementImpl.java:1482)
at com.ibm.ws.management.application.AppManagementImpl.startApplication(AppManagementImpl.java:1371)
at com.ibm.ws.management.application.AppManagementImpl.startApplication(AppManagementImpl.java:1320)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:88)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
at java.lang.reflect.Method.invoke(Method.java:613)
at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:67)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:88)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
at java.lang.reflect.Method.invoke(Method.java:613)
at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:275)
at javax.management.modelmbean.RequiredModelMBean.invokeMethod(RequiredModelMBean.java:1196)
at javax.management.modelmbean.RequiredModelMBean.invoke(RequiredModelMBean.java:1060)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:831)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:803)
at com.ibm.ws.management.AdminServiceImpl$1.run(AdminServiceImpl.java:1335)
at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118)
at com.ibm.ws.management.AdminServiceImpl.invoke(AdminServiceImpl.java:1228)
at com.ibm.ws.management.connector.AdminServiceDelegator.invoke(AdminServiceDelegator.java:181)
at com.ibm.ws.management.connector.ipc.CallRouter.route(CallRouter.java:247)
at com.ibm.ws.management.connector.ipc.IPCConnectorInboundLink.doWork(IPCConnectorInboundLink.java:360)
at com.ibm.ws.management.connector.ipc.IPCConnectorInboundLink$IPCConnectorReadCallback.complete(IPCConnectorInboundLink.java:602)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1783)
Caused by: java.lang.ClassNotFoundException: org.springframework.web.context.WebApplicationContext
at java.net.URLClassLoader.findClass(URLClassLoader.java:599)
at com.ibm.ws.bootstrap.ExtClassLoader.findClass(ExtClassLoader.java:198)
at java.lang.ClassLoader.loadClassHelper(ClassLoader.java:711)
at java.lang.ClassLoader.loadClass(ClassLoader.java:688)
at com.ibm.ws.bootstrap.ExtClassLoader.loadClass(ExtClassLoader.java:113)
at java.lang.ClassLoader.loadClass(ClassLoader.java:658)
at com.ibm.ws.classloader.ProtectionClassLoader.loadClass(ProtectionClassLoader.java:62)
at com.ibm.ws.classloader.ProtectionClassLoader.loadClass(ProtectionClassLoader.java:58)
at com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java:615)
at java.lang.ClassLoader.loadClass(ClassLoader.java:658)
at com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java:583)
at java.lang.ClassLoader.loadClass(ClassLoader.java:658)
If by /lib you mean WEB-INF/lib then you simply need to change the class loading policy for this web module on the IBM WebSphere Application Server to use parent last, i.e. it will first look for the classes provided within the application.
http://www-01.ibm.com/support/knowledgecenter/SSAW57_8.5.5/com.ibm.websphere.nd.iseries.doc/ae/trun_classload_web.html

spring blazeds integration: IllegalArgumentException: ServletContext must not be null

I am trying to get dpHibernate 2.0 RC6 running on an Apache Tomcat 7.0.12 with BlazeDS 4.0.0.14931, Spring 3.0.5 and Spring-BlazeDS-Integration 1.5.0.M2
I got pretty far with my configuration, the services are parsed fine, annotation based Entities and Datamodel are good, I can list the services in FlashBuilder DCD, but as soon as I am calling a service method (just a simple void method) the server returns following Exception. Not really sure where in my configuration I could have missed something, as I understood from the docs the rest is auto wired.
{operation})****************getAll
{invoke} 6823
java.lang.IllegalArgumentException: ServletContext must not be null
at org.springframework.util.Assert.notNull(Assert.java:112)
at org.springframework.web.context.support.WebApplicationContextUtils.getWebApplicationContext(WebApplicationContextUtils.java:109)
at org.springframework.web.context.support.WebApplicationContextUtils.getWebApplicationContext(WebApplicationContextUtils.java:99)
at org.springframework.web.context.support.WebApplicationContextUtils.getRequiredWebApplicationContext(WebApplicationContextUtils.java:82)
at org.dphibernate.serialization.SpringContextSerializerFactory.getContextReference(SpringContextSerializerFactory.java:111)
at org.dphibernate.serialization.SpringContextSerializerFactory.getSerializerContextReference(SpringContextSerializerFactory.java:65)
at org.dphibernate.serialization.SpringContextSerializerFactory.getSerializer(SpringContextSerializerFactory.java:56)
at org.dphibernate.serialization.SpringContextSerializerFactory.getSerializer(SpringContextSerializerFactory.java:51)
at org.dphibernate.adapters.RemotingAdapter.invoke(RemotingAdapter.java:132)
at flex.messaging.services.RemotingService.serviceMessage(RemotingService.java:183)
at flex.messaging.MessageBroker.routeMessageToService(MessageBroker.java:1400)
at flex.messaging.endpoints.AbstractEndpoint.serviceMessage(AbstractEndpoint.java:1005)
at flex.messaging.endpoints.AbstractEndpoint$$FastClassByCGLIB$$1a3ef066.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:191)
at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:688)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.flex.core.MessageInterceptionAdvice.invoke(MessageInterceptionAdvice.java:66)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.adapter.ThrowsAdviceInterceptor.invoke(ThrowsAdviceInterceptor.java:124)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.Cglib2AopProxy$FixedChainStaticTargetInterceptor.intercept(Cglib2AopProxy.java:572)
at flex.messaging.endpoints.AMFEndpoint$$EnhancerByCGLIB$$5dafba90.serviceMessage(<generated>)
at flex.messaging.endpoints.amf.MessageBrokerFilter.invoke(MessageBrokerFilter.java:103)
at flex.messaging.endpoints.amf.LegacyFilter.invoke(LegacyFilter.java:158)
at flex.messaging.endpoints.amf.SessionFilter.invoke(SessionFilter.java:44)
at flex.messaging.endpoints.amf.BatchProcessFilter.invoke(BatchProcessFilter.java:67)
at flex.messaging.endpoints.amf.SerializationFilter.invoke(SerializationFilter.java:166)
at flex.messaging.endpoints.BaseHTTPEndpoint.service(BaseHTTPEndpoint.java:291)
at flex.messaging.endpoints.AMFEndpoint$$EnhancerByCGLIB$$5dafba90.service(<generated>)
at org.springframework.flex.servlet.MessageBrokerHandlerAdapter.handle(MessageBrokerHandlerAdapter.java:108)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:790)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560)
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:304)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
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:164)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:395)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:250)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
[BlazeDS]Exception when invoking service 'remoting-service': flex.messaging.MessageException: ServletContext must not be null
incomingMessage: Flex Message (flex.messaging.messages.RemotingMessage)
operation = getAll
clientId = E8B0A041-2F0D-95A8-1F38-D5D244CDA6E4
destination = personService
messageId = 499B6C51-8E26-DD96-9055-79EF0D3823B0
timestamp = 1303420800415
timeToLive = 0
body =
[
]
hdr(DSId) = E8B03010-7B0F-DED7-6D71-C4623D635D2A
hdr(DSEndpoint) = amf
Exception: flex.messaging.MessageException: ServletContext must not be null
at flex.messaging.services.RemotingService.serviceMessage(RemotingService.java:225)
at flex.messaging.MessageBroker.routeMessageToService(MessageBroker.java:1400)
at flex.messaging.endpoints.AbstractEndpoint.serviceMessage(AbstractEndpoint.java:1005)
at flex.messaging.endpoints.AbstractEndpoint$$FastClassByCGLIB$$1a3ef066.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:191)
at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:688)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.flex.core.MessageInterceptionAdvice.invoke(MessageInterceptionAdvice.java:66)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.adapter.ThrowsAdviceInterceptor.invoke(ThrowsAdviceInterceptor.java:124)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.Cglib2AopProxy$FixedChainStaticTargetInterceptor.intercept(Cglib2AopProxy.java:572)
at flex.messaging.endpoints.AMFEndpoint$$EnhancerByCGLIB$$5dafba90.serviceMessage(<generated>)
at flex.messaging.endpoints.amf.MessageBrokerFilter.invoke(MessageBrokerFilter.java:103)
at flex.messaging.endpoints.amf.LegacyFilter.invoke(LegacyFilter.java:158)
at flex.messaging.endpoints.amf.SessionFilter.invoke(SessionFilter.java:44)
at flex.messaging.endpoints.amf.BatchProcessFilter.invoke(BatchProcessFilter.java:67)
at flex.messaging.endpoints.amf.SerializationFilter.invoke(SerializationFilter.java:166)
at flex.messaging.endpoints.BaseHTTPEndpoint.service(BaseHTTPEndpoint.java:291)
at flex.messaging.endpoints.AMFEndpoint$$EnhancerByCGLIB$$5dafba90.service(<generated>)
at org.springframework.flex.servlet.MessageBrokerHandlerAdapter.handle(MessageBrokerHandlerAdapter.java:108)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:790)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560)
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:304)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
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:164)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:395)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:250)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.RuntimeException: ServletContext must not be null
at org.springframework.util.Assert.notNull(Assert.java:112)
at org.springframework.web.context.support.WebApplicationContextUtils.getWebApplicationContext(WebApplicationContextUtils.java:109)
at org.springframework.web.context.support.WebApplicationContextUtils.getWebApplicationContext(WebApplicationContextUtils.java:99)
at org.springframework.web.context.support.WebApplicationContextUtils.getRequiredWebApplicationContext(WebApplicationContextUtils.java:82)
at org.dphibernate.serialization.SpringContextSerializerFactory.getContextReference(SpringContextSerializerFactory.java:111)
at org.dphibernate.serialization.SpringContextSerializerFactory.getSerializerContextReference(SpringContextSerializerFactory.java:65)
at org.dphibernate.serialization.SpringContextSerializerFactory.getSerializer(SpringContextSerializerFactory.java:56)
at org.dphibernate.serialization.SpringContextSerializerFactory.getSerializer(SpringContextSerializerFactory.java:51)
at org.dphibernate.adapters.RemotingAdapter.invoke(RemotingAdapter.java:132)
at flex.messaging.services.RemotingService.serviceMessage(RemotingService.java:183)
... 45 more
This isn't so much a dpHibernate issue, as it is an issue with your Spring/Web.xml config. As such, please consider this a best guess, as there are others around who know a helluva lot more than I.
It appears you're missing the <context-param /> section from your web.xml:
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/applicationContext.xml
</param-value>
</context-param>
That snippet is taken from one of the samples on the dpHibernate site
The error you're seeing is caused by a missing SpringContext which is needed by dpHibernate in order to look up your Hibernate session.
Sorry, need to reopen ...
I configured my application mostly like the lazyOverflow sample. But when I call my own service to populate my ArrayCollection PM I keep getting this ServletContext Error. Sample is the call to getRecentQuestions() from RecentQuestionPM via LoadRecentQuestionsCommand and the according result handler in RecentQuestionPM.
http://code.google.com/p/lazyoverflow/source/browse/trunk/flex/src/com/mangofactory/pepper/view/RecentQuestionsPM.as
Server Configuration is now exactly the same as in the sample, just with my own Entity, DAO and Service names.
Thats as far as I could track the problem:
SpringContextSerializerFactory:111
ServletContext servletContext = FlexContext.getServletContext();
--> servletContext --> null
Thanks for the help, finally I could narrow it down to FlexContext.getServletContext(); returning "null" in SpringContextSerializerFactory.java line 110 (dpHibernate current "2.0" branch, springExtensions 3.0).
Quick fix to this (staying compatible to the current implementation) was altering the code to look like the following:
ServletContext servletContext = FlexContext.getServletContext();
if(servletContext == null) // fix for Servlet Context must not be null exception during migration to Spring 3.0
servletContext = FlexContext.getMessageBroker().getServletContext();
context= WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext);
Don't know if I am doing something ugly here, but works for me. Just thinking ... this line attempts to get the webapplication root context via the current servletContext, if this is null just get it via another one that must be there if this request gets here (which is the springMessageBrokerServlet).

Resources