[JBossWS] - Trying to use jboss.xml instead of @WebContext
by karypid
Hello,
I'm trying to secure a web service with basic http authentication, but I want to keep all JBoss-specific configuration out of my code. Therefore, I need some pointers as to how to express the @WebContext annotation (used to specify BASIC http authentication) in the jboss.xml deployment descriptor.
In more detail:
I have my service implemented as a stateless session bean. I have found the following code works perfectly to require authorization, but uses JBoss-specific annotations (marked in bold font):
@Stateless
| @WebService@SecurityDomain("JBossWS")@RolesAllowed("someRole")@WebContext(authMethod = "BASIC", transportGuarantee = "NONE", secureWSDLAccess = false)public class MyWSBean {
| //...
| }
|
I therefore remove the @SecurityDomain and @WebContext annotations and added a jboss.xml deployment descriptor as follows:
<?xml version="1.0" encoding="UTF-8"?>
| <jboss> <security-domain>java:/jaas/JBossWS</security-domain> <enterprise-beans>
| <session>
| <ejb-name>MyWSBean</ejb-name>
| <port-component>
| <port-component-name>MyWSBean</port-component-name> <auth-method>BASIC</auth-method> </port-component>
| </session>
| </enterprise-beans>
| </jboss>
However, the configuration is not picked up for some reason. All attempts to access the web service fail due to an authorization failure. I can tell that the jboss.xml file is pared because if I mistype something (e.g. use <ejb-name>MyWSBeanWILLNOTMATCH</ejb-name>, or <security-domain>ThisDoesNotExist</security-domain>) then JBoss complains during deployment that the bean / realm does not exist.
Specifically, I verified that my jboss.xml works for replacing the @SecurityDomain annotation by leaving @WebContext in the code and specifying the domain with the <security-domain> tag in jboss.xml: this works.
Can anybody help me out with the proper deployment descriptor content for replacing the @WebContext?
P.S. No other deployment descriptors exists (no webservices.xml and the ejb-jar.xml is empty).
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4168135#4168135
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4168135
16 years, 5 months
[JBoss jBPM] - tasks lost in flight when exception occurs
by gnagy
In the process of getting rid of the seemingly deprecated gravel and j4j dependency, we moved task transitions to seam component action methods, like this:
public String transit(TaskInstance taskInstance, String transitionName) {
JbpmContext context = ManagedJbpmContext.instance();
// without this, LazyInitializationException occurs
taskInstance = context.getTaskInstanceForUpdate(taskInstance.getId());
taskInstance.end(transitionName);
return "success";
}
Before we used:
<h:commandLink>
<4j:loadTask id="#{taskInstance.id}" target="#{j4jtask}"/>
<j4j:completeTask task="#{j4jtask}" transition="#{transition.name}"/>
<h:outputText value="#{transition.name}"/>
</h:commandLink>
We have some event actions on tasks (calling methods on seam components), and when an exception occurs there, the task is lost from our task list.
The task list is rendered as follows:
<ui:repeat var="taskInstance" value="#{taskInstanceList}">...
Looking at the db, the exceptional transition cleared the isopen and issignaling flag in the jbmp_taskinstance table.
I'm pretty sure this worked with the j4j action handlers, but it's really hard to revert now. How can we keep the task in "open" state, even if an exception occurs?
Thanks,
Greg
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4168131#4168131
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4168131
16 years, 5 months
[Installation, Configuration & DEPLOYMENT] - JBoss 4.2.3 and Maven
by matinh
Hi all!
Does anybody know the supposed way of building an EAR project including remote clients with maven for JBoss AS 4.2.3?
Currently we are building a project (an EAR with some remote clients) with Maven 2 which is going to run in/connect to JBoss AS. So far we were using JBoss 4.2.2 with no problems. In our project we use various JBoss JARs (dependencies in maven terms) like jboss-ejb3-client.jar, jbossall-client.jar, jboss-ejb-api.jar which we got from JBoss' maven repository http://repository.jboss.com/maven2/.
Now, that JBoss 4.2.3 is out, we want to upgrade to this version but get java.io.InvalidClassExceptions (at least) for the class org.jboss.ejb3.remoting.BaseRemoteProxy.
The Problem seems to be that jboss-ejb3-client.jar which comes with JBoss 4.2.3 is compiled with a different java version than the one which is found in the maven repository, so our application has a different class than the JBoss instance with which it is going to communicate. The same problem is very likely to hit other JARs as well, this is just the first error we get.
Any hints anyone?
tia,
- martin
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4168129#4168129
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4168129
16 years, 5 months