[JBoss Portal] - setTitle() method didn't work
by sirishy
Hi
I'm using Jboss Portal 2.4 bundled version.
Portal page has two portlets say A and B.
There are several links in portlet A (I'm using index.jsp for displaying links in portlet A).
When I click on link_One in portlet A, the view_1.jsp is displayed in portlet B and when I click on link_two in portlet A, the view_2.jsp is displayed in portlet B.
I want to set the title for portlet B dynamically i.e., when portlet B loads the view_1.jsp it should set the portlet B title as "FIRST LINK" and when portlet B loads view_2.jsp, it should set the portlet B title as "SECOND LINK"
Currently in both view_1 and view_2 jsp's I have set the title with the syntax as mentioned below:
<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
<portlet:defineObjects/>
<%=renderResponse.setTitle("FIRST LINK")%>
<h3>Welcome to J2EE Services Site</h3>
But I'm getting the below error:
at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWor
kerThread.java:112)
at java.lang.Thread.run(Unknown Source)
Caused by: org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 3 in the jsp file: /WEB-INF/jsp/view_1.jsp
Generated servlet error:
The method print(boolean) in the type JspWriter is not applicable for the argume
nts (void)
at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErro
rHandler.java:84)
at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher
.java:328)
at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java
:414)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:297)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:276)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:264)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext
.java:563)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper
.java:303)
... 260 more
Please help me in resolving this issue.
Jboss portal 2.4 version supports the setTitle()? If not, let me know.
Thanks in advance!
thanks,
sirishy
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3991607#3991607
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3991607
18 years, 1 month
[Security & JAAS/JBoss] - How to implement Federated SSO using our own custom logon ap
by njw
Apologies if these appear to be really dumb questions, but I've spent most of this week going round in circles trying make sense of what I need to do and have failed miserably so far.
What I'm looking for is for someone to 'point me in the right direction' regarding what I'd need to do to implement SSO and Federation at our site. Although I'm familiar with the web app side of things (Struts, JDBC etc) and we use Jboss as our production server, I'm new to SAML, JAAS etc so please be gentle with me :-)
Our long-term strategy will put us in the position of having :-
- web apps hosted on our own servers which communicate with our own systems
- web apps hosted on our own servers which communicate with systems hosted on third party sites, mainly via web services
- third party companies who host web apps on their servers with whom we need to federate
What we want to do is intercept requests from users who are not logged on and reroute them to our own custom-written logon application, which prompts for user and password details. Once they are logged on it will forward the user onto their chosen web app and/or federate to one of our third party companies.
The wep apps are deployed as war files developed using Struts (and possibly Spring in the future).
There are a couple of key considerations :-
- the 'logon' web app will go beyond the standard 'user & password' entry in that it will be a two-stage process. On the first page we want to ask for the user id and one other item of data (probably birthdate), then use this to populate a second page where we ask for specific characters from their password (e.g characters 5 and 9). The character positions will vary each time and the length of the password will vary between users. This application will interface to an Oracle database where we maintain and validate the user details.
- as well as the user id the web apps will also need other attributes relating to that person, particularly data needed to identify the user at the third party companies. These id's will be stored on the Oracle database
- we want to avoid implementing a logon page for each application and use just a single standalone war file to do this
- we dont need to federate from Day 1, intially all we want is SSO between our apps but we dont want to have to redevelop later to support federation
So, how do I tie all the above together into one seamless experience for the user ?
I've downloaded JBoss Federated SSO but failed at the first hurdle because we're not using LDAP. I can see that I need to implement my own LoginProvider but cant work out what form this should take (war, ear etc), how to deploy it, or how it relates to the logon app we need to build, or how our 'business' apps understand which user they are dealing with
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3991605#3991605
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3991605
18 years, 1 month
[EJB/JBoss] - Transaction demarcation ignored in stateless EJB using injec
by amitka
Hi,
I'm using EJB3 stateless beans and entities defined in the persistence API with Hibernate validation annotations, all running in the same instance of JBoss 4.0.5 in the same EAR file.
I have a stateless EJB with an injected EntityManager instance variable. Methods in this bean use this entityManager to persist entity objects. I'm running a remote debugger on JBoss and I stepping on the entityManager.persist(...) commands inside the stateless bean implementation. At the same time I'm querying the DB (MySQL). I see that right after each persist invocation, the table includes another row, meaning JBoss is committing the transaction right after the persist, and not in the end of this method invocation.
I also tried throwing an exception from the bean between 2 persist commands, and I actually see that the DB contains only one row (representing the first persist).
This is strange, since as far as I understand, the entire invocation should be atomic. Have I misunderstood something...?
I tried marking the entire EJB with @TransactionManagement(TransactionManagementType.CONTAINER) and marking the method with several @TransactionAttributes (REQUIRED, REQUIRES_NEW).
A bit about the architecture of my application:
I have a servlet getting a reference from the JNDI to the stateless bean, which in turn uses an injected entity manager to persist the just-created entities.
A bit about the structure of my application:
The servlet is in a WAR, the stateless bean is in another JAR, and the entities are in a third archive (JAR).
The persistence.xml file is in the same JAR with the stateless bean, and it defines the persistence unit in the following manner:
<persistence-unit name="mycontext">
which means that I'm injecting this persistence unit to the EJB in the following manner:
@PersistenceContext(name = "mycontext") private EntityManager entityManager;
I'm getting the reference to that EJB from the servlet in the following manner:
(AuthenticationLocal)(new InitialContext().lookup(AuthenticationLocal.LocalJndiName)
(AuthenticationLocal.LocalJndiName is actually defined in AuthenticationLocal the following way:
public static final String LocalJndiName = EAR_FILE_NAME + "/" + AuthenticationBean.class.getSimpleName() + "/local";
Thanks,
Amit Kasher
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3991601#3991601
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3991601
18 years, 1 month
[JBoss Seam] - Re: Possible component.xml problem in 1.1.0 CR2
by quilleashm
Ok thanks. I've played around more and got a bit further but I think I'm in to work-around territory rather than fixing the problem properly.
Here is my current components.xml
| <?xml version="1.0" encoding="UTF-8"?>
| <components xmlns="http://jboss.com/products/seam/components"
| xmlns:core="http://jboss.com/products/seam/core"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xsi:schemaLocation=
| "http://jboss.com/products/seam/core http://jboss.com/products/seam/core-1.1.xsd
| http://jboss.com/products/seam/components http://jboss.com/products/seam/components-1.1.xsd">
|
| <core:init debug="true"/>
|
| <!-- adding this makes the NPE go away -->
| <core:locale-selector/>
|
| <core:managed-hibernate-session name="referenceSession"/>
|
| <core:hibernate-session-factory name="hibernateSessionFactory"/>
|
| </components>
|
I added the locale-selector component here explicitly which forces it to load and means my web page serves up properly. However I still get a couple of other NPEs.
| WARNING: phase(RESTORE_VIEW 1,com.sun.faces.context.FacesContextImpl@6fe350) threw exception: java.lang.NullPointerException null
| org.jboss.seam.jsf.AbstractSeamPhaseListener.beforePhase(AbstractSeamPhaseListener.java:110)
| org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:58)
| com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:214)
| com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:113)
| javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
| org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:270)
| org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:191)
| org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:227)
| org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
| org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
| org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
| org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
| org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:211)
| org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:817)
| org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:623)
| org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:444)
| java.lang.Thread.run(Thread.java:595)
|
| 06-Oct-2006 11:03:27 com.sun.faces.lifecycle.LifecycleImpl phase
| WARNING: phase(RENDER_RESPONSE 6,com.sun.faces.context.FacesContextImpl@6fe350) threw exception: java.lang.IllegalStateException: No Manager could be created, make sure the Component exists in application scope No Manager could be created, make sure the Component exists in application scope
| org.jboss.seam.core.Manager.instance(Manager.java:254)
| org.jboss.seam.jsf.AbstractSeamPhaseListener.beforeRender(AbstractSeamPhaseListener.java:184)
| org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:51)
| com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:214)
| com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:140)
| javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
| org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:270)
| org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:191)
| org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:227)
| org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
| org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
| org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
| org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
| org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:211)
| org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:817)
| org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:623)
| org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:444)
| java.lang.Thread.run(Thread.java:595)
|
Which are both similar to the locale problem. I found that the Component.forName(name) (which looks up components in the application context) call in Component.getInstance() is returning null. It was doing this for the locale-setting until I included it my components.xml but I don't think I should be putting all the core components in my components file.
I will keep investigating but any insight or ideas about why the core components don't seem to be loading automatically would be appreciated.
Thanks.
Mike.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3991600#3991600
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3991600
18 years, 1 month
[Remoting] - Re: No connection possible after an illegitimate attempt
by Clarich
I don't know if this matches the previous mentioned issue or if this is an issue for its own, but I have the problem that when running two Clients using Transporters to connect to a target POJO on the server side and using SSL to do this, always the second client is handled as beeing the first client.
I mean when the first Client is trusted by the Server, the second client is also, althogh it should not. The other way round, if the first Client is not trusted the second is not ,too, althogh it should be trusted.
here is some sample code describing my problem:
---Client code---
| package client;
|
| import java.net.MalformedURLException;
|
| import org.jboss.remoting.InvokerLocator;
| import org.jboss.remoting.security.SSLSocketBuilder;
| import org.jboss.remoting.transporter.TransporterClient;
|
| import server.HandlerInterface;
|
| public class Client {
| /**
| * the Object containing all information about the Server location
| */
| protected InvokerLocator locator;
|
| /**
| * Constructor - initializes the locator and sets properties
| */
| public Client(String user) {
| if (user == "user1") {
| System.setProperty(SSLSocketBuilder.STANDARD_KEY_STORE_FILE_PATH,
| "./certificates/client/user1.keystore");
| System.setProperty(SSLSocketBuilder.STANDARD_KEY_STORE_PASSWORD,
| "client");
| System.setProperty(SSLSocketBuilder.STANDARD_TRUST_STORE_FILE_PATH,
| "./certificates/client/user1.truststore");
| System.setProperty(SSLSocketBuilder.STANDARD_TRUST_STORE_PASSWORD,
| "client");
| System.setProperty(InvokerLocator.FORCE_REMOTE, "true");
| }
| if (user == "user2") {
| System.setProperty(SSLSocketBuilder.STANDARD_KEY_STORE_FILE_PATH,
| "./certificates/client/user2.keystore");
| System.setProperty(SSLSocketBuilder.STANDARD_KEY_STORE_PASSWORD,
| "client");
| System.setProperty(SSLSocketBuilder.STANDARD_TRUST_STORE_FILE_PATH,
| "./certificates/client/user2.truststore");
| System.setProperty(SSLSocketBuilder.STANDARD_TRUST_STORE_PASSWORD,
| "client");
| System.setProperty(InvokerLocator.FORCE_REMOTE, "true");
| }
|
| try {
| locator = new InvokerLocator("sslsocket://127.0.0.1:7070");
| } catch (MalformedURLException e) {
| e.printStackTrace();
| }
| }
|
| /**
| * reqests the Server for an handle
| */
| public void requestHandle() {
| HandlerInterface handler = null;
| try {
| handler = (HandlerInterface) TransporterClient
| .createTransporterClient(locator, HandlerInterface.class);
| System.out.println("server returned: " + handler.doHandle());
|
| } catch (Exception e) {
| e.printStackTrace();
| } finally {
| if (handler != null) {
| TransporterClient.destroyTransporterClient(handler);
| }
| }
| }
|
| public static void main(String[] args) {
| System.out.println("starting client for claudia");
| Client client = new Client("user1");// is trusted
|
| // should print a String
| client.requestHandle();
|
| System.out.println("starting client for michael");
| Client client2 = new Client("user2");// is not trusted
|
| // should not print a String but throw an exception
| client2.requestHandle();
| }
| }
|
---Server Code---
| package server;
|
| import java.io.IOException;
| import java.util.HashMap;
| import java.util.Map;
|
| import org.jboss.remoting.security.SSLSocketBuilder;
| import org.jboss.remoting.transporter.TransporterServer;
|
| public class Server {
|
| private static TransporterServer server;
|
| /**
| * runs and starts the Server
| *
| * @param args
| */
| public static void main(String[] args) {
| String locatorURL = "sslsocket://127.0.0.1:7070";
|
| HandlerInterface handler = new Handler();
| try {
| Map config = getConfiguration();
| server = TransporterServer.createTransporterServer(locatorURL,
| handler, HandlerInterface.class.getName(), config, false);
| server.start();
| } catch (Exception e) {
| e.printStackTrace();
| }
|
| }
|
| /**
| * creates a ServerSocketFactory that is configured by using an
| * SSLSocketBuilder
| *
| * @return configuration Map
| * @throws IOException
| * if the Factory could not be created
| */
| private static HashMap getConfiguration() {
| HashMap<String, String> sslConfig = new HashMap<String, String>();
|
| sslConfig.put(SSLSocketBuilder.REMOTING_KEY_STORE_FILE_PATH,
| "./certificates/server/Server.keystore");
| sslConfig.put(SSLSocketBuilder.REMOTING_KEY_STORE_PASSWORD, "pass");
| sslConfig.put(SSLSocketBuilder.REMOTING_TRUST_STORE_FILE_PATH,
| "./certificates/server/Server.truststore");
| sslConfig.put(SSLSocketBuilder.REMOTING_TRUST_STORE_PASSWORD,
| "pass");
| sslConfig.put(SSLSocketBuilder.REMOTING_CLIENT_AUTH_MODE,
| SSLSocketBuilder.CLIENT_AUTH_MODE_NEED);
| sslConfig.put("numAcceptThreads", "2");
| return sslConfig;
| }
| }
|
---HandlerInterface (POJO) returning a String to the Client if trusted---
| package server;
|
| public interface HandlerInterface {
|
| public abstract String doHandle();
|
| }
|
The keystore of user1 is stored in the servers truststore, but the keystore of user2 is not
I switched around the two client in the Client.main method and got the result I described above.
Could anybody tell me why this happens? Might this be another Bug?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3991599#3991599
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3991599
18 years, 1 month
[Microcontainer] - Re: JMX Decorator for POJOs - suggestion
by adrian@jboss.org
No because this breaks the whole idea of "do one thing well".
The microcontainer is a dependency state machine.
Besides, despite your assertion only a small percentage of POJOs end up in JNDI
and then not always trivially, e.g. they need to wrapped in object factories.
There already is a mechansim to add adhoc metadata to beans that can
be processed by pluggable interceptors so you can do
| <bean ...>
| <annotation>org.jboss.jndi.JNDIBinding("blah")</annotation>
|
| or
|
| <bean annotation org.jboss.jndi.JNDIBinding(value="blah" objectFactory=com.acme.SomeObjectFactory)
|
Which makes this much more extenisbe in terms of matching the
metadata (the annotation) to the implementation (the aspect).
Additionally, you can meta-annotate the metadata to say it requires another service,
e.g.
| @Depends("jboss:service=Naming")
| public @interface JNDIBinding
| ...
|
So you know beans annotated with JNDIBinding must wait for the Naming Service
to start.
This is a much more generic mechanism than the "hacky" approach you describe.
1) It requires not extra handling in the microcontainer
2) You can use AOP to map the metadata to any aspect implementation you like
3) The metadata is extensible as new requirements are understood.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3991598#3991598
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3991598
18 years, 1 month