Everything Java Apache Geospatial Open Source. Hello Shinning Stars!!! Vincent Massol, Raphael Luta, Santiago Gala, Carsten Z.

Thursday, March 25, 2004

This discussion looks like a good one about Maven, Tutorial: Using Maven to build your J2EE Projects.

My current problem was : org.apache.commons.beanutils.ConversionException: No value specified. See the stacktrace below. A small change to web.xml resolved it.



<init-param>
<param-name>convertNull</param-name>
<param-value>true</param-value>
</init-param>



org.apache.commons.beanutils.ConversionException: No value specified
at org.apache.commons.beanutils.converters.BigDecimalConverter.convert(BigDecimalConverter.java:148)
at org.apache.commons.beanutils.BeanUtils.copyProperty(BeanUtils.java:447)
at org.apache.commons.beanutils.BeanUtils.copyProperties(BeanUtils.java:264)
at com.application.sea.logic.referentiel.produit.ProduitLogic.doFindGammeProduitByPK(ProduitLogic.java:458)
at com.application.sea.logic.referentiel.grilleTarif.GrilleTarifLogic.loadObjGrilleTarifExt(GrilleTarifLogic.java:938)
at com.application.sea.logic.referentiel.grilleTarif.GrilleTarifLogic.loadJspConsulterListeGrilleTarif(GrilleTarifLogic.java:440)
at com.application.sea.struts.action.referentiel.grilleTarif.ConsulterListeGrillesTarifsAction.execute(ConsulterListeGrillesTarifsAction.java:68)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2416)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:601)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
at java.lang.Thread.run(Thread.java:536)
Tomcat uses a ThreadPool, PoolTcpEndpoint, Http11Protocol, Http11Processor, CoyoteAdapter, Valve, Filter for each request made to the server.
Expoloring filters in tomcat. See ApplicationFilterChain.internalDoFilter(request, response)

Wednesday, March 24, 2004

I am compiling the following packages :




  1. javax.management

  2. junit

  3. mx4j

  4. org.apache.bcel

  5. org.apache.catalina

  6. org.apache.commons.beanutils

  7. org.apache.commons.collections

  8. org.apache.commons.daemon

  9. org.apache.commons.dbcp

  10. org.apache.commons.digester

  11. org.apache.commons.fileupload

  12. org.apache.commons.jocl

  13. org.apache.commons.lang

  14. org.apache.commons.logging

  15. org.apache.commons.modeler

  16. org.apache.commons.pool

  17. org.apache.commons.validator

  18. org.apache.coyote

  19. org.apache.log4j

  20. org.apache.naming

  21. org.apache.oro

  22. org.apache.regexp

  23. org.apache.struts

  24. org.apache.taglibs

  25. org.apache.tomcat

  26. org.apache.tools.ant

  27. org.displaytag


Tuesday, March 23, 2004

This error means that you have not defined a Tiles definition for the string ref.grilletarif.SupprimerValeurTarif, and struts is looking for an action path or a jsp that starts with the character /.




java.lang.IllegalArgumentException: Le chemin ref.grilletarif.SupprimerValeurTarif ne commence pas par le caractère "/"
at org.apache.catalina.core.ApplicationContext.getRequestDispatcher(ApplicationContext.java:1179)
at org.apache.catalina.core.ApplicationContextFacade.getRequestDispatcher(ApplicationContextFacade.java:174)
at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1062)
at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:274)
at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:320)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2416)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:601)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
at java.lang.Thread.run(Thread.java:536)

Monday, March 22, 2004

Junit compiles with Ant.
Building Apache Ant, Junit, Jakarat-Commons


Ant was a piece of cake. I just typed ./build.sh and Ant compiles itself. Jakarta-Commons presented problems though. The following error occured.




[phil@dc027 jakarta-commons]$ ant
Buildfile: build.xml

docs:

BUILD FAILED
/home/phil/source/MastersCheckedOut/jakarta-commons/build.xml:104: taskdef class org.apache.velocity.anakia.AnakiaTask cannot be found


I will be coming back to this point but for now I am doing ant dist...shit...failed...can't find junit.

Thursday, March 18, 2004

Example : My sample code for using struts and digester to parse struts-config.xml and insert the actions in a database.


package com.application.sea.exec;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

