[JBossWS] - Problems using handlers
by Sancheski
Hi,
I am trying to set a handler to a web method. The problem is that I think that everything is set fine and the execution is not even going trough it.
This is my handler:
| package handlers;
|
| import java.util.Set;
| import java.util.TreeSet;
|
| import javax.xml.namespace.QName;
| import javax.xml.ws.handler.MessageContext;
| import javax.xml.ws.handler.soap.SOAPHandler;
| import javax.xml.ws.handler.soap.SOAPMessageContext;
|
|
| public class AuthenticationHandler implements SOAPHandler <SOAPMessageContext>{
|
| public Set<QName> getHeaders() {
| return new TreeSet<QName>();
| }
|
| public void close(MessageContext msgContext) {
| System.out.println("Closing");
| }
|
| public boolean handleFault(SOAPMessageContext msgContext) {
| System.out.println("FAULT");
| return true;
| }
|
| public boolean handleMessage(SOAPMessageContext msgContext)
| {
| System.out.println("MESSAGE");
| return true;
| }
|
| }
|
|
It is packaged in WEB-INF/clasess/jaxws-location-handlers.xml and its config file is:
| <?xml version="1.0" encoding="UTF-8"?>
|
| <handler-chains xmlns="http://java.sun.com/xml/ns/javaee"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xmlns:ns1="http://org.jboss.ws/jaxws/handlerscope"
| xsi:schemaLocation="http://java.sun.com/xml/ns/javaee javaee_web_services_1_2.xsd">
|
| <handler-chain>
| <handler>
| <handler-class>handlers.AuthenticationHandler</handler-class>
| </handler>
| </handler-chain>
|
| </handler-chains>
And this is how I am trying to use it in my web service (just say that the ws works perfectly):
| package ws.impl;
|
| public class ServiceImpl implements Service{
| ........
| ........
| @HandlerChain(file = "jaxws-location-handlers.xml")
| public String getItem(...){
| }
| }
|
They are all together packaged in the same war file. I am using jbossws-2.0.3GA and Jboss-4.2.2.
I do not know why it is not working, as it seems so easy to set it up. Do I have something wrong in the service? Any idea?
Thanks a lot
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4153423#4153423
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4153423
17 years, 11 months
[Persistence, JBoss/CMP, Hibernate, Database] - Re: Meaning of InUseConnectionCount
by PeterJ
Yes, it it the number of connections that are in use at that exact instant. "In Use" means that some thread is currently using that connection to communicate with the database.
Seeing the connections in use being only 0-2, even when a large number of users are using the app, is not unusual. First, not all users will submit requests concurrently (most are "thinking" and thus there are no requests from those users), and of the users who have active requests, not all of those will be actively using the database. And if you add in Hibernate or JPA, which cache some of the database data, you might have even fewer connections.
The best way to set the max connection is to observe the max in use connection count and set the max connection to that plus 10-20%.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4153419#4153419
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4153419
17 years, 11 months