[JBoss Seam] - Strange problem
by Kruno
I am using Seam 1.2 and
I have a realy strange problem h:commandButton does not invoke method on the bean actually 4 and 5th phases are missing. There is no exception, nothing page is just rediplayed
jsp page:
|
| <%@ page contentType="text/html; charset=UTF-8" %>
| <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
| <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
| <%@ taglib uri="http://jboss.com/products/seam/taglib" prefix="s" %>
|
|
| <f:view>
| <html>
|
| <head>
| <title>Bugzzila</title>
|
| </head>
| <body>
|
| <h:form>
| <h:outputText id="prvi" value="Bok...!!!!!"/>
|
| <h:commandButton value="Citaj" type="submit" action="#{trazioper.readOper}" />
|
| <h:inputText value="#{operater.prezime}" />
|
| <h:inputText value="#{operater.ime}" />
|
| <h:commandButton value="Spremi" type="submit" action="#{trazioper.spremi}" />
|
| </h:form>
|
| </body>
| </html>
|
| </f:view>
|
Bean :
| package orka.oldshema.operater;
|
| import java.util.List;
|
| import javax.ejb.Remove;
| import javax.ejb.Stateful;
| import javax.ejb.TransactionAttribute;
| import javax.ejb.TransactionAttributeType;
| import javax.persistence.EntityManager;
| import javax.persistence.PersistenceContext;
|
| import org.jboss.seam.annotations.Destroy;
| 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.Out;
| import org.jboss.seam.annotations.datamodel.DataModel;
| import org.jboss.seam.log.Log;
|
| @Stateful
| @Name("trazioper")
| public class TraziOperBean implements TraziOper {
|
| @PersistenceContext
| EntityManager me;
|
| @Logger
| Log log;
|
| @SuppressWarnings("unused")
| @DataModel
| private List<Operater> lista;
|
| @Factory("lista")
| @SuppressWarnings("unchecked")
| @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
| public void citaj() {
| List l= me.createQuery("from Operater ")
| .getResultList();
| lista=l;
|
| }
|
| @In(required=false) @Out
| Operater operater;
|
|
| public void readOper(){
| operater= (Operater) me.createQuery("from Operater o where o.id='QA105'").getSingleResult();
| log.debug(operater.getPrezime());
|
| }
|
| public void spremi(){
| log.debug("spremi "+operater.getPrezime());
| me.persist(operater);
|
| }
|
|
|
| @Remove @Destroy
| public void destroy() {
|
|
| }
|
|
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4044471#4044471
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4044471
19 years, 1 month
[Tomcat, HTTPD, Servlets & JSP] - JBOSS shuts down Log4J when I redeploy web applications
by sschaub
I'm new to JBOSS, and hope someone can help with a logging problem.
First, environment: JBOSS 4.0.3SP1 running on Win XP Pro SP 2 with JRE 1.5.0_07. IDE: Eclipse 3.2.2.
The problem occurs when I make a change to an application and redeploy to a running JBOSS server. JBOSS notices the changed web.xml timestamp and redeploys the application properly. However, it shuts down Log4J, and further logging messages are not written to the log output. Here's a sample JBOSS log output when I redeployed an application:
| 15:30:20,015 INFO [DS01Controller] Hello, world!
| 15:30:50,890 INFO [TomcatDeployer] undeploy, ctxPath=/dc, warUrl=.../deploy/dc.
| war/
| 15:30:50,890 INFO [[/dc]] Closing WebApplicationContext of Spring FrameworkServ
| let 'dc'
| 15:30:50,890 INFO [XmlWebApplicationContext] Closing application context [WebAp
| plicationContext for namespace 'dc-servlet']
| 15:30:50,906 INFO [[/dc]] Shutting down Log4J
|
I have to restart JBOSS in order to get logging output re-enabled. Very undesirable.
This behavior occurs whether I launch JBOSS from the Eclipse IDE or from the usual external launch script.
This behavior does not occur in all of my web applications. As a test, I created a simple web application with a single servlet and only commons-logging-1.0.4.jar in the WEB-INF/lib folder. When I made a change to the servlet and redeployed, JBOSS did not shut down Log4J, and everything worked fine.
I'm at a loss as to what to try next. I'm really hoping for some suggestions, because right now our team is having to shutdown and restart JBOSS every time they make a code change and want to see logging output.
Thanks in advance,
Stephen
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4044467#4044467
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4044467
19 years, 1 month
[Installation, Configuration & Deployment] - how to configure Java Virtual Machine via JBOSS
by emclee_00
I got software that will run under Java web application
I already installed both j2sdk1.4.2_12 and jboss-3.2.7 in my machine
and web application, I successfully installed but I miss one thing
in the manual is running under Tomcat using Java Virtual Machine
I got JBOSS
here's the instruction
Configure the Java VM for Tomcat
Java VM for Tomcat must be configured on the
intended web server machine.
1. Select Configure Tomcat from Tomcat folder on
the Start Menu.
2. Select the Java VM tab
3. In the Java Options dialog box, enter the lines
detailed at the foot of this page.
Configuring the Java VM Java Options dialog
-Djavax.xml.transform.TransformerFactory=org.apache.xalan.xsltc.trax.SmartTransformerFactoryImpl
-Xmx200m
is there any way in JBOSS I can put this
- Djavax.xml.transform.TransformerFactory=org.apache.xalan.xsltc.trax.SmartTransformerFactoryImpl
-Xmx200m
I not a Java progammer I just follow and step by step instructions on
the web how to run web application.
hope you can help me on this.
Thanks,
Elmer
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4044463#4044463
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4044463
19 years, 1 month
[JBoss Seam] - Re: seam-pdf: footer in first page
by werter
Has the problem with the footer been fixed yet?
I need to display it in my reports, my clientes requested this, so if it is possible I would like to know how it`s done. If not, then I will unfortunately be forced to use another framework for reports, which so far I have had no luck integrating because when I try to write the generated PDF using
package com.snet.relatorio;
import java.io.IOException;
import java.io.InputStream;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.Map;
import javax.ejb.EJB;
import javax.ejb.Remove;
import javax.ejb.Stateful;
import javax.ejb.Stateless;
import javax.faces.application.Application;
import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseStream;
import javax.faces.webapp.FacesServlet;
import javax.persistence.EntityManager;
import javax.servlet.ServletContext;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletResponse;
import javax.sql.DataSource;
import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.JasperExportManager;
import net.sf.jasperreports.engine.JasperFillManager;
import net.sf.jasperreports.engine.JasperPrint;
import net.sf.jasperreports.engine.JasperPrintManager;
import net.sf.jasperreports.engine.JasperReport;
import net.sf.jasperreports.engine.JasperRunManager;
import net.sf.jasperreports.engine.util.JRLoader;
import net.sf.jasperreports.view.JasperViewer;
import org.hibernate.classic.Session;
import org.jboss.aspects.dbc.Dbc;
import org.jboss.seam.InterceptionType;
import org.jboss.seam.annotations.Create;
import org.jboss.seam.annotations.Destroy;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Intercept;
import org.jboss.seam.annotations.Interceptor;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.contexts.FacesApplicationContext;
import org.jboss.seam.core.ApplicationContext;
import org.jboss.seam.core.FacesMessages;
import org.springframework.web.servlet.view.jasperreports.JasperReportsPdfView;
@Stateless
//Name("relatorio")
@Intercept(value=InterceptionType.NEVER)
public class Relatorio implements RelatorioIf{
private String path;
private Connection con = null;
public void executar(EntityManager entityManager) throws SQLException, JRException, IOException {
ServletContext context = (ServletContext)FacesContext.getCurrentInstance().getExternalContext().getContext();
org.jboss.seam.core.FacesContext f = new org.jboss.seam.core.FacesContext();
ServletResponse response = (ServletResponse) f.getContext().getExternalContext().getResponse();
this.path = context.getRealPath("/pages/relatorios/jasper/teste.jasper");
Session session = (Session)entityManager.getDelegate();
this.con = session.connection();
JasperReport relatorio = (JasperReport)JRLoader.loadObject(this.path);
Map parametros = new HashMap();
byte[] bytes = JasperRunManager.runReportToPdf(relatorio, parametros, con);
response.setContentType("application/pdf");
response.setContentLength(bytes.length);
response.getOutputStream().write(bytes, 0, bytes.length);
response.getOutputStream().flush();
response.getOutputStream().close();
}
}
Any help would be greatly appreciated.
Darryl
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4044462#4044462
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4044462
19 years, 1 month