import org.apache.commons.digester.Digester;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts.config.ActionConfig;
import org.apache.struts.config.ConfigRuleSet;
import org.apache.struts.config.ModuleConfig;
import org.apache.struts.config.ModuleConfigFactory;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;

import com.application.sea.Factories;
import com.application.sea.dao.Autorisation;
import com.application.sea.dao.AutorisationDao;
import com.application.sea.dao.AutorisationDaoException;
import com.application.sea.dao.Strutsaction;
import com.application.sea.dao.StrutsactionDao;
import com.application.sea.dao.StrutsactionDaoException;
import com.application.sea.dao.jdbc.ConnectionManager;
import com.application.sea.sql.ConnectionManagerException;
import com.application.sea.struts.CustomMapping;

/**
*
* @author pdonaghy
*
* An object used to populate the database with strutsaction data.
*/
public class InsertStrutsActions {

private static Log log = LogFactory.getLog(InsertStrutsActions.class);

protected String registrations[] =
{
"-//Apache Software Foundation//DTD Struts Configuration 1.0//EN",
"/org/apache/struts/resources/struts-config_1_0.dtd",
"-//Apache Software Foundation//DTD Struts Configuration 1.1//EN",
"/org/apache/struts/resources/struts-config_1_1.dtd",
"-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN",
"/org/apache/struts/resources/web-app_2_2.dtd",
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN",
"/org/apache/struts/resources/web-app_2_3.dtd" };

public InsertStrutsActions() {
}

public void insert(File file) throws Exception {

// Create required struts objects.
ModuleConfigFactory factoryObject = ModuleConfigFactory.createFactory();
ModuleConfig config = factoryObject.createModuleConfig("");

// Set up the Digester for parsing struts-config.xml
Digester digester = new Digester();
digester.setNamespaceAware(true);
digester.setValidating(true);
digester.setUseContextClassLoader(true);
digester.addRuleSet(new ConfigRuleSet());
config.setActionMappingClass("com.application.sea.struts.CustomMapping");
digester.push(config);
for (int i = 0; i < registrations.length; i += 2) {
URL url = this.getClass().getResource(registrations[i + 1]);
if (url != null) {
digester.register(registrations[i], url.toString());
}
}

// Parse the struts-config.xml file.
FileInputStream fis = null;
try {
fis = new FileInputStream(file);
digester.parse((InputStream) fis);
} catch (FileNotFoundException e) {
e.printStackTrace();
log.error(e.getClass().getName(), e);
throw new Exception(e.getClass().getName() + " " + e.getMessage());
} catch (IOException e) {
e.printStackTrace();
log.error(e.getClass().getName(), e);
throw new Exception(e.getClass().getName() + " " + e.getMessage());
} catch (SAXParseException e) {
e.printStackTrace();
log.error(e.getClass().getName(), e);
throw new Exception(e.getClass().getName() + " " + e.getMessage());
} catch (SAXException e) {
e.printStackTrace();
log.error(e.getClass().getName(), e);
throw new Exception(e.getClass().getName() + " " + e.getMessage());
} catch (ArrayIndexOutOfBoundsException e) {
e.printStackTrace();
log.error(e.getClass().getName(), e);
log.error(
"Usage : java "
+ InsertStrutsActions.class
+ " struts-config.xml");
throw new Exception(e.getClass().getName() + " " + e.getMessage());
} finally {
if (fis != null) {
try {
fis.close();
} catch (IOException e1) {
log.error("Error closing the file input stream.");
}
}
}

// Rapid mapping between autorisation key and id
Map autoMap = new HashMap();
try {
ConnectionManager.createReadOnlyConnection();
AutorisationDao autoDao =
Factories.getDaoFactory().getAutorisationDao();
Autorisation[] autos = autoDao.findAll();
for (int i = 0; i < autos.length; i++) {
autoMap.put(
autos[i].getAutCode(),
new Integer(autos[i].getAutId()));
}
} catch (AutorisationDaoException e) {
e.printStackTrace();
log.error(e.getClass().getName(), e);
throw new Exception(e.getClass().getName() + " " + e.getMessage());
} catch (ConnectionManagerException e) {
e.printStackTrace();
log.error(e.getClass().getName(), e);
throw new Exception(e.getClass().getName() + " " + e.getMessage());
} finally {
ConnectionManager.destroyReadOnlyConnection();
}

// Insert data from the config into the database.
ActionConfig[] actionConfigs = config.findActionConfigs();
try {

// the connection.
ConnectionManager.createConnection();

// delete all lignemenu int the database
/*try {
LignemenuDao_ImplExt daoLigneMenu = (LignemenuDao_ImplExt)Factories.getDaoFactoryExt().getLignemenuDaoExt();
Lignemenu[] lignemenu = daoLigneMenu.findAll();

//Attention on doit delete les fils avants les pères
for (int i = lignemenu.length-1; i>=0 ; i--) {
daoLigneMenu.delete(new LignemenuPK(lignemenu[i].getLmenuId()));
}
} catch (LignemenuDaoException e) {
e.printStackTrace();
log.error(e.getClass().getName(), e);
ConnectionManager.rollBackConnection();
throw new Exception(e.getClass().getName() + " " + e.getMessage());
}*/

// the dao which perfoms the insert.
StrutsactionDao dao =
Factories.getDaoFactory().getStrutsactionDao();

// delete all struts actions in the database.
/*Strutsaction[] actions = dao.findAll();
for (int i = 0; i < actions.length; i++) {
// delete all existing struts actions
dao.delete(new StrutsactionPK(actions[i].getSactionId()));
}*/

// add new struts actions from struts-config.xml

// on récupère le max id de la base
int sactionID = 0;
Strutsaction[] strutsactionTab = dao.findAll();
int max = 0;
for (int i = 0; i < strutsactionTab.length; i++) {
Strutsaction strutsaction = strutsactionTab[i];
if (sactionID < strutsaction.getSactionId()) {
sactionID = strutsaction.getSactionId();
}
}
System.out.println(sactionID);
sactionID++; // on incrémente

//insert only the new strutsaction
for (int i = 0; i < actionConfigs.length; i++) {

//test si cet action est deja en base, si NON on insert , si OUI on ne fait rien
Object[] tab =
dao.findWhereSactionPath(actionConfigs[i].getPath());
if (tab.length == 0) {
CustomMapping cm = (CustomMapping) actionConfigs[i];
Strutsaction element = new Strutsaction();
//element.setSactionId(i);
element.setSactionId(sactionID);
if (cm.getAutorisation() == null) {
System.err.println(
"Action "
+ cm.getPath()
+ " does not specify an autorisation property. It will be ignored.");
continue;
}
Integer idInt = (Integer) autoMap.get(cm.getAutorisation());
//log.debug("id : " + idInt + " i : " + i);
/*if (i == 108) {
log.debug("stop");
}*/
int id = idInt.intValue();
element.setAppIdNull(true);
element.setAutId(id);
element.setSactionPath(actionConfigs[i].getPath());
element.setSactionCreequand(new Date());
element.setSactionModifquand(new Date());
log.debug(
"INSERTION DE L'ACTION " + element.getSactionPath());
dao.insert(element);
sactionID++;
}
}
ConnectionManager.commitConnection();

} catch (StrutsactionDaoException e) {
e.printStackTrace();
log.error(e.getClass().getName(), e);
ConnectionManager.rollBackConnection();
throw new Exception(e.getClass().getName() + " " + e.getMessage());
} catch (ConnectionManagerException e) {
e.printStackTrace();
log.error(e.getClass().getName(), e);
ConnectionManager.rollBackConnection();
throw new Exception(e.getClass().getName() + " " + e.getMessage());
} finally {
try {
ConnectionManager.destroyConnection();
} catch (ConnectionManagerException e) {
e.printStackTrace();
log.error(e.getClass().getName(), e);
throw new Exception(
e.getClass().getName() + " " + e.getMessage());
}
}

// Destroy the digester.
digester = null;
}

public static void main(String[] args) throws Exception {
InsertStrutsActions isa = new InsertStrutsActions();
File file = new File(args[0]);
try {
isa.insert(file);
log.info("Insert completed successfully.");
} catch (Exception e) {
log.info("Insert failed. See above stack trace.");
throw e;
}
}

}

