Hi,

I've nearly finish the tutorial Struts2+Spring2+Ajax and I'm blocked with
the following error in the index.jsp when I launch the application inside
Eclipse.

Any idea ?

Thanks in advance

Philippe

22 janv. 2007 20:23:31 org.apache.catalina.core.AprLifecycleListener
lifecycleEvent
INFO: The Apache Tomcat Native library which allows optimal performance in
production environments was not found on the java.library.path:
/usr/lib/jvm/java-1.5.0-sun-1.5.0_10/jre/lib/i386/client:/usr/lib/jvm/java-1.5.0-sun-1.5.0_10/jre/lib/i386:/usr/lib/jvm/java-1.5.0-sun-1.5.0_10/jre/../lib/i386:/usr/X11R6/lib:/usr/lib/xulrunner-1.8.0.6
22 janv. 2007 20:23:31 org.apache.coyote.http11.Http11BaseProtocol init
INFO: Initialisation de Coyote HTTP/1.1 sur http-8080
22 janv. 2007 20:23:31 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 609 ms
22 janv. 2007 20:23:32 org.apache.catalina.core.StandardService start
INFO: Démarrage du service Catalina
22 janv. 2007 20:23:32 org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.5.20
22 janv. 2007 20:23:32 org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
22 janv. 2007 20:23:32 org.springframework.web.context.ContextLoader
initWebApplicationContext
INFO: Root WebApplicationContext: initialization started
22 janv. 2007 20:23:32 org.apache.catalina.core.ApplicationContext log
INFO: Loading Spring root WebApplicationContext
22 janv. 2007 20:23:32 org.springframework.core.CollectionFactory <clinit>
INFO: JDK 1.4+ collections available
22 janv. 2007 20:23:32 org.springframework.core.CollectionFactory <clinit>
INFO: Commons Collections 3.x available
22 janv. 2007 20:23:32
org.springframework.beans.factory.xml.XmlBeanDefinitionReader
loadBeanDefinitions
INFO: Loading XML bean definitions from ServletContext resource
[/WEB-INF/applicationContext.xml]
22 janv. 2007 20:23:32
org.springframework.context.support.AbstractRefreshableApplicationContext
refreshBeanFactory
INFO: Bean factory for application context [Root WebApplicationContext]:
org.springframework.beans.factory.support.DefaultListableBeanFactory
defining beans
[org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor,personService,entityManagerFactory,dataSource,transactionManager,org.springframework.aop.config.internalAutoProxyCreator,org.springframework.transaction.interceptor.TransactionAttributeSourceAdvisor,personAction];
root of BeanFactory hierarchy
22 janv. 2007 20:23:33
org.springframework.context.support.AbstractApplicationContext refresh
INFO: 8 beans defined in application context [Root WebApplicationContext]
22 janv. 2007 20:23:33
org.springframework.context.support.AbstractApplicationContext$BeanPostProcessorChecker
postProcessAfterInitialization
INFO: Bean
'org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor'
is not eligible for getting processed by all BeanPostProcessors (for
example: not eligible for auto-proxying)
22 janv. 2007 20:23:33
org.springframework.aop.framework.DefaultAopProxyFactory <clinit>
INFO: CGLIB2 available: proxyTargetClass feature enabled
22 janv. 2007 20:23:33
org.springframework.context.support.AbstractApplicationContext$BeanPostProcessorChecker
postProcessAfterInitialization
INFO: Bean 'org.springframework.aop.config.internalAutoProxyCreator' is
not eligible for getting processed by all BeanPostProcessors (for example:
not eligible for auto-proxying)
22 janv. 2007 20:23:33
org.springframework.context.support.AbstractApplicationContext
initMessageSource
INFO: Unable to locate MessageSource with name 'messageSource': using
default
[EMAIL PROTECTED]
22 janv. 2007 20:23:33
org.springframework.context.support.AbstractApplicationContext
initApplicationEventMulticaster
INFO: Unable to locate ApplicationEventMulticaster with name
'applicationEventMulticaster': using default
[EMAIL PROTECTED]
22 janv. 2007 20:23:33
org.springframework.ui.context.support.UiApplicationContextUtils
initThemeSource
INFO: Unable to locate ThemeSource with name 'themeSource': using default
[EMAIL PROTECTED]
22 janv. 2007 20:23:33
org.springframework.beans.factory.support.DefaultListableBeanFactory
preInstantiateSingletons
INFO: Pre-instantiating singletons in factory
[org.springframework.beans.factory.support.DefaultListableBeanFactory
defining beans
[org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor,personService,entityManagerFactory,dataSource,transactionManager,org.springframework.aop.config.internalAutoProxyCreator,org.springframework.transaction.interceptor.TransactionAttributeSourceAdvisor,personAction];
root of BeanFactory hierarchy]
22 janv. 2007 20:23:33
org.springframework.jdbc.datasource.DriverManagerDataSource
setDriverClassName
INFO: Loaded JDBC driver: com.mysql.jdbc.Driver
22 janv. 2007 20:23:33 org.hibernate.ejb.Version <clinit>
INFO: Hibernate EntityManager 3.2.1.GA
22 janv. 2007 20:23:33 org.hibernate.cfg.annotations.Version <clinit>
INFO: Hibernate Annotations 3.2.1.GA
22 janv. 2007 20:23:33 org.hibernate.cfg.Environment <clinit>
INFO: Hibernate 3.2.1
22 janv. 2007 20:23:33 org.hibernate.cfg.Environment <clinit>
INFO: hibernate.properties not found
22 janv. 2007 20:23:33 org.hibernate.cfg.Environment buildBytecodeProvider
INFO: Bytecode provider name : cglib
22 janv. 2007 20:23:33 org.hibernate.cfg.Environment <clinit>
INFO: using JDK 1.4 java.sql.Timestamp handling
22 janv. 2007 20:23:33 org.hibernate.ejb.Ejb3Configuration configure
INFO: Processing PersistenceUnitInfo [
        name: punit
        ...]
