You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Jacob Bergoo <ja...@gmail.com> on 2008/01/29 19:31:00 UTC

Need help with pom.xml for my tapestry 5 project

Hi All, 
I am new to Maven 2 but I am learning as fast as I can. My plan is to set up
a project that is working with Spring 2.5.1, Tapestry 5, Hibernate 3.2.5.ga,
MySQL 5.0. 
This is what I have done so far: 
1) I have Created a project using Quickstart Archtype for Tapestry 5 
2) I have added Spring dep. to my pom.xml 
3) I have added MySQL connector to my 
http://www.nabble.com/file/p15166088/pom.xml pom.xml 

When I try to run the application Jetty I got an error for missing
commons-dbcp. I have tried to find this jar in the maven repositories in
http://repo1.maven.org/maven2/org/apache/commons/ and in
http://repo1.maven.org/maven2/org/apache/commons/ and there is no sign of it
there. I want to do this "the maven way", but so far it seems a lot easier
to just drop in the jar file in the lib folder...

Has anybody else set upp this combination or similar combination of
framework and are willing to share the pom.xml with the rest of us.

Thanks in advance for any help
Jacob


-- 
View this message in context: http://www.nabble.com/Need-help-with-pom.xml-for-my-tapestry-5-project-tp15166088p15166088.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Need help with pom.xml for my tapestry 5 project

Posted by Christian Köberl <ch...@porsche.co.at>.
Hi Sven!


Sven Homburg wrote:
> 
> short hint how to configure this ?
> 

If your library uses another library (e.g. t5components use tapestry-core)
and you support with your version X a range of versions Y1-Y5 of the other
library  then you can tell maven that with version ranges.

Here you can see how to specify them:
http://docs.codehaus.org/display/MAVEN/Dependency+Mediation+and+Conflict+Resolution#DependencyMediationandConflictResolution-DependencyVersionRanges

For example: if your version 0.5.4 supports Tapestry 5.0.6 - 5.0.9 (both
including) then you could have:
	<properties>
		<tapestry-version>[5.0.6, 5.0.9]</tapestry-version>
	</properties>
with:
	<dependency>
		<groupId>org.apache.tapestry</groupId>
		<artifactId>tapestry-core</artifactId>
		<version>${tapestry-version}</version>
	</dependency>

Usually, as a library depending on another lib you should have at least
something like this:
 ... <verision>[1.1,1.2)</version>
Which means we support 1.1 and all Bugfix releases (1.1.1, 1.1.2, ...). That
requires that the other library uses the versioning scheme correctly (major,
minor, bugfix). Bugfix releases should not change interface and semantics.
With Tapestry5 - this will need time until the first "real" release.

But now, I think we're gliding too deep into Mavenish (maybe we should
continue on the Maven mailing-list ;) )

-- 
Chris

-- 
View this message in context: http://www.nabble.com/Need-help-with-pom.xml-for-my-tapestry-5-project-tp15166088p15207367.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Need help with pom.xml for my tapestry 5 project

Posted by Sven Homburg <ho...@googlemail.com>.
short hint how to configure this ?

2008/1/31, Christian Köberl <ch...@porsche.co.at>:
>
>
> Hi Jacob!
>
> The Problem is that you:
> * include tapestry-core version 5.0.5
> * include t5components, which includes tapestry-ioc in 5.0.9
> * include tapestry-spring version 5.0.7
>
> You should always include compatible versions!
> One solution is to include the dependency to tapestry-ioc in 5.0.5 and set
> tapestry-spring to 5.0.5. But then t5components might not work. The better
> would be to change all versions to 5.0.9.
>
> You can easily see your versions with "mvn dependency:resolve".
>
> A even better way to include packages is to define a dependency-management
> section with the versions and use the projects in depencies without
> version
> (see refereced article and book in my last post).
>
> @ the guys from t5components: maybe you could remove the direct version
> dependency to tapestry and replace it with a range. And, more importantly:
> your compontents are great!!!
>
> Cheers,
> Chris
>
>
> --
> View this message in context:
> http://www.nabble.com/Need-help-with-pom.xml-for-my-tapestry-5-project-tp15166088p15203466.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
with regards
Sven Homburg

