Friday, June 13, 2014

[SOLVED] Exception while configuring tiles in Struts 1

Got the following exception while configuring tiles with Struts 1.3.10.

INFO: Loading chain catalog from jar:file:/C:/work/eclipseworkspace/pas/1/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/pas/WEB-INF/lib/struts-tiles-1.3.10.jar!/org/apache/struts/tiles/chain-config.xmlJun 13, 2014 10:55:12 PM org.apache.commons.digester.Digester errorSEVERE: Parse Error at line 8 column 77: Document root element "definition", must match DOCTYPE root "tiles-definitions".org.xml.sax.SAXParseException; lineNumber: 8; columnNumber: 77; Document root element "definition", must match DOCTYPE root "tiles-definitions". at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198) at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:134) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:437) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:368) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:325) at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.rootElementSpecified(XMLDTDValidator.java:1599) at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.handleStartElement(XMLDTDValidator.java:1877) at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.startElement(XMLDTDValidator.java:742) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:376) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDriver.scanRootElementHook(XMLNSDocumentScannerImpl.java:602) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3065) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:881) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:607) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:116) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:489) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:835) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:123) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1210) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:568) at org.apache.commons.digester.Digester.parse(Digester.java:1765) at org.apache.struts.tiles.xmlDefinition.XmlParser.parse(XmlParser.java:281) at org.apache.struts.tiles.xmlDefinition.I18nFactorySet.parseXmlFile(I18nFactorySet.java:514) at org.apache.struts.tiles.xmlDefinition.I18nFactorySet.parseXmlFiles(I18nFactorySet.java:449) at org.apache.struts.tiles.xmlDefinition.I18nFactorySet.createDefaultFactory(I18nFactorySet.java:266) at org.apache.struts.tiles.xmlDefinition.I18nFactorySet.initFactory(I18nFactorySet.java:241) at org.apache.struts.tiles.xmlDefinition.I18nFactorySet.initFactory(I18nFactorySet.java:191) at org.apache.struts.tiles.definition.ComponentDefinitionsFactoryWrapper.init(ComponentDefinitionsFactoryWrapper.java:105) at org.apache.struts.tiles.TilesUtilImpl.createDefinitionsFactory(TilesUtilImpl.java:181) at org.apache.struts.tiles.TilesUtil.createDefinitionsFactory(TilesUtil.java:182) at org.apache.struts.tiles.TilesPlugin.initDefinitionsFactory(TilesPlugin.java:226) at org.apache.struts.tiles.TilesPlugin.init(TilesPlugin.java:141) at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:871) at org.apache.struts.action.ActionServlet.init(ActionServlet.java:359) at javax.servlet.GenericServlet.init(GenericServlet.java:160) at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1280) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1193) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1088) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5198) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5481) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:722)


The problem was : I did not enclose my 'definition' tag in my tiles-defs.xml with the , since i referred Struts Examples page (I'd call it a poor documentation, poor availability too, some pages are missing at this point of time).

Find below the correct tiles-defs.xml :

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE tiles-definitions PUBLIC
"-//Apache Software Foundation//DTD Tiles Configuration 1.3//EN"
"http://struts.apache.org/dtds/tiles-config_1_3.dtd">
<tiles-definitions> <!-- THIS TAG WAS MISSING -->
<definition name="default-template" path="/common/tiles/default-layout.jsp">
  <put name="header"  value="/common/Header.jsp" type="string" />
  <put name="menu" value="/common/Menu.jsp" type="page" />
  <!-- put name="body"   value="/index.jsp" type="page"  -->
</definition>
</tiles-definitions>
 




Tuesday, May 21, 2013

Error running javac.exe compiler - ant compilation error


I am using windows 7 and had installed java under C:\Program Files (x86)

May be the space or the special chars in the path should have created problem with ant

Just copied the java folder from C:\Program Files (x86)\ to D: and set my JAVA_HOME to D:\java\jdk1.6.0_11 and added the path D:\java\jdk1.6.0_11\bin to my system path. Ant compiled my code!

Sunday, February 10, 2013

Devices list not appearing on itunes on your computer

Just plug out your usb connector interface and plug-in again

Monday, January 21, 2013

Saturday, September 15, 2012

Firebird query to list out rows having duplicate values in columns


SELECT * FROM "TABLE1" t1 WHERE EXISTS (SELECT 1 FROM " TABLE1" t2 WHERE t1."COLUMN1" = t2."COLUMN1" AND t1.RDB$DB_KEY < t2.RDB$DB_KEY);

This query will list out only the rows from TABLE1 which have duplicate values in COLUMN1.


Saturday, August 4, 2012

I moved my netbeans settings and projects to my new computer

1. Install netbeans and close netbeans if open. Before proceeding with any of the steps below, make sure you take zip/backup the necessary files/folders in the folders which you copy to.

2. Moving netbeans settings:
You will find the folder having netbeans settings within your windows user profile. I use windows 7. So I found this here : C:\Users\my-windows-user-name\.netbeans. To move your settings, just move the folder (under C:\Users\my-windows-user-name\.netbeans) with the name having your netbeans version (I use netbeans version 6.9 so the folder name was 69 without the dot in between).

3. Moving netbeans projects:
To know where netbeans creates project settings in your computer, just try creating a sample project. While creating your new sample project, the second step 'Name and Location' will show the default Project Folder. This is where you will have all your project settings, just move the folder to the new computer to the same directory.

For example the 'Name and Location' shows your project folder as C:\Users\ my-windows-user-name\MyDocuments\NetBeansProjects\JavaProject7, your projects will be found in just one folder under, that is here : C:\Users\ my-windows-user-name\MyDocuments\NetBeansProjects\

5. Move your source files to the same directories you had in your old computer.

4. Start netbeans to find your old settings in your new netbeans installation.

Hope this helps.

Tuesday, September 27, 2011

firebird.msg not found



D:\firebird\bin>isql -u sysdba -p masterkey D:\firebird\OpUtilsDB.fdb
can't format message 17:0 -- message file D:\firebird\firebird.msg not found
unavailable database
can't format message 17:3 -- message file D:\firebird\firebird.msg not found
SQL> exit;
To solve this problem,
  1. Stop if you have any firebird instances running
  2. Change the value of the var 'CreateInternalWindow' as 1 in firebird/firebird.conf
  3. Start firebird (run fbserver -a from firebird/bin)
  4. Then run the isql command