[Design of JBoss Web Services] - WSContractConsumer API in a seam app
by maeste
Hi,
We are rewriting the core of our generic web based ws client (I spoke about it here some days ago) using a more standard and mantainable core based on JAX-WS and in particular on WSContractConsumer runtime API.
We already done the most important steps of the job and all our test cases works perfectly.
Now we are experincing problems when we deploy our apps (a seam ear) on jboss 4.0.5 with, of course, jbossws from the svn trunk.
The problem is that WSContractConsumer doesn't generate .class file (but .java is generated correctly) when used inside the jboss container. The same class used out of container by our junit test case works perfectly.
Here is the init method of our class:
| public void init(String wsdlURL) {
| try {
| WSContractConsumer wsImporter = WSContractConsumer.newInstance();
| wsImporter.setGenerateSource(true);
| File outputDir = new File("/home/oracle/testImp/tmp/");
| wsImporter.setOutputDirectory(outputDir);
| wsImporter.setSourceDirectory(outputDir);
| String tagetPkg = "it.javalinux.ws";// + (new Random()).nextInt();
| wsImporter.setTargetPackage(tagetPkg);
| wsImporter.consume(wsdlURL);
|
|
| FilenameFilter filter = new FilenameFilter() {
| public boolean accept(File dir, String name) {
| return name.endsWith("Service.class");
| }
| };
| File scanDir = new File("/home/oracle/testImp/tmp/it/javalinux/ws/");
| System.out.println(scanDir);
| String[] a = scanDir.list();
| for (int i = 0; i < a.length; i++) {
| System.out.println(a);
|
| }
|
| String[] children = scanDir.list(filter);
| String className =null;
| if (children != null) {
| className = children[0].substring(0, children[0].length() - 6);
|
| }
|
| classLoader = new URLClassLoader(new URL[]{outputDir.toURL()}, Thread.currentThread().getContextClassLoader());
| //URLClassLoader classLoader = new URLClassLoader(new URL[]{outputDir.toURL()}, Thread.currentThread().getContextClassLoader());
| Thread.currentThread().setContextClassLoader(classLoader);
|
| serviceClass = JavaUtils.loadJavaType("it.javalinux.ws." + className , classLoader);
| service = serviceClass.newInstance();
| } catch (Exception e) {
| e.printStackTrace();
| }
| }
|
What's happen is, as already said, that we find only .java file in this directory and not .class file. We don't get any exception from WSContractConsumer.
Any ideas?
Thanks in advance.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4018523#4018523
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4018523
19 years, 1 month
[Design of JBoss jBPM] - Re: commands & EJB 3
by tom.baeyens@jboss.com
writing as i think....
| public class WebRoleAuthorizationService implements AuthorizationService {
|
| public void checkPermission(Permission permission) throws AccessControlException {
|
| Permission mappedPermission = null;
|
| if (permission instanceof CommandPermission) {
| CommandPermission commandPermission = (CommandPermission) permission;
| Command command = commandPermission.getCommand();
| mappedPermission = new javax.security.jacc.WebRoleRefPermission(...map the command to a web role...);
| } else {
| ...map the other permissions...
| }
|
| SecurityManager sm = System.getSecurityManager();
| if (sm!=null) {
| sm.checkPermission(mappedPermission);
| }
| }
|
does this show/illustrate the idea a bit ?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4018476#4018476
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4018476
19 years, 1 month
[Design of JBoss jBPM] - Re: commands & EJB 3
by tom.baeyens@jboss.com
"tom.baeyens(a)jboss.com" wrote :
| the idea is that in the jbpm code, we should just check for jbpm type of permissions. e.g. org.jbpm.permission.TokenPermission or org.jbpm.permission.TaskPermission (to be created).
|
in your application this should be CommandPermission or something like that. you could put the command inside of the CommandPermission.
but still there is something that needs to be cleared out first. how authentication is passed into authorization.
i see 2 different situations. in case of a webapp or a swing app, the user is already authenticated when a command is created.
in case of client server execution of commands. a client sends a command to the server for execution. in that case, there must be some client identification and credentials passed along with the command. in case of ejb, that is handled by ejb spec, i think. so the authentication context is passed allong with the method invocation over the wire. probably something similar will exist in the web service specifications in case we want to expose the command execution service via web services.
concluding, the most important is that the authentication/authorization solution that we work out should cover both scenarios: web/swing-apps and server side execution of commands send by a remote client.
regards, tom.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4018473#4018473
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4018473
19 years, 1 month
[Design of JBoss jBPM] - Re: Identity module as an implementation of a service?
by tom.baeyens@jboss.com
the identity module is pluggable in the interfaces AssignmentHandler and some other that i don't remember.
the difficulty of defining a service for the identity component is that such a service interface would have to adopt a certain model between users, groups, roles, permissions and perhaps other things. the problem is that you cannot find a single model that matches all the models in any organisation. so with the service approach you end up mapping the users user-role model onto the model defined in the jbpm identity service. somehting which will be problematic in many cases.
ideally, there would be a 2 level approach. an identity service, for wihch you could plug different implementations (e.g. DB or LDAP based) and if the model is too different, people could still write their own assignment handlers and the other interface i don't remember. but even that has its problems as the navigation of the relations is in case of DB/hibernate based on lazy loading, whereas in an LDAP you would have to put the relation navigation methods in the service interface.
i realize this might be too little explanation for a lot of reasoning. feel free to ask more info or to challenge the reasoning.
regards, tom.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4018468#4018468
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4018468
19 years, 1 month
[Design of JBoss jBPM] - Re: commands & EJB 3
by tom.baeyens@jboss.com
In the constructor of your authorization service impl, you can fetch the JbpmContext with JbpmContext.getCurrentContext(). (ignore the deprecated. that is to indicate that the method jbpmConfiguration.getCurrentContext() is to be preferred. but in the case of service construction, you don't have a pointer to the jbpmConfiguration...)
To navigate from the jbpmContext to other services, use jbpmContext.getServices().getService(...) where ... is one of the constants defined in Services.
To navigate from the jbpmContext to the sessions for db access, use jbpmContext.getXxxSession().
You can also use jbpmContext.getSession() and put your queries directly in the service.
i know this services/session stuff stinks :-) it's one of the main topics to be improved in jbpm 4.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4018464#4018464
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4018464
19 years, 1 month