Article:
  Wiring Your Web Application with Open Source Java
Subject:   great article-some comments on the code
Date:   2004-04-12 17:16:52
From:   vijay172
Great article.


I had to make a few changes to get it to run on tomcat 5 :
1. changed web.xml to have a / in front of /WEB-INF/struts-config.xml.


2. created a WEB-INF/lib and added the required libs.
3. added to $tomcat-home$/common/lib the jstl jars - standard.jar and jstl.jsr
4. used spring-framework-1.0-with-dependencies.zip in the lib directory.


Finally got it to work.


Thanks for the pointers to using Spring.I have been using concrete factories to do the same and was planning on doing the same for an existing EJB framework until I came across your example.Will have to see how it goes when I try to integrate Spring with a JBoss EJB framework.

Main Topics Oldest First

Showing messages 1 through 1 of 1.

  • great article-some comments on the code
    2004-07-11 21:39:20  bikachu [View]

    hi,vijay172
    Why I can not still run the sample with the article.The printed information in the console maybe seems to tell me the struts action did not be registed when the web server is starting.
    Could you help me in detail.

    The following the information printed in console.
    2003-7-12 12:27:26 org.apache.coyote.http11.Http11Protocol init
    M‘§: Initializing Coyote HTTP/1.1 on port 8085
    2003-7-12 12:27:26 org.apache.catalina.startup.Catalina load
    M‘§: Initialization processed in 1907 ms
    2003-7-12 12:27:27 org.apache.catalina.core.StandardService start
    M‘§: Starting service Catalina
    2003-7-12 12:27:27 org.apache.catalina.core.StandardEngine start
    M‘§: Starting Servlet Engine: Apache Tomcat/5.0.16
    2003-7-12 12:27:27 org.apache.catalina.core.StandardHost start
    M‘§: XML validation disabled
    2003-7-12 12:27:27 org.apache.catalina.core.StandardHost getDeployer
    M‘§: Create Host deployer for direct deployment ( non-jmx )
    2003-7-12 12:27:27 org.apache.catalina.core.StandardHostDeployer install
    M‘§: Processing Context configuration file URL file:D:\Apache Group\jakarta-tomcat-5.0.16\conf\Catalina\localhost\admin.xml
    2003-7-12 12:27:28 org.apache.struts.util.PropertyMessageResources <init>
    M‘§: Initializing, config='org.apache.struts.util.LocalStrings', returnNull=true
    2003-7-12 12:27:28 org.apache.struts.util.PropertyMessageResources <init>
    M‘§: Initializing, config='org.apache.struts.action.ActionResources', returnNull=true
    2003-7-12 12:27:28 org.apache.struts.util.PropertyMessageResources <init>
    M‘§: Initializing, config='org.apache.webapp.admin.ApplicationResources', returnNull=true
    2003-7-12 12:27:30 org.apache.catalina.core.StandardHostDeployer install
    M‘§: Processing Context configuration file URL file:D:\Apache Group\jakarta-tomcat-5.0.16\conf\Catalina\localhost\balancer.xml
    2003-7-12 12:27:30 org.apache.catalina.core.StandardHostDeployer install
    M‘§: Processing Context configuration file URL file:D:\Apache Group\jakarta-tomcat-5.0.16\conf\Catalina\localhost\manager.xml
    2003-7-12 12:27:36 org.apache.catalina.core.StandardHostDeployer install
    M‘§: Installing web application at context path /wiring from URL file:D:/Apache Group/jakarta-tomcat-5.0.16/webapps/wiring
    2003-07-12 12:27:37,906 INFO factory.xml.XmlBeanDefinitionReader:118 -> Loading XML bean definitions from resource [/WEB-INF/applicationContext-hibernate.xml] of ServletContext
    2003-07-12 12:27:38,046 INFO context.support.XmlWebApplicationContext:68 -> Bean factory for application context [Root XmlWebApplicationContext]: org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [mySessionFactory,myTransactionManager,orderService,orderTarget,orderDAO]; Root of BeanFactory hierarchy
    2003-07-12 12:27:38,140 INFO context.support.XmlWebApplicationContext:249 -> 5 beans defined in ApplicationContext [Root XmlWebApplicationContext]
    2003-07-12 12:27:38,156 INFO context.support.XmlWebApplicationContext:337 -> No MessageSource found for context [Root XmlWebApplicationContext]: using empty StaticMessageSource
    2003-07-12 12:27:38,156 INFO context.support.UiApplicationContextUtils:67 -> No ThemeSource found for [Root XmlWebApplicationContext]: using ResourceBundleThemeSource
    2003-07-12 12:27:38,187 INFO context.support.XmlWebApplicationContext:358 -> Refreshing listeners
    2003-07-12 12:27:38,187 INFO factory.support.DefaultListableBeanFactory:168 -> Pre-instantiating singletons in factory [org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [mySessionFactory,myTransactionManager,orderService,orderTarget,orderDAO]; Root of BeanFactory hierarchy]
    2003-07-12 12:27:38,187 INFO factory.support.DefaultListableBeanFactory:158 -> Creating shared instance of singleton bean 'mySessionFactory'
    2003-07-12 12:27:38,281 INFO hibernate.cfg.Environment:432 -> Hibernate 2.1.1
    2003-07-12 12:27:38,281 INFO hibernate.cfg.Environment:466 -> loaded properties from resource hibernate.properties: {hibernate.connection.driver_class=com.mysql.jdbc.Driver, hibernate.cglib.use_reflection_optimizer=false, hibernate.dialect=net.sf.hibernate.dialect.MySQLDialect, hibernate.connection.username=spring, hibernate.connection.url=jdbc:mysql://localhost/spring, hibernate.show_sql=true, hibernate.connection.password=spring, hibernate.statement_cache.size=25, hibernate.connection.pool_size=10}
    2003-07-12 12:27:38,515 INFO hibernate.cfg.Binder:225 -> Mapping class: com.meagle.bo.Order -> Orders
    2003-07-12 12:27:38,687 INFO hibernate.cfg.Binder:225 -> Mapping class: com.meagle.bo.OrderLineItem -> OrderLineItem
    2003-07-12 12:27:38,687 INFO orm.hibernate.LocalSessionFactoryBean:372 -> Building new Hibernate SessionFactory
    2003-07-12 12:27:38,687 INFO hibernate.cfg.Configuration:584 -> processing one-to-many association mappings
    2003-07-12 12:27:38,687 INFO hibernate.cfg.Binder:1139 -> Mapping collection: com.meagle.bo.Order.orderLineItems -> OrderLineItem
    2003-07-12 12:27:38,687 INFO hibernate.cfg.Configuration:593 -> processing one-to-one association property references
    2003-07-12 12:27:38,687 INFO hibernate.cfg.Configuration:618 -> processing foreign key constraints
    2003-07-12 12:27:38,734 INFO hibernate.dialect.Dialect:82 -> Using dialect: net.sf.hibernate.dialect.MySQLDialect
    2003-07-12 12:27:38,734 INFO hibernate.cfg.SettingsFactory:62 -> Use outer join fetching: true
    2003-07-12 12:27:38,750 INFO hibernate.connection.ProxoolConnectionProvider:85 -> Configuring Proxool Provider using JAXPConfigurator: D:/eclipse/workspace/spring/wiring/WEB-INF/proxool.xml
    2003-07-12 12:27:38,812 INFO logicalcobwebs.proxool.ProxoolFacade:77 -> Proxool 0.8.3 (14-Dec-2003 16:06)
    2003-07-12 12:27:38,921 INFO hibernate.connection.ProxoolConnectionProvider:105 -> Configuring Proxool Provider to use pool alias: proxool.spring
    2003-07-12 12:27:38,937 INFO hibernate.transaction.TransactionManagerLookupFactory:33 -> No TransactionManagerLookup configured (in JTA environment, use of process level read-write cache is not recommended)
    2003-07-12 12:27:40,093 INFO hibernate.cfg.SettingsFactory:89 -> Use scrollable result sets: true
    2003-07-12 12:27:40,093 INFO hibernate.cfg.SettingsFactory:90 -> JDBC 2 max batch size: 15
    2003-07-12 12:27:40,093 INFO hibernate.cfg.SettingsFactory:96 -> echoing all SQL to stdout
    2003-07-12 12:27:40,109 INFO hibernate.cfg.SettingsFactory:99 -> Query language substitutions: {}
    2003-07-12 12:27:40,109 INFO hibernate.cfg.SettingsFactory:110 -> cache provider: net.sf.ehcache.hibernate.Provider
    2003-07-12 12:27:40,109 INFO hibernate.cfg.Configuration:1057 -> instantiating and configuring caches
    2003-07-12 12:27:40,265 INFO hibernate.impl.SessionFactoryImpl:119 -> building session factory
    2003-07-12 12:27:40,750 INFO hibernate.impl.SessionFactoryObjectFactory:82 -> no JNDI name configured
    2003-07-12 12:27:40,750 INFO factory.support.DefaultListableBeanFactory:158 -> Creating shared instance of singleton bean 'myTransactionManager'
    2003-07-12 12:27:40,781 INFO factory.support.DefaultListableBeanFactory:158 -> Creating shared instance of singleton bean 'orderService'
    2003-07-12 12:27:40,812 INFO factory.support.DefaultListableBeanFactory:158 -> Creating shared instance of singleton bean 'orderTarget'
    2003-07-12 12:27:40,828 INFO factory.support.DefaultListableBeanFactory:158 -> Creating shared instance of singleton bean 'orderDAO'
    2003-07-12 12:27:40,937 INFO web.context.ContextLoader:98 -> Using context class [org.springframework.web.context.support.XmlWebApplicationContext] for root WebApplicationContext
    2003-07-12 12:27:40,937 INFO web.context.ContextLoader:101 -> Published root WebApplicationContext [org.springframework.web.context.support.XmlWebApplicationContext: displayName=[Root XmlWebApplicationContext]; startup date=[Sat Jul 12 12:27:37 CST 2003]; root of ApplicationContext hierarchy; config locations=[/WEB-INF/applicationContext-hibernate.xml]; ] as ServletContext attribute with name [interface org.springframework.web.context.WebApplicationContext.ROOT]
    2003-7-12 12:27:41 org.apache.coyote.http11.Http11Protocol start
    M‘§: Starting Coyote HTTP/1.1 on port 8085
    2003-7-12 12:27:41 org.apache.jk.common.ChannelSocket init
    M‘§: JK2: ajp13 listening on /0.0.0.0:8099
    2003-7-12 12:27:41 org.apache.jk.server.JkMain start
    M‘§: Jk running ID=0 time=16/187 config=D:\Apache Group\jakarta-tomcat-5.0.16\conf\jk2.properties
    2003-7-12 12:27:41 org.apache.catalina.startup.Catalina start
    M‘§: Server startup in 14453 ms
    2003-07-12 12:28:03,890 INFO proxool.stats.spring:66 -> 12:27:38 - 12:28:00, s:1:0.05/s, r:0:0.00/s, a:343.00ms/0.02
    2003-07-12 12:28:12,453 INFO struts.util.PropertyMessageResources:127 -> Initializing, config='org.apache.struts.util.LocalStrings', returnNull=true
    2003-07-12 12:28:12,453 INFO struts.util.PropertyMessageResources:127 -> Initializing, config='org.apache.struts.taglib.html.LocalStrings', returnNull=true
    2003-07-12 12:28:12,453 INFO struts.util.PropertyMessageResources:127 -> Initializing, config='org.apache.struts.taglib.html.LocalStrings', returnNull=true
    2003-07-12 12:28:12,453 INFO struts.util.PropertyMessageResources:127 -> Initializing, config='org.apache.struts.util.LocalStrings', returnNull=true
    2003-07-12 12:29:03,921 INFO proxool.stats.spring:66 -> 12:28:00 - 12:29:00, s:0:0.00/s, r:0:0.00/s, a:0.00ms/0.00
    2003-07-12 12:30:03,937 INFO proxool.stats.spring:66 -> 12:29:00 - 12:30:00, s:0:0.00/s, r:0:0.00/s, a:0.00ms/0.00
    2003-07-12 12:30:03,937 INFO proxool.stats.spring:66 -> 12:27:38 - 12:30:00, s:1:0.01/s, r:0:0.00/s, a:343.00ms/0.00
    2003-07-12 12:31:03,937 INFO proxool.stats.spring:66 -> 12:30:00 - 12:31:00, s:0:0.00/s, r:0:0.00/s, a:0.00ms/0.00
    2003-07-12 12:32:03,937 INFO proxool.stats.spring:66 -> 12:31:00 - 12:32:00, s:0:0.00/s, r:0:0.00/s, a:0.00ms/0.00

    Thanks very much , I do like the article.