[JBoss Web Services] - How to get the principal on a webservice behind JAAS?
by sjahan
sjahan [http://community.jboss.org/people/sjahan] created the discussion
"How to get the principal on a webservice behind JAAS?"
To view the discussion, visit: http://community.jboss.org/message/630644#630644
--------------------------------------------------------------
Hi,
I assume this is certainly a newbie question but i never worked on this pattern before so i'm quite stuck on the question and need some help.
Here is the case: i have some JBossWS webservices : they're just some usual classes with annotations like that:
@PermitAll
@WebService(targetNamespace=" http://www.ws.com/portal http://www.ws.com/portal", name="portal", serviceName="portal")
@SOAPBinding(style = SOAPBinding.Style.DOCUMENT)
public class WSPortal{
They're protected resource by JAAS, with a LDAPLoginModule which works fine for authentication, the trouble is that i didn't find a way to simply get the login of the connected user (or the principal or anything).
I used to work on servlets and this was quite simple to get it with HTTPServletRequest, but here, that doesn't fit :(
How am i supposed to get something on the user once i passed through JAAS in a JbossWS webservice class?
Maybe i'm not supposed to authenticate via JAAS, but i have no clue on the matter and i hope someone could help me about it!
Thank you very much by advance for your support,
SJ.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/630644#630644]
Start a new discussion in JBoss Web Services at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 6 months
[JNDI and Naming] - What does "Naming context is read-only" mean?
by Manabu Yoneyama
Manabu Yoneyama [http://community.jboss.org/people/amadablam] created the discussion
"What does "Naming context is read-only" mean?"
To view the discussion, visit: http://community.jboss.org/message/627906#627906
--------------------------------------------------------------
I'd like to run a simple web application with Hibernate4 on a JBoss AS7.
But I have an error below.
java.lang.UnsupportedOperationException: Naming context is read-only
I wrote hibernate.cfg.xml (snippet),
<session-factory name="">
<property name="connection.datasource">java:jboss/datasources/MySQL</property>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
</sessioin-factory>
and source code:
Configuration config = new Configuration().configure();
SessionFactory sessionFactory = config.buildSessionFactory(); // It might be causes the error.
I can connect datasouce "java:jboss/datasources/MySQL" use below code.
InitialContext context = new InitialContext();
ds = (DataSource)context.lookup("java:jboss/datasources/MySQL");
conn = ds.getConnection();
Does anyone know the reason for this?
Sorry for my english is poor.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/627906#627906]
Start a new discussion in JNDI and Naming at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 6 months
[jBPM] - reuse StatefulKnowledgeSession, is StatefulKnowledgeSession lightweight
by Nick Tan
Nick Tan [http://community.jboss.org/people/missedone] created the discussion
"reuse StatefulKnowledgeSession, is StatefulKnowledgeSession lightweight"
To view the discussion, visit: http://community.jboss.org/message/628462#628462
--------------------------------------------------------------
hi, folks
i'm using jBPM5 and here is question about how to effectively use the StatefulKnowledgeSession.
is StatefulKnowledgeSession lightweight?
is there any potential risk if we implement the strategy that create StatefulKnowledgeSession for each request, that means, create StatefulKnowledgeSession when every time call startProcess, and dispose it after the process instance complete.
I read the javadoc of StatefulKnowledgeSession, it clear state that: "
After the application finishes using the session, though, it *must* call the dispose() method in order to free the resources and used memory.
"
at this monment, what i can image is that, if there are lots of active process instance not complete, that will cause lots of StatefulKnowledgeSession resources not released, which could be potential memory leak? is this correct?
do you guys have any best practice or pattern of useing StatefulKnowledgeSession? for example, options like:
reuse single StatefulKnowledgeSession?
reuse StatefulKnowledgeSession in a pool?
oneStatefulKnowledgeSession per request?
Thanks
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/628462#628462]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 6 months
[JBoss Messaging] - QueueBrowser - JBossQueueBrowser$BrowserEnumeration cannot be cast to javax.jms.ObjectMessage
by everson .
everson . [http://community.jboss.org/people/everjava] created the discussion
"QueueBrowser - JBossQueueBrowser$BrowserEnumeration cannot be cast to javax.jms.ObjectMessage"
To view the discussion, visit: http://community.jboss.org/message/630744#630744
--------------------------------------------------------------
I'm trying scanning a queue and pick up a specific object there, but I'm getting the error below ....
QueueBrowser queueBrowser = session.createBrowser(queue);
Enumeration<ObjectMessage> messages = queueBrowser.getEnumeration();
while (messages.hasMoreElements()) {
* ObjectMessage objectMessage = (ObjectMessage) messages;// error here*
Jms jms = new Jms();
People p = jms.new People();
p = (People) objectMessage.getObject();
System.err.println(p.getName());
}
java.lang.ClassCastException: org.jboss.jms.client.JBossQueueBrowser$BrowserEnumeration cannot be cast to javax.jms.ObjectMessage
to send the message
session = connection.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
ObjectMessage om = session.createObjectMessage();
Jms jms = new Jms();
People p = jms.new People();
p.setNome("Testttttt");
om.setObject(p);
QueueSender sender = session.createSender(queue);
sender.send(om);
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/630744#630744]
Start a new discussion in JBoss Messaging at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 6 months