22 janv. 2007 20:23:33 org.hibernate.ejb.Ejb3Configuration scanForClasses
INFO: found EJB3 Entity bean: quickstart.model.Person
22 janv. 2007 20:23:33 org.hibernate.cfg.Configuration addResource
INFO: Reading mappings from resource : META-INF/orm.xml
22 janv. 2007 20:23:33 org.hibernate.ejb.Ejb3Configuration
addClassesToSessionFactory
INFO: [PersistenceUnit: punit] no META-INF/orm.xml found
22 janv. 2007 20:23:33 org.hibernate.cfg.AnnotationBinder bindClass
INFO: Binding entity from annotated class: quickstart.model.Person
22 janv. 2007 20:23:33 org.hibernate.cfg.annotations.EntityBinder bindTable
INFO: Bind entity quickstart.model.Person on table Person
22 janv. 2007 20:23:33 org.hibernate.connection.ConnectionProviderFactory
newConnectionProvider
INFO: Initializing connection provider:
org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider
22 janv. 2007 20:23:33
org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider
configure
INFO: Using provided datasource
22 janv. 2007 20:23:34 org.hibernate.cfg.SettingsFactory buildSettings
INFO: RDBMS: MySQL, version: 5.0.18
22 janv. 2007 20:23:34 org.hibernate.cfg.SettingsFactory buildSettings
INFO: JDBC driver: MySQL-AB JDBC Driver, version:
mysql-connector-java-5.0.4 ( $Date: 2006-10-19 17:47:48 +0200 (Thu, 19 Oct
2006) $, $Revision: 5908 $ )
22 janv. 2007 20:23:34 org.hibernate.dialect.Dialect <init>
INFO: Using dialect: org.hibernate.dialect.MySQLDialect
22 janv. 2007 20:23:34 org.hibernate.transaction.TransactionFactoryFactory
buildTransactionFactory
INFO: Transaction strategy: org.hibernate.transaction.JDBCTransactionFactory
22 janv. 2007 20:23:34
org.hibernate.transaction.TransactionManagerLookupFactory
getTransactionManagerLookup
INFO: No TransactionManagerLookup configured (in JTA environment, use of
read-write or transactional second-level cache is not recommended)
22 janv. 2007 20:23:34 org.hibernate.cfg.SettingsFactory buildSettings
INFO: Automatic flush during beforeCompletion(): disabled
22 janv. 2007 20:23:34 org.hibernate.cfg.SettingsFactory buildSettings
INFO: Automatic session close at end of transaction: disabled
22 janv. 2007 20:23:34 org.hibernate.cfg.SettingsFactory buildSettings
INFO: JDBC batch size: 15
22 janv. 2007 20:23:34 org.hibernate.cfg.SettingsFactory buildSettings
INFO: JDBC batch updates for versioned data: disabled
22 janv. 2007 20:23:34 org.hibernate.cfg.SettingsFactory buildSettings
INFO: Scrollable result sets: enabled
22 janv. 2007 20:23:34 org.hibernate.cfg.SettingsFactory buildSettings
INFO: JDBC3 getGeneratedKeys(): enabled
22 janv. 2007 20:23:34 org.hibernate.cfg.SettingsFactory buildSettings
INFO: Connection release mode: auto
22 janv. 2007 20:23:34 org.hibernate.cfg.SettingsFactory buildSettings
INFO: Maximum outer join fetch depth: 2
22 janv. 2007 20:23:34 org.hibernate.cfg.SettingsFactory buildSettings
INFO: Default batch fetch size: 1
22 janv. 2007 20:23:34 org.hibernate.cfg.SettingsFactory buildSettings
INFO: Generate SQL with comments: disabled
22 janv. 2007 20:23:34 org.hibernate.cfg.SettingsFactory buildSettings
INFO: Order SQL updates by primary key: disabled
22 janv. 2007 20:23:34 org.hibernate.cfg.SettingsFactory
createQueryTranslatorFactory
INFO: Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
22 janv. 2007 20:23:34 org.hibernate.hql.ast.ASTQueryTranslatorFactory <init>
INFO: Using ASTQueryTranslatorFactory
22 janv. 2007 20:23:34 org.hibernate.cfg.SettingsFactory buildSettings
INFO: Query language substitutions: {}
22 janv. 2007 20:23:34 org.hibernate.cfg.SettingsFactory buildSettings
INFO: JPA-QL strict compliance: enabled
22 janv. 2007 20:23:34 org.hibernate.cfg.SettingsFactory buildSettings
INFO: Second-level cache: enabled
22 janv. 2007 20:23:34 org.hibernate.cfg.SettingsFactory buildSettings
INFO: Query cache: disabled
22 janv. 2007 20:23:34 org.hibernate.cfg.SettingsFactory createCacheProvider
INFO: Cache provider: org.hibernate.cache.NoCacheProvider
22 janv. 2007 20:23:34 org.hibernate.cfg.SettingsFactory buildSettings
INFO: Optimize cache for minimal puts: disabled
22 janv. 2007 20:23:34 org.hibernate.cfg.SettingsFactory buildSettings
INFO: Structured second-level cache entries: disabled
22 janv. 2007 20:23:34 org.hibernate.cfg.SettingsFactory buildSettings
INFO: Echoing all SQL to stdout
22 janv. 2007 20:23:34 org.hibernate.cfg.SettingsFactory buildSettings
INFO: Statistics: disabled
22 janv. 2007 20:23:34 org.hibernate.cfg.SettingsFactory buildSettings
INFO: Deleted entity synthetic identifier rollback: disabled
22 janv. 2007 20:23:34 org.hibernate.cfg.SettingsFactory buildSettings
INFO: Default entity-mode: pojo
22 janv. 2007 20:23:34 org.hibernate.impl.SessionFactoryImpl <init>
INFO: building session factory
22 janv. 2007 20:23:34 org.hibernate.impl.SessionFactoryObjectFactory
addInstance
INFO: Not binding factory to JNDI, no JNDI name configured
22 janv. 2007 20:23:34 org.springframework.web.context.ContextLoader
initWebApplicationContext
INFO: Using context class
[org.springframework.web.context.support.XmlWebApplicationContext] for
root WebApplicationContext
22 janv. 2007 20:23:34 org.springframework.web.context.ContextLoader
initWebApplicationContext
INFO: Root WebApplicationContext: initialization completed in 1987 ms
22 janv. 2007 20:23:34 org.apache.struts2.spring.StrutsSpringObjectFactory
init
INFO: Initializing Struts-Spring integration...
22 janv. 2007 20:23:34 com.opensymphony.xwork2.spring.SpringObjectFactory
setAutowireStrategy
INFO: Setting autowire strategy to name
22 janv. 2007 20:23:34 org.apache.struts2.spring.StrutsSpringObjectFactory
init
INFO: ... initialized Struts-Spring integration successfully
22 janv. 2007 20:23:34 org.apache.coyote.http11.Http11BaseProtocol start
INFO: Démarrage de Coyote HTTP/1.1 sur http-8080
22 janv. 2007 20:23:35 org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
22 janv. 2007 20:23:35 org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/124  config=null
22 janv. 2007 20:23:35 org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath resource
22 janv. 2007 20:23:35 org.apache.catalina.startup.Catalina start
INFO: Server startup in 3348 ms
22 janv. 2007 20:23:36 org.apache.catalina.core.StandardWrapperValve invoke
GRAVE: "Servlet.service()" pour la servlet jsp a généré une exception
org.apache.jasper.JasperException: /index.jsp(44,4) L'attribut targets est
incorrect pour le tag submit d'après la TLD indiquée
        at
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
        at
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:405)
        at
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:234)
        at