Wednesday, March 17, 2004

My sample code example of dbcp and object pooling.

/**
* Initializes the connection pool.
*/
private static void init() throws ConnectionManagerException {
/**
* Add driver to the system properties.
*/
Properties prp = System.getProperties();
prp.put("jdbc.drivers", ConnectionManager.JDBC_DRIVER);
System.setProperties(prp);
/**
* log properties
*/
log.info("JDBC driver : " + JDBC_DRIVER);
log.info("JDBC url : " + JDBC_URL);
log.info("JDBC user : " + JDBC_USER);
log.info("JDBC password : " + JDBC_PASSWORD);
/**
* Create connection pool.
*/
try {
GenericObjectPool connectionPool = new GenericObjectPool(null);
log.debug("Established GenericObjectPool.");
DriverManagerConnectionFactory connectionFactory =
new DriverManagerConnectionFactory(
ConnectionManager.JDBC_URL,
ConnectionManager.JDBC_USER,
ConnectionManager.JDBC_PASSWORD);
log.debug("Established DriverManagerConnectionFactory.");
PoolableConnectionFactory poolableConnectionFactory =
new PoolableConnectionFactory(
connectionFactory,
connectionPool,
null,
null,
false,
true);
log.debug("Established PoolableConnectionFactory.");
dataSource = new PoolingDataSource(connectionPool);
log.debug("Initialized PoolingDataSource.");
} catch (Exception e) {
e.printStackTrace();
log.fatal(
Messages.getString(
"com.application.sea.dao.jdbc.ConnectionManager.init.error"),
e);
throw new ConnectionManagerException(
Messages.getString(
"com.application.sea.dao.jdbc.ConnectionManager.init.error"));
}
log.info("Connection pooling established.");
}
My sample code example of encode and decode serialization and deserialization.

