[EJB 3.0] - How to setup wsse usernametoken for ejb3 based web services?
by xiaow
I posted the following question in ws forum, but this forum may be the better place for it. Please help.
"I have tried to solve this for several weeks for jboss on either 4.2.2 or 5 beta 4 and was very frustrated. And I have easily configured this feature in Glassfish v3 and Oracle AS 10g. Now I work on a very simple web service annotated from a session bean as following:
@webservice
@stateless
public class Test{
@Resource SessionContext context;
public test(){
String userName =
context.getCallerPrincipal().getName();
System.out.println("The calling user is " + userName);
}
}
I would like to see how step by step to configure only the usernametoken wsse feature for the web service against an LDAP source such as openldap or active directory in a jboss server (any version), so that the ejb test method is invoked and it prints the user name of the caller in the console (or log).
"
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4130773#4130773
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4130773
18 years, 2 months
[EJB 3.0] - Re: EAR deploy fails in JBoss 4.2
by chandra_88
Thanks for the reply . I have multiple util jars all from the JBoss 4.2 doc it says multiple jars can be specified in the lib folder and the lib folder can be presnet in the ear folder.
The lib folder is specified using the library-directory tag.
So if in the application.xml i mention
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE application PUBLIC
"-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN"
"http://java.sun.com/dtd/application_1_3.dtd">
<display-name>EjbSession</display-name>
<!-- Libraries -->
< module>
EjbSession.jar
< /module>
<library-directory>lib</library-directory>
All the common libraries present in the lib folder i presumed. I did try modifying the manifest entries in the ejb jar and then i get an exception saying no class loaders found for the ejb impl classes.
Manifest.MF
=============
Manifest-Version: 1.0
Class-Path: ../lib/commons-collections-3.2.jar ../lib/commons-configuration-1.5.jar ../lib/commons-lang-2.3.jar ../lib/commons-logging-1.1.1.jar
How do i specify multiple jars file using <library-directory> if it is not suppored i will try whatever is mentioned from you.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4130763#4130763
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4130763
18 years, 2 months
[EJB 3.0] - Re: EntityManager is null
by kgreene
This code works except for the flush. The flush does not commit the updates to the database. Specifically, I want to update the status in the Fetcher.transfer method. However, the status does not get updated to "RUNNING". It only gets updated to "COMPLETE" once the fetcher is done. I thought maybe moving the entity manager outside the Watcher and Fetcher might fix this issue. So, I created a ConversionFileDAO which I tried to use in the code below, but I get a namenotfoundexception. I of course commented out the em method calls when I did this.
Watcher.java
@Stateless
@Clustered
public class Watcher
implements WatcherIntLocal, WatcherIntRemote
{
@Resource
private SessionContext context;
@PersistenceContext (unitName="WatcherDB")
private EntityManager em;
public void checkForNewFiles() throws WatcherException
{
try
{
List validFiles = findValidFiles();
addToQueue(validFiles);
}
catch (Throwable e)
{
e.printStackTrace();
throw new WatcherException(e);
}
}
public List findValidFiles() throws WatcherException
{
//iterate thru a list of files and search for certain extensions
//if the file name matches those extensions, call insert
}
public void insert(File file)
{
//// THIS DOES NOT WORK. get a namenotfoundexception
//InitialContext ctx = new InitialContext();
//ConversionFileDAORemote dao = (ConversionFileDAORemote) ctx.lookup("ConversionFileDAO/remote");
//dao.insert(file);
em.persist(file);
//FLUSH DOES NOT WORK. the file is persisted to the db, but only after the watcher is done. this causes the fetcher to get an exception b/c sometimes it can't find the entry in the db
em.flush();
}
public void addToQueue(List validFiles) throws WatcherException
{
// iterate thru files
//create a TextMessage using the file name
//send the message
}
}
==================================
Fetcher.java
public class Fetcher
implements MessageListener
{
@Resource
private MessageDrivenContext context;
@PersistenceContext (unitName="WatcherDB")
private EntityManager em;
public void onMessage(Message arg0) {
String fileName = ((TextMessage)arg0).getText();
File remoteFile = (File)em.createQuery("from File where fileName=:filename").setParameter("filename",fileName).getSingleResult();
transfer(remotefile,localfile);
remoteFile.setStatus("COMPLETE");
em.merge(remoteFile);
em.flush();
}
public void transfer(File remoteFile, File localFile)
{
//// THIS DOES NOT WORK. get a namenotfoundexception
//InitialContext ctx = new InitialContext();
//ConversionFileDAORemote dao = (ConversionFileDAORemote) ctx.lookup("ConversionFileDAO/remote");
//dao.update(file);
remoteFile.setStatus("RUNNING");
em.merge(remoteFile);
//THIS DOES NOT WORK - status of running does not get updated to the db
em.flush();
}
}
=============================
public class ConversionFileDAO implements ConversionFileDAORemote
{
@PersistenceContext (unitName="WatcherDB")
private EntityManager em;
public insert(ConversionFile file)
{
em.persist(file);
em.flush();
}
public update(ConversionFile file)
{
em.merge(file);
em.flush();
}
public getConversionFile(String fileName)
{
ConversionFile currFile = null;
try {
currFile = (ConversionFile)em.createQuery("from ConversionFile where fileName=:filename").setParameter("filename", fileName).getSingleResult();
}
catch (NoResultException e1)
{
}
return file;
}
}
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4130762#4130762
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4130762
18 years, 2 months
[JBoss jBPM] - Re: jBPM BPEL 1.1 GA - should bpel2 samples work?
by caramba1
"alex.guizar(a)jboss.com" wrote : If you please, you can review the fixes in our CVS repository.
|
I have downloaded the examples from cvs, they looks as almost working:
Hello example works on both hsqldb and oracle.
Atm and Trip work on hsqldb, but do not work on oracle. (Connect succeeds, but logon gives an error: java.sql.SQLException: Stream has already been closed)
invoice, shipping, scheduling, task examples could not be built:
[wstools] java.lang.IllegalArgumentException: Cannot load config from: src/main/resources/wstools.xml
translator has also problems:
translator:
[javac] D:\programs\jbpm-bpel-1.1.GA\examples\translator\src\main\java\com\example\translator\DocumentTranslator_Impl.java:15: cannot find symbol
[javac] symbol: class DocumentTranslator
[javac] public class DocumentTranslator_Impl implements DocumentTranslator, Remote {
"alex.guizar(a)jboss.com" wrote :
| The product supports both BPEL4WS 1.1 and WS-BPEL 2.0. For v2.0, we aim to support the final version, available from http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.pdf.
|
That sounds great, does it support or if it will the doXslTransform extension function? I found it extrimely useful.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4130753#4130753
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4130753
18 years, 2 months