org.apache.jasper.compiler.Validator$ValidateVisitor.checkXmlAttributes(Validator.java:989)
        at
org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:710)
        at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1441)
        at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
        at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
        at
org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:730)
        at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1441)
        at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
        at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
        at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2219)
        at org.apache.jasper.compiler.Node$Root.accept(Node.java:456)
        at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
        at org.apache.jasper.compiler.Validator.validate(Validator.java:1489)
        at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:166)
        at org.apache.jasper.compiler.Compiler.compile(Compiler.java:295)
        at org.apache.jasper.compiler.Compiler.compile(Compiler.java:276)
        at org.apache.jasper.compiler.Compiler.compile(Compiler.java:264)
        at
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563)
        at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:305)
        at 
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:248)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
        at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
        at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
        at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
        at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
        at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
        at
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
        at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
        at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
        at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
        at java.lang.Thread.run(Thread.java:595)

Le mardi 16 janvier 2007 13:15, Joe Germuska a écrit :
> This example is for Struts 1.x, not Struts 2.
>
> Struts 2 provides no direct support for managing database connections,
> although one could achieve something like this rather readily using Spring,
> or probably with any other ObjectFactory.
>
> Here's a tutorial which gets much more involved than your basic request,
> but which might help.  Note that since the tutorial uses Hibernate, it
> isn't exactly what you asked for, but it also demonstrates using Spring to
> instantiate a Datasource, and then you could have Spring also instantiate
> your Action Classes and "inject" the datasource dependency into them.
>
> http://cwiki.apache.org/S2WIKI/struts-2-spring-2-jpa-ajax.html
>
> Let me issue the standard disclaimer that if you are doing a lot of
> database work in your Action classes, you may want to consider refactoring
> anyway.
>
> Joe
>
> On 1/16/07, Philippe Le Gal <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > Thanks again.
> > Is it possible that you give me the complete listing of this example
> > because,
> > I've problem to find how to initialize the 'context' object.
> >
> > Thanks
> >
> > Philippe
> >
> > Le mardi 16 janvier 2007 11:14, Stanislav a écrit:
> > > in java action class you can also connect through struts db mechanisam:
> > > DataSource dataSource = (DataSource)
> > > context.getAttribute("org.apache.struts.action.DATA_SOURCE"); conn =
> > > dataSource.getConnection();
> > > or direct to db
> > > Connection conn =
> > > DriverManager.getConnection
> >
> > (ConnectionURL,ConnectionUserName,ConnectionPass
> >
> > >word);
> > >
> > >
> > >
> > > From: Philippe Le Gal <[EMAIL PROTECTED]>
> > > To: "Struts Users Mailing List" <user@struts.apache.org>
> > > Subject: Re: [Struts 2] Database access
> > > Date: Tue, 16 Jan 2007 11:08:28 +0100
> > >
> > > ----- Original Message Follows -----
> > >
> > > > Hi,
> > > >
> > > > Thanks for the information.
> > > > I'm also looking for the mecanism of accessing the database in the
> >
> > java
> >
> > > > action class.
> > > >
> > > > Thanks
> > > >
> > > > Philippe
> > > >
> > > > Le mardi 16 janvier 2007 10:59, Stanislav a écrit :
> > > > > in struts-config for sql database.
> > > > >
> > > > > <data-sources>
> > > > >       <data-source type="org.apache.commons.dbcp.BasicDataSource">
> > > > >          <set-property property="driverClassName"
> > > > > value="com.microsoft.jdbc.sqlserver.SQLServerDriver" />
> > > > >          <set-property property="url"
> >
> > value="jdbc:microsoft:sqlserver://xxx.xxx.xxx.xxx:1433;DatabaseName=xxx
> >
> > > > >xx;S electMethod=Cursor" /> <set-property property="username"
> > > > > value="xxxxx" /> <set-property property="password" value="xxxxx" />
> > > > >          <set-property property="maxActive" value="0" />
> > > > >          <set-property property="maxWait" value="5000" />
> > > > >          <set-property property="defaultAutoCommit" value="false"
> > > > > /> <set-property property="defaultReadOnly" value="false" />
> > > > > </data-source>
> > > > > </data-sources>
> > > > >
> > > > >
> > > > > From: Philippe Le Gal <[EMAIL PROTECTED]>
> > > > > To: user@struts.apache.org
> > > > > Subject: [Struts 2] Database access
> > > > > Date: Tue, 16 Jan 2007 10:53:12 +0100
> > > > >
> > > > > ----- Original Message Follows -----
> > > > >
> > > > > > Hi,
> > > > > >
> > > > > > I'm looking for a simple struts 2 database access example.
> > > > > >
> > > > > > Thanks for any url
> > > > > >
> > > > > > Philippe
> >
> > ---------------------------------------------------------------------
> >
> > > > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > > > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> > ---------------------------------------------------------------------
> >
> > > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to