Re: Need help with pom.xml for my tapestry 5 project

Posted by Christian Köberl <ch...@porsche.co.at>.
Hi Jacob!

The Problem is that you:
* include tapestry-core version 5.0.5
* include t5components, which includes tapestry-ioc in 5.0.9
* include tapestry-spring version 5.0.7

You should always include compatible versions!
One solution is to include the dependency to tapestry-ioc in 5.0.5 and set
tapestry-spring to 5.0.5. But then t5components might not work. The better
would be to change all versions to 5.0.9.

You can easily see your versions with "mvn dependency:resolve".

A even better way to include packages is to define a dependency-management
section with the versions and use the projects in depencies without version
(see refereced article and book in my last post).

@ the guys from t5components: maybe you could remove the direct version
dependency to tapestry and replace it with a range. And, more importantly:
your compontents are great!!!

Cheers,
Chris


-- 
View this message in context: http://www.nabble.com/Need-help-with-pom.xml-for-my-tapestry-5-project-tp15166088p15203466.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Need help with pom.xml for my tapestry 5 project

Posted by Jacob Bergoo <ja...@gmail.com>.
Hi,
I have come a lot futher now with my try on setting up a environment using
Maven 2 and Tapestry 5, Spring 2.5.1, Hibernate 3.2.5.ga and MySql 5.0.8.
But now I have ended up with an exception that I dont understand. When I run
my jetty server I get this:

