[JBoss Portal] - Seeking answers to a few questions about JBoss & WSRP
by muted
Hello,
I'm currently evaluating JBoss Portal for a potential project involving a few key customer portals and WSRP. I've read through most of the documentation and the wiki and created a few test portlets to demostrate the basic idea to the customers. However, a few key questions still need answering before we can commit to using JBoss as the portal server. I've done searching on the forums but these two are still unclear to me.
1) WSRP registration
Reading the user manual and wiki, I've understood that the current implementation of WSRP offers no registration possibilities for the WSRP producer side. However, I've noticed functions to force registration in the Javadocs.
(See http://docs.jboss.org/jbportal/v2.4/javadoc/org/jboss/portal/wsrp/produce... )
Is mandatory registration already possible and the documentation just doesn't reflect this yet or are there any patches or hotfixes/hacks that would enable us to require registration for the WSRP customers? The system we're planning on implementing would require a mandatory registration scheme.
2) User/session data
This is more of a general portlet/WSRP question. We haven't had time to test WSRP in action yet, we've just focused on creating some proof-of-concept portlets running on JBoss. When a user logs in to the WSRP customer's portal, am I correct in assuming that any setAttribute/getAttribute, getRemoteUser and similar-methods invoked in the RenderRequest will be based on the WSRP customer's session data. The reason I'm asking is that the system would use some data from the WSRP customer's user database to focus back-end searches on the corrent datasets.
Thank you in advance, I hope that we will be able to use JBoss Portal as the platform.
-Pekka
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3986168#3986168
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3986168
19Â years, 8Â months
[Security & JAAS/JBoss] - Calling LoginContext.login successful but SSO cookie not se
by bmcgovern
Ive gotten SSO to work for jboss portal and a supporting webapp on the same virtual host. But my login routine not only needs to authenticate the user against jboss portals user database, but also pull some information from a supporting database and work with it.
My problem is that I created a login method in my business layer that executes the following code and succesfully returns true of false for my login credentials. It however does not set the SSO cookie and I cannot figure out why not.
Incidently I tested the security constraint and login-config with both BASIC and FORM authentication and it works like a charm. Without changing anything but the login forms action from j_security_check to a MyController, which calls the method below -- it was working fine.
Any help ? Anyone.. Bueller?
Heres the code:
My Authentication Class
| public class SSOLogin {
| protected static final Log log = LogFactory.getLog(SSOLogin.class);
|
|
|
| public boolean authenticate(String userid, String password) throws LoginException {
| log.info("SSOLogin.authenticate(String, String) was called.");
| boolean result = false;
| try {
| log.info("SSOLogin.authenticate(String, String) creating LoginContext.");
| LoginContext loginContext = new LoginContext("myauth", new SSOCallbackHandler(userid, password));
| log.info("SSOLogin.authenticate(String, String) executing login.");
| loginContext.login();
| result = true;
| } catch (LoginException e) {
| // A production quality implementation would log this message
| log.info("Exception:: " + e.getMessage());
| result = false;
| throw e;
| }
| log.info("SSOLogin.authenticate(String, String) exiting method - Login was " + result);
| return result;
| }
| }
|
Which depends on a custom callback handler:
| public class SSOCallbackHandler implements CallbackHandler {
| protected static final Log log = LogFactory.getLog(SSOCallbackHandler.class);
|
| private String username;
| private char[] credentials;
|
| public SSOCallbackHandler(String username, String credentials) {
| super();
|
| this.username = username;
| this.credentials = credentials.toCharArray();
| }
|
| public void handle(Callback callbacks[])throws IOException, UnsupportedCallbackException {
|
| for (int i = 0; i < callbacks.length; i++) {
| if (callbacks instanceof NameCallback) {
| ((NameCallback) callbacks).setName(username);
| }
| else if (callbacks instanceof PasswordCallback) {
| ((PasswordCallback) callbacks).setPassword(credentials);
| } else {
| throw new UnsupportedCallbackException(callbacks);
| }
| }
| }
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3986161#3986161
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3986161
19Â years, 8Â months
[Installation, Configuration & Deployment] - Problem with deploying entity beans on Jboss
by hudowski
Hi!
Jboss 4.0.4 GA with EJB 3.0
J have a very simple application.
my-app.ear
-> Meta-inf
   -> application.xml
-> app-ejb-1.0.jar
      -> Meta-inf
         -> persistance.xml
      -> company
         -> app
            -> ejb
               -> entity
                  -> Document.class
                  -> Scan.class
               -> session
                  ->TestStatelessBean.class
            -> interfaces
               -> TestStatelessBeanLocal.class
---------------------------------------------------------------------------------
Persistance.xml:
<?xml version="1.0" encoding="UTF-8"?>
<persistence-unit name="app">
<jta-data-source>java:appDS</jta-data-source>
</persistence-unit>
------------------------------------------------------------------------------------
oracle9i-ds.xml (deployed on Jboss):
<local-tx-datasource>
<jndi-name>appDS</jndi-name>
<connection-url>jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=xxx)(PORT=1521)))(CONNECT_DATA=(SID=yyy)(SRVR=DEDICATED)))
</connection-url>
<driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
<user-name>eee</user-name>
...
<type-mapping>Oracle9i</type-mapping>
</local-tx-datasource>
J have this connection url( (DESCRIPTION=(ADDRESS....) defined in tnsames.ora so i think it's correct.
---------------------------------------------------------------------------------
Document.java:
@Entity
@Table(name = "DOCUMENTS")
public class Document implements java.io.Serializable
{
private static final long serialVersionUID = -2324201610375801418L;
private int doc_id;
private String name;
@Id
public int getDoc_id()
{
return doc_id;
}
public void setDoc_id(int id)
{
this.doc_id = id;
}
public String getName()
{
return name;
}
public void setName(String name)
{
this.name = name;
}
}
Scan.java is very similar to Document.java
-----------------------------------------------------------------------------------
My problem: Entity beans don't deploy. I see on Jboss:
[EARDeployer] Init J2EE application: file:/C:/jboss-4.0.4.GA/server/app/deploy/1app-ear-jboss-1.0.ear
[Ejb3Deployment] EJB3 deployment time took: 15
[JmxKernelAbstraction] installing MBean: jboss.j2ee:ear=1app-ear-jboss-1.0.ear,jar=app-ejb-1.0.jar,name=TestStatelessBean,service=EJB3 with dependencies:
[EJBContainer] STARTED EJB: comarch.app.ejb.session.TestStatelessBean ejbName: TestStatelessBean
[EJB3Deployer] Deployed: file:/C:/jboss-4.0.4.GA/server/app/tmp/deploy/tmp542761app-ear-jboss-1.0.ear-contents/app-ejb-1.0.jar
[EARDeployer] Started J2EE application: file:/C:/jboss-4.0.4.GA/server/app/deploy/1app-ear-jboss-1.0.ear
When I'm trying add into TestStatelessBean.java:
@PersistenceContext
private EntityManager manager;
i see warning:
WARN [ServiceController] Problem starting service jboss.j2ee:service=EJB3,module=app-ejb-1.0.jar
java.lang.RuntimeException: Field private javax.persistence.EntityManager comarch.app.ejb.session.TestStatelessBean.manager @PersistenceUnit in error: EMPTY STRING unitName but there is no deployments in scope
I think my Jboss doesn't see this Entity Beans. Maybe it's a problem with my definition of data source? I don't know how can I verify this data source. In oracle9i-ds.xml is '
<check-valid-connection-sql>select sysdate from dual
</check-valid-connection-sql>
but i can write bad connections (e.g. host which doesn't exist) and this ds is every time deployed on the Jboss without error.
I haven't got any idea where is the problem.
Please, help me!
Rafal
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3986159#3986159
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3986159
19Â years, 8Â months
[EJB/JBoss] - Some entity instances are not updated after merge
by galo.navarro
I have the following scenario:
Users get into a web page, a HTTP session is created and depending on their properties they get a collecition of Entity Beans, details are displayed in the browser and they can do some updates to them. These updates are executed via a Servlet, that uses a Stateless SB to perform the operations. I.e., calling the updateFlag method below.
When these updates happen everything seems alright, db is updated, I can find the entity with the entity manager and it retrieves the correct values etc. But if I look at the entity instance in the user session's collection its values are out of date.
As far as I've understood, every time merge is called on an entity bean, the entity manager should take care of updating all the instances of it, so all the collections that have an instance of the entity should reflect the update. This doesn't happen even for the user that executed the update.
Am I doing something wrong?
This is the code that performs the action in the servlet
| NOC n = accessBean.findNOC(id);
| accessBean.updateFlag(n);
|
SLSB
| @TransactionAttribute (TransactionAttributeType.REQUIRED)
| public NOC findNOC(Integer id) {
| return em.find(NOC.class, id);
| }
|
| @TransactionAttribute(TransactionAttributeType.REQUIRED)
| public NOC updateFlag(NOC noc) {
| noc.setFlagged(!noc.getFlagged());
| return saveNOC(noc);
| }
|
| @TransactionAttribute (TransactionAttributeType.REQUIRED)
| public NOC saveNOC(NOC noc) {
| noc.setDtTmStp(new Date());
| return em.merge(noc);
| }
|
Thanks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3986157#3986157
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3986157
19Â years, 8Â months