[JBoss Portal] - Re: JBoss Portal 2.6 Alpha 2 Release
by swestbom
Just a refinement to make debugging easier, but when I didn't set up the proxy settings for the JBoss server on my sandbox I got a rather ugly and uninformative error, this is because our environment returns an html element with an error message telling you to configure your proxy settings when it cannot find an external URL.
Not sure there is a good, clean way to deal with it since I am being redirected internally to an error page when it cannot find the URL internally, no HTTP error is returned.
16:09:22,538 INFO [Http11BaseProtocol] Starting Coyote HTTP/1.1 on http-0.0.0.0-8080
16:09:22,679 INFO [ChannelSocket] JK: ajp13 listening on /0.0.0.0:8009
16:09:22,710 INFO [JkMain] Jk running ID=0 time=0/78 config=null
16:09:22,726 INFO [Server] JBoss (MX MicroKernel) [4.0.5.GA (build: CVSTag=Branch_4_0 date=200610162339)] Started in 51s:712ms
16:09:29,975 ERROR [STDERR] [Fatal Error] :24:3: The element type "META" must be terminated by the matching end-tag "".
16:09:29,975 ERROR [NewsPortlet] Fatal Error reading/parsing XML Source.
org.xml.sax.SAXParseException: The element type "META" must be terminated by the matching end-tag "".
at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
at org.jboss.samples.portlet.news.NewsPortlet.doView(NewsPortlet.java:158)
at javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java:133)
at javax.portlet.GenericPortlet.render(GenericPortlet.java:306)
at org.jboss.portal.portlet.container.PortletContainer.invokeRender(PortletContainer.java:501)
at org.jboss.portal.portlet.container.PortletContainer.dispatch(PortletContainer.java:423)
at org.jboss.portal.portlet.container.PortletContainerInvoker$1.invoke(PortletContainerInvoker.java:81)
at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:131)
at org.jboss.portal.core.aspects.portlet.TransactionInterceptor.org$jboss$portal$core$aspects$portlet$TransactionInterceptor$invokeNotSupported$aop(TransactionInterceptor.java:85)
at org.jboss.portal.core.aspects.portlet.TransactionInterceptor$invokeNotSupported_N4547270787964792031.invokeNext(TransactionInterceptor$invokeNotSupported_N4547270787964792031.java)
at org.jboss.aspects.tx.TxPolicy.invokeInNoTx(TxPolicy.java:66)
at org.jboss.aspects.tx.TxInterceptor$NotSupported.invoke(TxInterceptor.java:102)
at org.jboss.portal.core.aspects.portlet.TransactionInterceptor$invokeNotSupported_N4547270787964792031.invokeNext(TransactionInterceptor$invokeNotSupported_N4547270787964792031.java)
at org.jboss.portal.core.aspects.portlet.TransactionInterceptor.invokeNotSupported(TransactionInterceptor.java)
at org.jboss.portal.core.aspects.portlet.TransactionInterceptor.invoke(TransactionInterceptor.java:55)
at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:38)
at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
at org.jboss.portal.core.aspects.portlet.HeaderInterceptor.invoke(HeaderInterceptor.java:51)
at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:38)
at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4020254#4020254
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4020254
19Â years, 2Â months
[JBoss Seam] - Reference a web bean in a seam stateless bean
by ector7280
I'm using Seam 1.1.6 with ICEFaces 1.5.3 I built a tree with a panel stack.
I need to be able to execute my business logic and then set the selected panel to the page that will contain the generated output.
I can forward to the page by itself but, I'd like to stay on the page with the tree and only replace the panel to the right of the tree.
Does anyone know how to gain access to a web bean from inside a stateless session bean?
Is there another way to do this?
JR
Here's the code:
faces-config.xml
| <?xml version="1.0" encoding="UTF-8"?>
| <!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN" "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
|
| <faces-config>
| <managed-bean>
| <managed-bean-name>panelStack</managed-bean-name>
| <managed-bean-class>gov.dot.marad.util.web.PanelStackBean</managed-bean-class>
| <managed-bean-scope>request</managed-bean-scope>
| </managed-bean>
| <managed-bean>
| <managed-bean-name>item</managed-bean-name>
| <managed-bean-class>gov.dot.marad.util.web.PanelSelectUserObject</managed-bean-class>
| <managed-bean-scope>request</managed-bean-scope>
| </managed-bean>
| <navigation-rule>
| <from-view-id>/userLogin.jspx</from-view-id>
| <navigation-case>
| <from-outcome>success</from-outcome>
| <to-view-id>/treeNavigation.jspx</to-view-id>
| <redirect/>
| </navigation-case>
| <navigation-case>
| <from-outcome>failure</from-outcome>
| <to-view-id>/userLogin.jspx</to-view-id>
| <redirect/>
| </navigation-case>
| </navigation-rule>
| <navigation-rule>
| <from-view-id>/createUser.jspx</from-view-id>
| <navigation-case>
| <from-outcome>success</from-outcome>
| <to-view-id>/treeNavigation.jspx</to-view-id>
| <redirect/>
| </navigation-case>
| <navigation-case>
| <from-outcome>failure</from-outcome>
| <to-view-id>/createUser.jspx</to-view-id>
| <redirect/>
| </navigation-case>
| </navigation-rule>
| <navigation-rule>
| <from-view-id>/treeNavigation.jspx</from-view-id>
| <navigation-case>
| <from-outcome>failure</from-outcome>
| <to-view-id>/userLogin.jspx</to-view-id>
| <redirect/>
| </navigation-case>
| </navigation-rule>
| <!-- A phase listener is needed by all Seam applications -->
|
| <lifecycle>
| <phase-listener>
| org.jboss.seam.jsf.TransactionalSeamPhaseListener
| </phase-listener>
| </lifecycle>
| </faces-config>
|
Stateless Bean
|
| import gov.dot.marad.persistence.ejb.model.Users;
| import gov.dot.marad.util.ApplicationProperties;
| import gov.dot.marad.util.EroomNameSpaceContext;
| import gov.dot.marad.util.eroom.BuildSoapCommand;
| import gov.dot.marad.util.eroom.SendEroomXml;
| import gov.dot.marad.util.web.ReportBean;
|
| import java.io.ByteArrayInputStream;
| import java.text.DateFormat;
| import java.text.ParseException;
| import java.text.SimpleDateFormat;
| import java.util.ArrayList;
| import java.util.Calendar;
| import java.util.List;
|
| import javax.ejb.Stateless;
| import javax.xml.xpath.XPath;
| import javax.xml.xpath.XPathConstants;
| import javax.xml.xpath.XPathExpressionException;
| import javax.xml.xpath.XPathFactory;
|
| import org.apache.xml.dtm.ref.DTMNodeList;
| import org.jboss.seam.annotations.Factory;
| import org.jboss.seam.annotations.In;
| import org.jboss.seam.annotations.Logger;
| import org.jboss.seam.annotations.Name;
| import org.jboss.seam.annotations.datamodel.DataModel;
| import org.jboss.seam.log.Log;
| import org.w3c.dom.DOMException;
| import org.xml.sax.InputSource;
|
| @Stateless
| @Name("link")
| public class LinkAction implements Link
| {
|
| @Logger
| private Log log;
|
| @In
| private Users users;
|
| @DataModel
| private List<ReportBean> reports;
|
| @Factory("reports")
| public String create()
| {
| log.info("Enter create");
|
| String reply = "failure";
| String path = null;
| byte[] command = null;
| byte[] response = null;
|
| ...
| int i = 0;
| // Store in a List and outject to next page
| reports = new ArrayList<ReportBean>();
| while (i < nodes)
| {
| ReportBean rb = new ReportBean();
| String name = nameNodes.item(i).getNodeValue();
| String id = nameNodes.item(i + 1).getNodeValue();
| rb.setLink(filePath + "/" + id + "/" + name);
| Calendar cal = Calendar.getInstance();
| String dateTime = nameNodes.item(i + 2).getNodeValue();
| String[] date = dateTime.split("T");
| SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd");
| cal.setTime(fmt.parse(date[0]));
| rb.setCreateDate(cal.getTime());
| rb.setName(name);
| rb.setCreator(nameNodes.item(i + 3).getNodeValue());
| String project = nameNodes.item(i + 4).getNodeValue();
| String[] projectName = project.split("/");
| rb.setProject(projectName[1]);
| reports.add(rb);
|
| i += 5;
| }
| } catch (XPathExpressionException e)
| {
| // TODO Auto-generated catch block
| e.printStackTrace();
| } catch (DOMException e)
| {
| // TODO Auto-generated catch block
| e.printStackTrace();
| } catch (ParseException e)
| {
| // TODO Auto-generated catch block
| e.printStackTrace();
| }
|
| return "/createLink.jspx";
| }
|
| }
|
treenavigation.jspx
<f:view xmlns:h="http://java.sun.com/jsf/html"
| xmlns:f="http://java.sun.com/jsf/core"
| xmlns:ice="http://www.icesoft.com/icefaces/component"
| xmlns:s="http://jboss.com/products/seam/taglib">
|
| <ice:outputDeclaration doctypeRoot="HTML"
| doctypePublic="-//W3C//DTD HTML 4.01 Transitional//EN"
| doctypeSystem="http://www.w3.org/TR/html4/loose.dtd" />
|
| <html>
| <head>
| <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></meta>
| <title>Tree Component Tutorial</title>
| <link href="./xmlhttp/css/xp/xp.css" rel="stylesheet" type="text/css" />
| </head>
|
| <body>
| <h2>Tree Selection Example</h2>
| <ice:form>
|
| <ice:panelGrid columns="2" cellspacing="5">
|
| <!-- first column, for tree navigation -->
| <ice:panelGroup style="border: 1px solid gray; height: 300px;">
| <!--
| This is a very links tree comprising of only text nodes. The
| expand and contract images are rendered because the "imageDir"
| attribute on the tree component has been set to a known path.
| -->
| <ice:tree id="tree" value="#{navTree.model}" var="item"
| hideRootNode="false" hideNavigation="false"
| imageDir="./xmlhttp/css/xp/css-images/">
| <ice:treeNode>
| <f:facet name="icon">
| <ice:panelGroup style="display: inline">
| <h:graphicImage value="#{item.userObject.icon}" />
| </ice:panelGroup>
| </f:facet>
| <f:facet name="content">
| <ice:panelGroup style="display: inline">
| <h:commandLink
| actionListener="#{item.userObject.selectPanelStackPanel}"
| value="#{item.userObject.text}" />
| </ice:panelGroup>
| </f:facet>
| </ice:treeNode>
| </ice:tree>
| </ice:panelGroup>
|
| <!-- Second column, for panel stack -->
| <ice:panelGroup style="border: 1px solid gray; width:350px ">
| <ice:panelStack selectedPanel="#{panelStack.selectedPanel}"
| styleClass="">
|
| <!-- splash panel -->
| <ice:panelGroup id="splash">
| <h3>Splash Page</h3>
|
| <p>Click on the tree nodes to change the slected panel in the
| panel stack component.</p>
| </ice:panelGroup>
|
| <!-- ICEfaces panel -->
| <ice:panelGroup id="icefaces">
| <jsp:directive.include file="./createFolder.jspx" />
| </ice:panelGroup>
|
| <!-- ICEbrowser panel -->
| <ice:panelGroup id="icebrowser">
| <s:link action="#{link.create}" value="Reports" />
| </ice:panelGroup>
|
| <!-- ICEpdf panel -->
| <ice:panelGroup id="icepdf">
| <h3>ICEpdf</h3>
|
| <p>The leading Java PDF document rendering and viewing
| solution designed to be easily integrated into Java enterprise
| applications.</p>
| </ice:panelGroup>
|
| <!-- Sub node 0-->
| <ice:panelGroup id="sub-node-0">
| <h3>Sub Node Zero</h3>
|
| <p>Say what?</p>
| </ice:panelGroup>
|
| <!-- Sub node 1 -->
| <ice:panelGroup id="sub-node-1">
| <h3>Sub Node One</h3>
|
| <p>Damn Skippy!</p>
| </ice:panelGroup>
| </ice:panelStack>
|
| </ice:panelGroup>
|
| </ice:panelGrid>
|
| </ice:form>
| </body>
| </html>
| </f:view>
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4020250#4020250
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4020250
19Â years, 2Â months
[Clustering/JBoss] - Clustering / Multicast routing
by lludlow2
I am running into an issue with runing multiple clustered instances of Jboss. These are on seperate servers (3 to be exact)
Here is what I am trying to do.
1. Route all multicast via a private network
route add -net 224.0.0.0 netmask 240.0.0.0 dev bond1
2. make a copy of the default server and name it foo.bar.com
3. Use custom start and stop scripts for each instance / site
su -l jboss -c '/apps/jboss/bin/run.sh -c foo.bar.com -b 172.25.1.52 -Djboss.partition.name=foo.bar.com --udp=224.10.10.10 > /dev/null 2> /dev/null &'
This should work. I tested that the default server will start and clustering works (needed to set the bind_addr for multicast).
However when I start the servers they do not see each other as cluster members. I have done a tcpdump and do see traffic from both nodes over bond1
I am curious if there is anyhting special I need to do... did I find a bug..
Any help would be greatly appreciated.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4020245#4020245
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4020245
19Â years, 2Â months
[EJB 3.0] - Annotations with interceptor behavior
by dsouza42
I was reading in Bill Burke's "Enterprise JavaBeans 3.0" book that I can create an annotation that will take on an interceptor's behavior by declaring the annotation itself with an interceptor such as in the example:
| @Interceptors(com.titan.interceptors.AuditInterceptors)
| public @interface Audit{
| }
|
So that this:
| @Audit
| public Object myMethod(){
| }
|
would be the same as placing the actual interceptor on my method. However, it's just not working for me. If I use a regular interceptor everything is fine, but if I try to do the annotation thing it doesn't work. The interceptor is simply not called.
I also was carefull to create the annotation with a Runtime retention type and appropriate target but still, nothing.
Any ideas on what I might be doing wrong?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4020243#4020243
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4020243
19Â years, 2Â months