launching Jetty webapp: /webshop on address: 0.0.0.0:80 using dir:
[C:\DevArea\projects\webshop\src\main\webapp] 
18:31:19.467 INFO   [main] org.mortbay.log.LogImpl.add(LogImpl.java:109)
>16> added org.mortbay.log.OutputStreamLogSink@1b8e059
18:31:19.395 INFO   [main] org.mortbay.log.LogImpl.reset(LogImpl.java:228)
>11> reset
18:31:19.471 INFO   [main] org.mortbay.log.LogImpl.add(LogImpl.java:109)
>11> added org.mortbay.log.OutputStreamLogSink@1617189
18:31:20.662 INFO   [main]
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:189)
>09> Root WebApplicationContext: initialization started
18:31:20.854 INFO   [main]
org.springframework.context.support.AbstractApplicationContext.prepareRefresh(AbstractApplicationContext.java:400)
>12> Refreshing
org.springframework.web.context.support.XmlWebApplicationContext@1fc6e42:
display name [Root WebApplicationContext]; startup date [Tue Jan 29 18:31:20
COT 2008]; root of context hierarchy
18:31:21.031 INFO   [main]
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:308)
>20> Loading XML bean definitions from ServletContext resource
[/WEB-INF/applicationContext-Persistence.xml]
18:31:21.849 INFO   [main]
org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:415)
>12> Bean factory for application context
[org.springframework.web.context.support.XmlWebApplicationContext@1fc6e42]:
org.springframework.beans.factory.support.DefaultListableBeanFactory@1ce669e
18:31:22.058 INFO   [main]
org.springframework.core.io.support.PropertiesLoaderSupport.loadProperties(PropertiesLoaderSupport.java:174)
>16> Loading properties file from class path resource [jdbc.properties]
18:31:22.274 INFO   [main]
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:385)
>13> Pre-instantiating singletons in
org.springframework.beans.factory.support.DefaultListableBeanFactory@1ce669e:
defining beans
[org.springframework.beans.factory.config.PropertyPlaceholderConfigurer#0,dataSource,transactionManager,sessionFactory,hibernateTemplate,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.aop.config.internalAutoProxyCreator,org.springframework.transaction.config.internalTransactionAdvisor];
root of factory hierarchy
18:31:22.734 INFO   [main]
org.hibernate.cfg.Environment.<clinit>(Environment.java:514) >83> Hibernate
3.2.5
18:31:22.740 INFO   [main]
org.hibernate.cfg.Environment.<clinit>(Environment.java:547) >83>
hibernate.properties not found
18:31:22.767 INFO   [main]
org.hibernate.cfg.Environment.buildBytecodeProvider(Environment.java:681)
>84> Bytecode provider name : cglib
18:31:22.779 INFO   [main]
org.hibernate.cfg.Environment.<clinit>(Environment.java:598) >83> using JDK
1.4 java.sql.Timestamp handling
18:31:23.022 INFO   [main]
org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:731)
>72> Building new Hibernate SessionFactory
18:31:23.027 INFO   [main]
org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:72)
>79> Initializing connection provider:
org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider
18:31:24.671 INFO   [main]
org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:89)
>76> RDBMS: MySQL, version: 5.0.45-community-nt
18:31:24.672 INFO   [main]
org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:90)
>76> JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-5.0.8
( Revision: ${svn.Revision} )
18:31:24.753 INFO   [main]
org.hibernate.dialect.Dialect.<init>(Dialect.java:152) >87> Using dialect:
org.hibernate.dialect.MySQLDialect
18:31:24.916 INFO   [main]
org.hibernate.transaction.TransactionFactoryFactory.buildTransactionFactory(TransactionFactoryFactory.java:31)
>78> Using default transaction strategy (direct JDBC transactions)
18:31:24.921 INFO   [main]
org.hibernate.transaction.TransactionManagerLookupFactory.getTransactionManagerLookup(TransactionManagerLookupFactory.java:33)
>78> No TransactionManagerLookup configured (in JTA environment, use of
read-write or transactional second-level cache is not recommended)
18:31:24.922 INFO   [main]
org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:143)
>76> Automatic flush during beforeCompletion(): disabled
18:31:24.922 INFO   [main]
org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:147)
>76> Automatic session close at end of transaction: disabled
18:31:24.923 INFO   [main]
org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:154)
>76> JDBC batch size: 15
18:31:24.924 INFO   [main]
org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:157)
>76> JDBC batch updates for versioned data: disabled
18:31:24.926 INFO   [main]
org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:162)
>76> Scrollable result sets: enabled
18:31:24.927 INFO   [main]
org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:170)
>76> JDBC3 getGeneratedKeys(): enabled
18:31:24.927 INFO   [main]
org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:178)
>76> Connection release mode: on_close
18:31:24.927 INFO   [main]
org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:202)
>76> Maximum outer join fetch depth: 2
18:31:24.928 INFO   [main]
org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:205)
>76> Default batch fetch size: 1
18:31:24.928 INFO   [main]
org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:209)
>76> Generate SQL with comments: disabled
18:31:24.928 INFO   [main]
org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:213)
>76> Order SQL updates by primary key: disabled
18:31:24.929 INFO   [main]
org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:217)
>76> Order SQL inserts for batching: disabled
18:31:24.929 INFO   [main]
org.hibernate.cfg.SettingsFactory.createQueryTranslatorFactory(SettingsFactory.java:386)
>77> Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
18:31:24.956 INFO   [main]
org.hibernate.hql.ast.ASTQueryTranslatorFactory.<init>(ASTQueryTranslatorFactory.java:24)
>84> Using ASTQueryTranslatorFactory
18:31:24.957 INFO   [main]
org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:225)
>76> Query language substitutions: {}
18:31:24.957 INFO   [main]
org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:230)
>76> JPA-QL strict compliance: disabled
18:31:24.957 INFO   [main]
org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:235)
>76> Second-level cache: enabled
18:31:24.958 INFO   [main]
org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:239)
>76> Query cache: disabled
18:31:24.958 INFO   [main]
org.hibernate.cfg.SettingsFactory.createCacheProvider(SettingsFactory.java:373)
>77> Cache provider: org.hibernate.cache.NoCacheProvider
18:31:24.958 INFO   [main]
org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:254)
>76> Optimize cache for minimal puts: disabled
18:31:24.959 INFO   [main]
org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:263)
>76> Structured second-level cache entries: disabled
18:31:24.968 INFO   [main]
org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:290)
>76> Statistics: disabled
18:31:24.968 INFO   [main]
org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:294)
>76> Deleted entity synthetic identifier rollback: disabled
18:31:24.970 INFO   [main]
org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:309)
>76> Default entity-mode: pojo
18:31:24.971 INFO   [main]
org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:313)
>76> Named query checking : enabled
18:31:25.213 INFO   [main]
org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:161)
>75> building session factory
18:31:25.245 INFO   [main]
org.hibernate.impl.SessionFactoryObjectFactory.addInstance(SessionFactoryObjectFactory.java:82)
>76> Not binding factory to JNDI, no JNDI name configured
18:31:25.321 INFO   [main]
org.springframework.orm.hibernate3.HibernateTransactionManager.afterPropertiesSet(HibernateTransactionManager.java:390)
>59> Using DataSource [org.apache.commons.dbcp.BasicDataSource@12a73d9] of
Hibernate SessionFactory for HibernateTransactionManager
18:31:25.378 INFO   [main]
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:209)
>09> Root WebApplicationContext: initialization completed in 4716 ms
Exception in thread "main" java.lang.AbstractMethodError
	at