// Serialize
ByteArrayOutputStream baos = new ByteArrayOutputStream();
OutputStream eos = MimeUtility.encode(baos, "base64");
ObjectOutputStream os = new ObjectOutputStream(eos);
os.writeObject(p);
os.close();
eos.close();
baos.close();
String serObj = baos.toString();
System.out.println(serObj);

// Deserialize
ByteArrayInputStream bais =
new ByteArrayInputStream(serObj.getBytes());
InputStream ein = MimeUtility.decode(bais, "base64");
ObjectInputStream in = new ObjectInputStream(ein);
Point xy = (Point) in.readObject();
in.close();
ein.close();
bais.close();

Wednesday, March 10, 2004

You can easily make mistakes in the struts-config.xml file module configuration, The Struts User Guide - Building Controller Components. I recommend using xdoclet to generate the form-bean configuration, and velocity templates to generate the bean itself from a OJB xml file. This may help to avoid common 503 errors such as :


org.apache.jasper.JasperException: Impossible d''utiliser faire-suivre (forward) après que la réponse ait été envoyée
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2416)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:601)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
at java.lang.Thread.run(Thread.java:536)


cause mère

java.lang.IllegalStateException: Impossible d''utiliser faire-suivre (forward) après que la réponse ait été envoyée
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:368)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:356)
at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:430)
at org.apache.jsp.index_jsp._jspService(index_jsp.java:42)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2416)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:601)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
at java.lang.Thread.run(Thread.java:536)

