[EJB 3.0] - The EJB3 embeddable release contains errors
by klejs
Hello,
I was trying to use the jboss embeddable alpha server in my unit tests. I downloaded the latest release and tried the tutorials and they ran fine. When trying to use the server with my tests i first got an
java.lang.NoClassDefFoundError: javax/persistence/NoResultException
Ok, so when looking in the ejb3-persistence.jar the class wasn't there and that must be a mistake. I added the ejb3-persistence.jar file from the jboss app server and then I got another of those NoClassDefFoundErrors:
java.lang.NoClassDefFoundError: javax/persistence/spi/PersistenceInfo
>From what I can see this an old interface that shouldn't be used.
Maybe I'm missing something here but it looks like there are some errors with the embeddable release.
/klejs
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994758#3994758
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994758
19 years, 7 months
[JBoss Seam] - problem with s:button, s:link and action
by Vitalik
I try to use s:button with action attribute and i use EntityHome class: xml-declarations kinds in components.xml:
| <factory name="myEntity" value="#{myEntityHome.instance}"/>
| <fwk:entity-home name="myEntityHome"
| entity-class="com.mycompany.MyEntity"
| entity-manager="#{entityManager}"/>
|
With s:button action-attribute i assign following:
<s:button action="#{myEntityHome.persist}" view="/myPage.xhtml" value="Create" />
Also I have following form:
| <s:validateAll>
| <div>
| <table>
| <tr>
| <td><h:outputLabel value="#{messages['common.name']}"/></td>
| <td><s:decorate><h:inputText value="#{myEntity.name}"/></s:decorate></td>
| </tr>
| <tr>
| <td><h:outputLabel value="#{messages['common.description']}"/></td>
| <td><h:inputText value="#{myEntity.description}"/></td>
| </tr>
| </table>
| </div>
| </s:validateAll>
|
But I get entity with empty fields in my database, when I click on the button.
All works well, if I use <h:commandButton ... />
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994742#3994742
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994742
19 years, 7 months
[JBoss jBPM] - 3.2alpha2 enterprise / JTA exceptions
by dhartford
Hey all,
I'm playing with the enterprise-version in SCM and just came across two issues to share:
1. The jbpm-console.war within the .ear package may want to have the javassist.jar under WEB-INF/lib removed as it already exists in the Jboss AS.
2. JTA issue on a JEMS-installed JBoss 4.0.5.GA-EJB3 profile server:
| 11:53:12,518 ERROR [STDERR] Dec 18, 2006 11:53:12 AM com.sun.facelets.FaceletViewHandler handleRenderException
| SEVERE: Error Rendering View[/main/user/usertasklist.xhtml]
| javax.el.ELException: /search/form/formtemplate.xhtml @14,73 session="#{jbpmBean.jbpmContext.session}": org.hibernate.Hi
| bernateException: Unable to locate current JTA transaction
| at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:76)
| at org.jbpm.webapp.tag.jbpm.ui.Search.getSession(Search.java:47)
| at org.jbpm.webapp.tag.jbpm.ui.UICriteria.initialize(UICriteria.java:70)
| at org.jbpm.webapp.tag.jbpm.ui.UICriteria.initialize(UICriteria.java:110)
| at org.jbpm.webapp.tag.jbpm.ui.UICriteria.getSearchBean(UICriteria.java:203)
| at org.jbpm.webapp.tag.jbpm.ui.Search.initialize(Search.java:187)
| at org.jbpm.webapp.tag.jbpm.ui.Search.encodeBegin(Search.java:92)
| ....
| ...
| Caused by: org.hibernate.HibernateException: Unable to locate current JTA transaction
| at org.hibernate.context.JTASessionContext.currentSession(JTASessionContext.java:61)
| at org.hibernate.impl.SessionFactoryImpl.getCurrentSession(SessionFactoryImpl.java:542)
| at org.jbpm.persistence.db.DbPersistenceService.getSession(DbPersistenceService.java:103)
| at org.jbpm.JbpmContext.getSession(JbpmContext.java:467)
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994738#3994738
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994738
19 years, 7 months
[EJB 3.0] - Entity Ownership check
by fcorneli
@RolesAllowed allows one to check whether a caller principal has a certain role in a declarative way. Besides checking permissions on executed operations there is also something I call entity ownership checking. This is where you want to check whether the caller principal is allowed to update an Entity. For this I would like to use an Entity Listener since this is one of those cross-cutting concerns. But apparently it's not possible to inject the SessionContext into the listener, since it's not an EJB3 session bean I guess. Thus I'm using the SecurityAssociation.getPrincipal/getSubject to gain access to the caller principal and roles in order to perform the entity ownership checks. Is it OK to use the SecurityAssociation for this purpose?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994730#3994730
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994730
19 years, 7 months
[JBoss jBPM] - Doubt with subprocess
by fjfernandez
Hi everybody,
I have some doubts using subprocess in jbpm. Before starting with jbpm, i worked with wfmopen and i could do all these things i don't know if they are possible in jbpm, so a little of help would be apreciatted:
1. My application has a main window with the list of my process definitions and when i click in one of them, a new window with the list of tasks is shown. Among my process definitions, i have some of them that are only disegned for be used like subprocess of the rest of definitions. Is there any way to indicate that special case so it doesn't appear in my main window?
2. Subprocess (call it PD2) is a process definition, so when its instances are created for its superprocess (call it PD1), the new task is create for PD2 and not for PD1, so in my main window i have to click in PD2 instead of PD1, that is the desired behaviour. Is there any way to get that?
Thanks in advance and regards
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994729#3994729
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994729
19 years, 7 months
[JBoss Seam] - Pageflow and @StartTask
by MelampO
Hello.
I am trying to start a task with @StartTask annotation but it seems not work because I am in a long running conversation.
The problem is that I have a pageflow running and I call the @StartTask annotated method from a decision-node. With the pageflow I have a long conversation, so when it founds @StartTask returns a exception:
JSF:
| <h:form>
| <h:dataTable var="task"
| value="#{taskInstanceListForType['esperandoEnvio']}"
| rendered="#{not empty taskInstanceListForType['esperandoEnvio']}">
|
| <h:column>
| <f:facet name="header">
| <h:outputText value="Título" />
| </f:facet>
| <h:outputText value="#{task.variables.peticionJBPM['url']}" />
| </h:column>
|
| <h:column>
| <s:button action="recibido" value="Recibido" taskInstance="#{task}" />
| </h:column>
|
| </h:dataTable>
|
| </h:form>
|
Pageflow definition:
| ....
|
| <page name="Pedidos" back="enabled" view-id="/peticiones/pedidos.jsp" no-conversation-view-id="/peticiones/login.jsp">
| <redirect />
| <transition name="volver" to="Gestionar Peticiones"></transition>
| <transition name="ver" to="Informacion"></transition>
| <transition name="buscar" to="Resultados"></transition>
| <transition name="recibido" to="Recibido"></transition>
| </page>
|
| <decision name="Recibido" expression="#{avanzarEstadoPeticion.avanzar}">
| <transition name="false" to="Pedidos"></transition>
| <transition name="true" to="Pedidos"></transition>
| </decision>
|
| ....
|
Bean:
| @Stateless
| @Name("avanzarEstadoPeticion")
| public class AvanzarEstadoPeticionImpl implements AvanzarEstadoPeticion {
|
| @StartTask
| @EndTask
| public boolean avanzar() {
| return true;
| }
|
| }
|
And, finally, the stacktrace:
| 17:28:59,225 ERROR [[Faces Servlet]] Servlet.service() for servlet Faces Servlet threw exception
| org.jbpm.graph.def.DelegationException
| at org.jbpm.graph.def.GraphElement.raiseException(GraphElement.java:352)
| at org.jbpm.graph.def.GraphElement.raiseException(GraphElement.java:346)
| at org.jbpm.graph.node.Decision.execute(Decision.java:131)
| at org.jbpm.graph.def.Node.enter(Node.java:316)
| at org.jbpm.graph.def.Transition.take(Transition.java:119)
| at org.jbpm.graph.def.Node.leave(Node.java:383)
| at org.jbpm.graph.exe.Token.signal(Token.java:174)
| at org.jbpm.graph.exe.Token.signal(Token.java:137)
| at org.jbpm.graph.exe.ProcessInstance.signal(ProcessInstance.java:229)
| at org.jboss.seam.pageflow.PageflowHelper.signal(PageflowHelper.java:47)
| at org.jboss.seam.core.Pageflow.navigate(Pageflow.java:214)
| at org.jboss.seam.jsf.SeamNavigationHandler.handleNavigation(SeamNavigationHandler.java:30)
| at org.jboss.seam.core.Pages.handleOutcome(Pages.java:319)
| at org.jboss.seam.core.Pages.callAction(Pages.java:360)
| at org.jboss.seam.jsf.AbstractSeamPhaseListener.callPageActions(AbstractSeamPhaseListener.java:200)
| at org.jboss.seam.jsf.AbstractSeamPhaseListener.beforeRender(AbstractSeamPhaseListener.java:149)
| at org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:50)
| at org.apache.myfaces.lifecycle.LifecycleImpl.informPhaseListenersBefore(LifecycleImpl.java:520)
| at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:342)
| at javax.faces.webapp.FacesServlet.service(FacesServlet.java:107)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
| at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
| at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
| at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
| at java.lang.Thread.run(Thread.java:595)
| Caused by: org.jbpm.JbpmException: couldn't evaluate expression '#{avanzarEstadoPeticion.avanzar}'
| at org.jbpm.jpdl.el.impl.JbpmExpressionEvaluator.evaluate(JbpmExpressionEvaluator.java:38)
| at org.jbpm.graph.node.Decision.execute(Decision.java:108)
| ... 35 more
| Caused by: javax.ejb.EJBException: java.lang.IllegalStateException: begin method invoked from a long running conversation, try using @Begin(join=true)
| at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:69)
| at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83)
| at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:197)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:78)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:181)
| at org.jboss.ejb3.stateless.StatelessLocalProxy.invoke(StatelessLocalProxy.java:79)
| at $Proxy518.avanzar(Unknown Source)
| at org.fundacionctic.actions.peticion.AvanzarEstadoPeticion$$FastClassByCGLIB$$acb03afc.invoke(<generated>)
| at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
| at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:45)
| at org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(ClientSideInterceptor.java:69)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:55)
| at org.jboss.seam.interceptors.ExceptionInterceptor.handleExceptions(ExceptionInterceptor.java:28)
| at sun.reflect.GeneratedMethodAccessor399.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
| at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
| at org.jboss.seam.intercept.RootInterceptor.createSeamInvocationContext(RootInterceptor.java:144)
| at org.jboss.seam.intercept.RootInterceptor.invokeInContexts(RootInterceptor.java:129)
| at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:102)
| at org.jboss.seam.intercept.ClientSideInterceptor.interceptInvocation(ClientSideInterceptor.java:78)
| at org.jboss.seam.intercept.ClientSideInterceptor.intercept(ClientSideInterceptor.java:47)
| at org.jboss.seam.intercept.Proxy$$EnhancerByCGLIB$$20d7a2c3.avanzar(<generated>)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jbpm.jpdl.el.impl.BeanMethod.invoke(BeanMethod.java:19)
| at org.jbpm.jpdl.el.impl.ArraySuffix.evaluate(ArraySuffix.java:287)
| at org.jbpm.jpdl.el.impl.ComplexValue.evaluate(ComplexValue.java:146)
| at org.jbpm.jpdl.el.impl.ExpressionEvaluatorImpl.evaluate(ExpressionEvaluatorImpl.java:264)
| at org.jbpm.jpdl.el.impl.ExpressionEvaluatorImpl.evaluate(ExpressionEvaluatorImpl.java:191)
| at org.jbpm.jpdl.el.impl.JbpmExpressionEvaluator.evaluate(JbpmExpressionEvaluator.java:34)
| ... 36 more
| Caused by: java.lang.IllegalStateException: begin method invoked from a long running conversation, try using @Begin(join=true)
| at org.jboss.seam.interceptors.ConversationInterceptor.endOrBeginLongRunningConversation(ConversationInterceptor.java:46)
| at sun.reflect.GeneratedMethodAccessor401.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
| at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
| at org.jboss.seam.interceptors.BusinessProcessInterceptor.manageBusinessProcessContext(BusinessProcessInterceptor.java:50)
| at sun.reflect.GeneratedMethodAccessor400.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
| at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
| at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
| at org.jboss.seam.intercept.RootInterceptor.createSeamInvocationContext(RootInterceptor.java:144)
| at org.jboss.seam.intercept.RootInterceptor.invokeInContexts(RootInterceptor.java:129)
| at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:102)
| at org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:49)
| at sun.reflect.GeneratedMethodAccessor413.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
| at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
| ... 79 more
|
|
I have tryed with @Begin(join=true) in the bean method as suggests the exception, but it has not work.
Any idea?
Thanks.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994728#3994728
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994728
19 years, 7 months
[Installation, Configuration & Deployment] - Re: Starting failed jboss:database=localDB, service=Hypersoni
by srubio
I came across the same problem this today (error suddenly popped up and not being able to find the solution which I know I found before via search), but thankfully had saved off the problem/resolution in a text file. Here's the magic that worked for me:
This means that the Hypersonic database (the internal datastore that handles JMS messages) has become corrupt. To fix this problem, shutdown all @task servers in the cluster and delete the contents of the JBOSS_HOME/server/default/data/hypersonic directory. These files will be recreated once JBoss is restarted.
Here's a little more of the stack for others to see:
10:44:05,087 WARN [ServiceController] Problem starting service jboss:database=localDB,service=Hypersonic
java.sql.SQLException: User not found: SA
at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
at org.hsqldb.jdbc.jdbcConnection.(Unknown Source)
at org.hsqldb.jdbcDriver.getConnection(Unknown Source)
at org.hsqldb.jdbcDriver.connect(Unknown Source)
at java.sql.DriverManager.getConnection(DriverManager.java:512)
at java.sql.DriverManager.getConnection(DriverManager.java:171)
at org.jboss.jdbc.HypersonicDatabase.getConnection(HypersonicDatabase.java:761)
at org.jboss.jdbc.HypersonicDatabase.startStandaloneDatabase(HypersonicDatabase.java:611)
at org.jboss.jdbc.HypersonicDatabase.startService(HypersonicDatabase.java:557)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994716#3994716
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994716
19 years, 7 months
[JBoss Portal] - Secure new Instance of CMSAdminPortlet.
by mmontoni
Hi,
I created a new instance of the CMSAdminPortlet. I adde it inside of an "Admin" page of myPortal app. I do have a myPortal-object.xml description where I put the folowing:
| <window>
| <window-name>CMSAdminPortletWindow</window-name>
| <instance-ref>CMSAdminPortletInstance2</instance-ref>
| <region>center</region>
| <height>0</height>
| </window>
|
My problem is that I would like that the "Admin" option is only viewed if you are logged as "Admin". This is not happening. Now, anyone can see it. I did try to add the following in my portlet-instance.xml but it didn't work either. Any ideas?
| <deployment>
| <instance>
| <instance-id>CMSAdminPortletInstance2</instance-id>
| <portlet-ref>CMSAdminPortlet</portlet-ref>
| <security-constraint>
| <policy-permission>
| <role-name>Admin</role-name>
| <action-name>view</action-name>
| </policy-permission>
| </security-constraint>
| </instance>
| </deployment>
|
Thanks!
Mariella.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994702#3994702
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994702
19 years, 7 months
[JBoss Portal] - Jboss Seam App + Portal Installation
by Shinerella
Hi everybody!
I have already several jboss seam applications running on a Jboss AS 4.0.4 GA installer version (ejb3 option enable as it was required to use seam),
The thing is that I want to use jboss portal and start making my intranet applications as portlets, but I have the following problem:
I tried to install portal under this Jboss server, I had a lot of errors, so I just installed the jboss Portal bundle that comes with a Jboss AS in another computer and I tried to deploy my seam applications in there, but I have this famous exception
org.jboss.deployment.DeploymentException: ejb-jar.xml must either obey the right xml schema or define a valid DOCTYPE!
So.. my question is, which is my best shot?
Do I need to have two jboss AS? or there is a way to have my seam aplicactions in the same Jboss AS where jboss portal is deployed and running?
Thanks and regards
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994699#3994699
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994699
19 years, 7 months
[JBossWS] - Handlers
by Redhopter
Hi All!
I have written JBossWS web service and client class for it. Client and service work successfully. Also I have written Handler class such as
| public class MHandler extends GenericHandler{
| public boolean handleRequest(MessageContext context) {
| SOAPMessageContext sctx = (SOAPMessageContext)context;
| SOAPMessage message = sctx.getMessage();
| try {
| SOAPHeader header = message.getSOAPHeader();
| String userName = header.getAttribute("username");
| String password = header.getAttribute("password");
| try {
| FileOutputStream file = new FileOutputStream("C:/Documents and Settings/kbolyand/Desktop/log.txt");
| file.write("Into Handler".getBytes());
| file.write((userName + "=" + password).getBytes());
| file.close();
| }
| catch (FileNotFoundException e) {
| e.printStackTrace();
| }
| catch (IOException e) {
| e.printStackTrace();
| }
|
| }
| catch (SOAPException e) {
| e.printStackTrace();
| }
|
| return true;
| }
| public QName[] getHeaders() {
| return new QName[0];
| }
| }
|
And now I have question: where I must declere my handler class in order use it and intercept SOAP messages?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994694#3994694
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994694
19 years, 7 months