org.apache.tapestry.ioc.internal.RegistryImpl.<init>(RegistryImpl.java:135)
	at org.apache.tapestry.ioc.RegistryBuilder.build(RegistryBuilder.java:131)
	at
org.apache.tapestry.internal.TapestryAppInitializer.getRegistry(TapestryAppInitializer.java:152)
	at org.apache.tapestry.TapestryFilter.init(TapestryFilter.java:76)
	at org.mortbay.jetty.servlet.FilterHolder.start(FilterHolder.java:71)
	at
org.mortbay.jetty.servlet.WebApplicationHandler.initializeServlets(WebApplicationHandler.java:310)
	at
org.mortbay.jetty.servlet.WebApplicationContext.doStart(WebApplicationContext.java:509)
	at org.mortbay.util.Container.start(Container.java:72)
	at org.mortbay.http.HttpServer.doStart(HttpServer.java:708)
	at org.mortbay.util.Container.start(Container.java:72)
	at com.iw.plugins.jettyrunner.PluginRunner.launch(PluginRunner.java:282)
	at com.iw.plugins.jettyrunner.PluginRunner.launch(PluginRunner.java:104)
	at com.iw.plugins.jettyrunner.PluginRunner.main(PluginRunner.java:75)


I have just created an applicationContext for spring that will connect to
the database so I can see that I have all the pieces working together.

My  http://www.nabble.com/file/p15172268/pom.xml pom.xml 
My  http://www.nabble.com/file/p15172268/applicationContext-Persistence.xml
applicationContext-Persistence.xml 
My  http://www.nabble.com/file/p15172268/web.xml web.xml 

Does anyone have any idea on what I am doing wrong?

I am really thankful for any pointers/solutions

Thanks,
Jacob
-- 
View this message in context: http://www.nabble.com/Need-help-with-pom.xml-for-my-tapestry-5-project-tp15166088p15172268.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Need help with pom.xml for my tapestry 5 project

Posted by Jacob Bergoo <ja...@gmail.com>.
Thanks Chris,
The link for searching the repository was exactly what I was looking for. 
Thanks,
Jacob