ERROR Thread-8 2004:03:10:04:06:31 org.apache.commons.digester.Digester endElement line 1060 End event threw exception
java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedMethodAccessor56.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:252)
at org.apache.commons.digester.SetNextRule.end(SetNextRule.java:256)
at org.apache.commons.digester.Rule.end(Rule.java:276)
at org.apache.commons.digester.Digester.endElement(Digester.java:1058)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.emptyElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.commons.digester.Digester.parse(Digester.java:1548)
at org.apache.struts.action.ActionServlet.parseModuleConfigFile(ActionServlet.java:1006)
at org.apache.struts.action.ActionServlet.initModuleConfig(ActionServlet.java:955)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:470)
at com.application.sea.struts.CustomServlet.init(CustomServlet.java:14)
at javax.servlet.GenericServlet.init(GenericServlet.java:256)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:935)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:668)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:653)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:432)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:356)
at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:430)
at org.apache.jsp.index_jsp._jspService(index_jsp.java:42)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2416)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:601)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
at java.lang.Thread.run(Thread.java:536)
Caused by: java.lang.IllegalArgumentException: Property tprestaId already defined
at org.apache.struts.config.FormBeanConfig.addFormPropertyConfig(FormBeanConfig.java:222)
... 65 more
ERROR Thread-8 2004:03:10:04:06:31 org.apache.struts.action.ActionServlet handleConfigException line 1034 Parsing error processing resource path
java.lang.IllegalArgumentException: Property tprestaId already defined
at org.apache.commons.digester.Digester.createSAXException(Digester.java:2540)
at org.apache.commons.digester.Digester.createSAXException(Digester.java:2566)
at org.apache.commons.digester.Digester.endElement(Digester.java:1061)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.emptyElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.commons.digester.Digester.parse(Digester.java:1548)
at org.apache.struts.action.ActionServlet.parseModuleConfigFile(ActionServlet.java:1006)
at org.apache.struts.action.ActionServlet.initModuleConfig(ActionServlet.java:955)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:470)
at com.application.sea.struts.CustomServlet.init(CustomServlet.java:14)
at javax.servlet.GenericServlet.init(GenericServlet.java:256)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:935)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:668)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:653)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:432)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:356)
at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:430)
at org.apache.jsp.index_jsp._jspService(index_jsp.java:42)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2416)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:601)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
at java.lang.Thread.run(Thread.java:536)
Choose your action forwards wisely. In the case of an error you want to show the error to the user. Choose whether the error should be displayed on the callers page ( in the case of a form ) or on the destination page ( in the case of static info ). Use the input attribute of the action mapping as the error page or place a html:error tag on the destination page, but make sure that your destination page does not depend on a request attibute or bean that may cause an error on the page. Taglibs usually prevent null pointer exceptions. See the struts guidelines for creating action classes, The Struts User Guide - Building Controller Components
Elba unites Geronimo and JBoss. Read the thread, Re: [jotm] Apache Geronimo

Thursday, March 04, 2004

Ant v1.5.3 documentation discourages the precompilation of java server pages using the jspc task. It recommends deploying and running your junit httpunit tests to compile AND test your pages all in one go.
Edit myBlog.

Wednesday, March 03, 2004

Tuesday, March 02, 2004

MDA is growing fast. This project from the Object Management Group may be helpful. OMG MDA FastStart Program Office
Open Source Initiative OSI - Open Source Awards have been anounced. The winners are valgrind, videoLAN, Jack, and pango.

Monday, March 01, 2004

Solution to microsoft JDBC problem "Can't start a cloned connection while in manual transaction mode.". I would suggest that you look at the implementation of the microsoft JDBC driver before implementing this solution, but you can't. So look at the JDBC specifications in particular "cursor".

Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");

Properties p = new Properties();

p.put("selectMethod","cursor");

p.put("user","phil");

p.put("password","phil");

connection = DriverManager.getConnection("jdbc:microsoft:sqlserver://mydata:1433");



java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Can't start a cloned connection while in manual transaction mode.
at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
at com.microsoft.jdbc.base.BaseConnection.getImplConnection(Unknown Source)
at com.microsoft.jdbc.base.BaseStatement.setupImplConnection(Unknown Source)
at com.microsoft.jdbc.base.BaseStatement.(Unknown Source)
at com.microsoft.jdbc.base.BasePreparedStatement.(Unknown Source)
at com.microsoft.jdbc.base.BaseConnection.prepareStatement(Unknown Source)
at com.microsoft.jdbc.base.BaseConnection.prepareStatement(Unknown Source)
at org.apache.commons.dbcp.DelegatingConnection.prepareStatement(DelegatingConnection.java:187)
at com.application.sea.daoext.jdbcext.LignetauxDao_ImplExt.insert(LignetauxDao_ImplExt.java:116)
at com.application.sea.logic.fichepaye.FichepayeLogic.doUpdateFichepayeLignetauxList(FichepayeLogic.java:79)
at com.application.sea.webservice.server.fichepayelignetaux.FichepayeLignetaux.createOrModifyFichepayeLignetaux(FichepayeLignetaux.java:85)
at sun.reflect.GeneratedMethodAccessor195.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.java:402)
at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:309)
at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:333)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:71)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:150)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:120)
at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:481)
at org.apache.axis.server.AxisServer.invoke(AxisServer.java:323)
at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:854)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:339)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2416)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:601)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
at java.lang.Thread.run(Thread.java:536)
Systems that support commercial web sites or intranets must be flexible enough to anticipate and adapt to changes in the product offered.

Blog Archive