[JBossWS] - Adding application specific properties to the MessageContext
by kellenheller
I'm trying to add application specific properties to the MessageContext to retrieve either in my service via WebServiceContext or in a SoapMessageHandler via messageContext.
No matter how I try to retrieve them, the properties are always null:
Here's my test code:
Service service = getWebService( ); //works fine
| HaloImpl endPoint = service.getPort( HaloImpl.class );
|
| //setup custom properties in RequestContext
| BindingProvider bp = (BindingProvider) endPoint;
| bp.getRequestContext( );
| Map<String,Object> context = bp.getRequestContext( );
| context.put( "prop1", "value1");
| context.put( "prop2", "value2");
|
| return (HaloImpl) bp;
Then I call the endpoint service, no problem.
In the handler:
public class HaloHandler implements SOAPHandler<SOAPMessageContext>
| {
|
| //@Override
| public boolean handleMessage( SOAPMessageContext msgContext )
| {
|
| try
| {
| String prop1 = (String) msgContext.get( "prop1" );
| String prop2 = (String) msgContext.get( "prop2" );
|
| } catch( Exception e )
| {
| throw new RuntimeException( e );
| }
|
| return true;
| }
The handler is configured on the server side via the @HandlerChain annotation, and it is being executed. However, prop1 and prop2 are always null, when they should have "value1" and "value2" respectively.
I've tried adding the WebServiceContext in the web service impl class like so:
@Resource
| WebServiceContext ctx;
|
| public HaloImpl( )
| {
|
| }
and then accessing the properties in a method when a service method is called:
private void validateProperties( )
| {
| MessageContext msg = ctx.getMessageContext( );
| if (msg != null){
|
| String prop1 = (String) msg.get( "prop1" );
| String prop2 = (String) msg.get( "prop2" );
| }
| }
but again, the properties are null.
Am I missing a setting? I've seen several examples in different implementations showing this is the way to access custom properties, but I can't seem to get this to work.
I am using Jboss 4.2.2 with the default jax-ws stack it came with in there ( v2.0.1.SP2 ).
Anybody have any ideas? Thanks guys :)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4120208#4120208
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4120208
18 years, 5 months
[JBoss Seam] - Re: Seam with Hibernate Version Conflict
by leandro3.marinho
I just have tried these configurations too, but don't work. I tried delete hibernate jars of server lib directory but it don't work too, my application don't recognizes the libs into ear and throws exceptions and show this in the server console:
|
| --- Incompletely deployed packages ---
| org.jboss.deployment.DeploymentInfo@85793d72 { url=file:/home/kurumin/java/tools/jboss-4.2.2.GA/server/default/deploy/spiv.ear }
| deployer: org.jboss.deployment.EARDeployer@168989e
| status: Deployment FAILED reason: URL file:/home/kurumin/java/tools/jboss-4.2.2.GA/server/default/tmp/deploy/tmp65581spiv.ear-contents/spiv-war-exp.war/ deployment failed
| state: FAILED
| watch: file:/home/kurumin/java/tools/jboss-4.2.2.GA/server/default/deploy/spiv.ear
| altDD: null
| lastDeployed: 1200424791209
| lastModified: 1200424787000
| mbeans:
|
| --- MBeans waiting for other MBeans ---
| ObjectName: jboss.j2ee:service=EJB3,module=jboss-seam-2.0.0.GA.jar
| State: FAILED
| Reason: java.lang.NoClassDefFoundError: org/hibernate/SessionFactory
|
| ObjectName: jboss.j2ee:service=EJB3,module=spiv-ejb-0.0.1-SNAPSHOT.jar
| State: FAILED
| Reason: java.lang.NoClassDefFoundError: org/hibernate/cfg/EJB3DTDEntityResolver
|
| ObjectName: jboss.web.deployment:war=spiv-war.war,id=-236867335
| State: FAILED
| Reason: org.jboss.deployment.DeploymentException: URL file:/home/kurumin/java/tools/jboss-4.2.2.GA/server/default/tmp/deploy/tmp65581spiv.ear-contents/spiv-war-exp.war/ deployment failed
|
| --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
| ObjectName: jboss.j2ee:service=EJB3,module=spiv-ejb-0.0.1-SNAPSHOT.jar
| State: FAILED
| Reason: java.lang.NoClassDefFoundError: org/hibernate/cfg/EJB3DTDEntityResolver
|
| ObjectName: jboss.j2ee:service=EJB3,module=jboss-seam-2.0.0.GA.jar
| State: FAILED
| Reason: java.lang.NoClassDefFoundError: org/hibernate/SessionFactory
|
| ObjectName: jboss.web.deployment:war=spiv-war.war,id=-236867335
| State: FAILED
| Reason: org.jboss.deployment.DeploymentException: URL file:/home/kurumin/java/tools/jboss-4.2.2.GA/server/default/tmp/deploy/tmp65581spiv.ear-contents/spiv-war-exp.war/ deployment failed
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4120204#4120204
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4120204
18 years, 5 months
[JBoss Seam] - Re: IllegalStateException on WebLogic Restart
by jbalunas@redhat.com
>From looking at the jira issue, and the tomcat issue (linked in the bug) it looks like there is a problem where session listeners are called out of order on tomcat. I can only assume that it is the same on Weblogic 92, based on the exceptions that you are seeing.
The new reference guide chapter I wrote uses weblogic 10.x so I do not believe this is an issue on 10.
Some things to try:
Clean out the "deployed apps directory" on 10 it was @BEA_HOME/user_projects/domains/<your-domain>/servers/<your-sever>/tmp/_WL_user" directory. Make sure the server is down and then delete your application there and restart.
Also try to deploy the JPA example using the weblogic 92 build. If there are issues with that you could attempt to deploy the weblogic 10 version, but you would need to change the servlet version to 2.4 in the web.xml.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4120194#4120194
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4120194
18 years, 5 months