Christian Köberl wrote:
> 
> Hi!
> 
> Jacob Bergoo wrote:
>> 
>> When I try to run the application Jetty I got an error for missing
>> commons-dbcp. I have tried to find this jar in the maven repositories in
>> http://repo1.maven.org/maven2/org/apache/commons/ and in
>> http://repo1.maven.org/maven2/org/apache/commons/ and there is no sign of
>> it there.
>> 
> Commons-dbcp has the groupId commons-dbcp, so you have to add the
> following dependency to your pom:
> <dependency>
>     <groupId>commons-dbcp</groupId>
>     <artifactId>commons-dbcp</artifactId>
>     <version>1.2.2</version>
> </dependency>
> 
> If you just know the name of the lib and want to know group, artifact and
> versions go to http://mvnrepository.com/ and search there.
> 
> Very good starting points for Maven are:
>  * Article "The Maven 2 POM demystified" -
> http://www.javaworld.com/javaworld/jw-05-2006/jw-0529-maven.html
>  * The book "Better Builds With Maven" -
> http://www.devzuz.com/web/guest/products/resources#BBWM
> 
> -- 
> Chris
> 

-- 
View this message in context: http://www.nabble.com/Need-help-with-pom.xml-for-my-tapestry-5-project-tp15166088p15167969.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Need help with pom.xml for my tapestry 5 project

Posted by Christian Köberl <ch...@porsche.co.at>.
Hi!

Jacob Bergoo wrote:
> 
> When I try to run the application Jetty I got an error for missing
> commons-dbcp. I have tried to find this jar in the maven repositories in
> http://repo1.maven.org/maven2/org/apache/commons/ and in
> http://repo1.maven.org/maven2/org/apache/commons/ and there is no sign of
> it there.
> 
Commons-dbcp has the groupId commons-dbcp, so you have to add the following
dependency to your pom:
<dependency>
    <groupId>commons-dbcp</groupId>
    <artifactId>commons-dbcp</artifactId>
    <version>1.2.2</version>
</dependency>

If you just know the name of the lib and want to know group, artifact and
versions go to http://mvnrepository.com/ and search there.

Very good starting points for Maven are:
 * Article "The Maven 2 POM demystified" -
http://www.javaworld.com/javaworld/jw-05-2006/jw-0529-maven.html
 * The book "Better Builds With Maven" -
http://www.devzuz.com/web/guest/products/resources#BBWM

-- 
Chris
-- 
View this message in context: http://www.nabble.com/Need-help-with-pom.xml-for-my-tapestry-5-project-tp15166088p15166631.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Need help with pom.xml for my tapestry 5 project

Posted by Szemere Szemere <sz...@googlemail.com>.
What you posted has
org.apche.commons
rather than
org.apache.commons

Are you missing an 'a' in apache?

On Jan 29, 2008 6:31 PM, Jacob Bergoo <ja...@gmail.com> wrote:

>
> Hi All,
> I am new to Maven 2 but I am learning as fast as I can. My plan is to set
> up
> a project that is working with Spring 2.5.1, Tapestry 5, Hibernate
> 3.2.5.ga,
> MySQL 5.0.
> This is what I have done so far:
> 1) I have Created a project using Quickstart Archtype for Tapestry 5
> 2) I have added Spring dep. to my pom.xml
> 3) I have added MySQL connector to my
> http://www.nabble.com/file/p15166088/pom.xml pom.xml
>
> When I try to run the application Jetty I got an error for missing
> commons-dbcp. I have tried to find this jar in the maven repositories in
> http://repo1.maven.org/maven2/org/apache/commons/ and in
> http://repo1.maven.org/maven2/org/apache/commons/ and there is no sign of
> it
> there. I want to do this "the maven way", but so far it seems a lot easier
> to just drop in the jar file in the lib folder...
>
> Has anybody else set upp this combination or similar combination of
> framework and are willing to share the pom.xml with the rest of us.
>
> Thanks in advance for any help
> Jacob
>
>
> --
> View this message in context:
> http://www.nabble.com/Need-help-with-pom.xml-for-my-tapestry-5-project-tp15166088p15166088.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>