Re: help me please!!! Wicket/Spring/Hibernate configuration woes

2010-12-16 Thread adam.gibbons
gt; >> > at org.apache.wicket.proxy.$Proxy15.authenticate(Unknown Source)
> >> > at
> >> >
> >>
> uk.co.company.product.presentation.wicket.app.CustomAuthenticatedWebSession.authenticate(CustomAuthenticatedWebSession.java:29)
>
> >>
> >> >
> >> > I was under the impression that the OpenSessionInViewFilter was
> supposed
> >> to
> >>
> >> > do this for us?
> >> >
> >> >
> >> > Once again here is the source code:
> >> >
> >> >
> >> > web.xml:
> >> >
> >> > 
> >> >  >> >xmlns="http://java.sun.com/xml/ns/j2ee";
> >> >xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> >> >xsi:schemaLocation="
> >> >http://java.sun.com/xml/ns/j2ee
> >> >http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd
> >> >"
> >> >version="2.4"
> >> > >
> >> >ZenTemplate
> >> >
> >> >contextConfigLocation
> >> >classpath:applicationContext.xml
> >> >
> >> >
> >> >
> >> >
> >>
> org.springframework.web.context.ContextLoaderListener
>
> >>
> >> >
> >> >
> >> >opensessioninview
> >> >
> >> >
> >>
> org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
>
> >>
> >> >
> >> >
> >> >wicket-spring-hibernate
> >> >
> >> >
> org.apache.wicket.protocol.http.WicketFilter
> >>
> >> >
> >> >applicationFactoryClassName
> >> >
> >> >
> >>
> org.apache.wicket.spring.SpringWebApplicationFactory
>
> >>
> >> >
> >> >
> >> >applicationClassName
> >> >
> >> >
> >>
> uk.co.company.product.presentation.wicket.app.WicketApplication
>
> >>
> >>
> >> >    
> >> >
> >> >
> >> >opensessioninview
> >> >    /*
> >> >
> >> >    
> >> >wicket-spring-hibernate
> >> >/*
> >> >
> >> > 
> >> >
> >> >
> >> >
> >> > applicationContext.xml:
> >> >
> >> > 
> >> >  >> >xmlns="http://www.springframework.org/schema/beans";
> >> >xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> >> >xmlns:aop="http://www.springframework.org/schema/aop";
> >> >xmlns:tx="http://www.springframework.org/schema/tx";
> >> >xmlns:context="http://www.springframework.org/schema/context";
> >> >xsi:schemaLocation="
> >> >    http://www.springframework.org/schema/beans
> >> > http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
> >> >    http://www.springframework.org/schema/aop
> >> > http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
> >> >http://www.springframework.org/schema/tx
> >> > http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
> >> >http://www.springframework.org/schema/context
> >> > http://www.springframework.org/schema/context/spring-context-2.5.xsd
> >> >"
> >> >default-autowire="byType"
> >> >default-lazy-init="false"
> >> > >
> >> > >> >
> class="uk.co.company.product.presentation.wicket.app.WicketApplication"
> >> />
> >> >
> >> > >> >
> >>
> class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"
>
> >>
> >>
> >> > autowire="byName">
> >> > />
> >> > >> > value="SYSTEM_PROPERTIES_MODE_OVERRIDE" />
> >> >
> >> >
> >> >classpath*:/application.properties
> >> >
> >> >    
> >> >
> >> >     >> > class="org.springframework.jdbc.datasource.DriverManagerDataSource"
> >> > autowire="byName">
> >> > 

Re: help me please!!! Wicket/Spring/Hibernate configuration woes

2010-12-15 Thread Michael O'Cleirigh
t.Method.invoke(Method.java:597)
at


org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)


at


org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)


at


org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)


at


org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)


at


org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)


at


org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)


at $Proxy9.save(Unknown Source)
at


uk.co.company.product.business.spring.UserServiceImpl.authenticate(UserServiceImpl.java:42)


at java.lang.reflect.Method.invoke(Method.java:597)
at


org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)


at


org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)


at


org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)


at


org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)


at


org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)


at


org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)


at $Proxy10.authenticate(Unknown Source)
at java.lang.reflect.Method.invoke(Method.java:597)
at


org.apache.wicket.proxy.LazyInitProxyFactory$JdkHandler.invoke(LazyInitProxyFactory.java:416)


at org.apache.wicket.proxy.$Proxy15.authenticate(Unknown Source)
at


uk.co.company.product.presentation.wicket.app.CustomAuthenticatedWebSession.authenticate(CustomAuthenticatedWebSession.java:29)


I was under the impression that the OpenSessionInViewFilter was supposed

to


do this for us?


Once again here is the source code:


web.xml:


http://java.sun.com/xml/ns/j2ee";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="
http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd
"
version="2.4"
ZenTemplate

contextConfigLocation
classpath:applicationContext.xml





org.springframework.web.context.ContextLoaderListener




opensessioninview



org.springframework.orm.hibernate3.support.OpenSessionInViewFilter




wicket-spring-hibernate

org.apache.wicket.protocol.http.WicketFilter

applicationFactoryClassName



org.apache.wicket.spring.SpringWebApplicationFactory




applicationClassName



uk.co.company.product.presentation.wicket.app.WicketApplication






opensessioninview
/*


wicket-spring-hibernate
/*





applicationContext.xml:


http://www.springframework.org/schema/beans";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns:aop="http://www.springframework.org/schema/aop";
xmlns:tx="http://www.springframework.org/schema/tx";
xmlns:context="http://www.springframework.org/schema/context";
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd
"
default-autowire="byType"
default-lazy-init="false"

/>


class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"



autowire="byName">




classpath*:/application.properties




${jdbc.driver}
${jdbc.url}

name="username">${jdbc.username}


name="password">${jdbc.password}













class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"



autowire="byName">




${hibernate.dialect}
true
hibernate.format_sql
zen_template
2
    
        pojo
    true
    true
true
thread
true



true


--
  View message @
http://apache-wicket.18

Re: help me please!!! Wicket/Spring/Hibernate configuration woes

2010-12-15 Thread James Carman
;> >
>> uk.co.company.product.presentation.wicket.app.WicketApplication
>>
>>
>> >        
>> >    
>> >    
>> >        opensessioninview
>> >        /*
>> >    
>> >    
>> >        wicket-spring-hibernate
>> >        /*
>> >    
>> > 
>> >
>> >
>> >
>> > applicationContext.xml:
>> >
>> > 
>> > > >    xmlns="http://www.springframework.org/schema/beans";
>> >    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>> >    xmlns:aop="http://www.springframework.org/schema/aop";
>> >    xmlns:tx="http://www.springframework.org/schema/tx";
>> >    xmlns:context="http://www.springframework.org/schema/context";
>> >    xsi:schemaLocation="
>> >        http://www.springframework.org/schema/beans
>> > http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
>> >        http://www.springframework.org/schema/aop
>> > http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
>> >        http://www.springframework.org/schema/tx
>> > http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
>> >        http://www.springframework.org/schema/context
>> > http://www.springframework.org/schema/context/spring-context-2.5.xsd
>> >    "
>> >    default-autowire="byType"
>> >    default-lazy-init="false"
>> > >
>> >    > > class="uk.co.company.product.presentation.wicket.app.WicketApplication"
>> />
>> >
>> >    > >
>> class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"
>>
>>
>> > autowire="byName">
>> >        
>> >        > > value="SYSTEM_PROPERTIES_MODE_OVERRIDE" />
>> >        
>> >        
>> >            classpath*:/application.properties
>> >        
>> >    
>> >
>> >    > > class="org.springframework.jdbc.datasource.DriverManagerDataSource"
>> > autowire="byName">
>> >        > > name="driverClassName">${jdbc.driver}
>> >        ${jdbc.url}
>> >        > name="username">${jdbc.username}
>> >        > name="password">${jdbc.password}
>>
>> >    
>> >
>> >    
>> >
>> >    > > class="org.springframework.orm.hibernate3.HibernateTransactionManager"
>> > autowire="byName">
>> >        
>> >    
>> >
>> >    
>> >
>> >    > >
>> class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"
>>
>>
>> > autowire="byName">
>> >        
>> >        
>> >            
>> >                
>> >                ${hibernate.dialect}
>> >                true
>> >                hibernate.format_sql
>>
>> >                zen_template
>> >                2
>> >                
>> >                pojo
>> >                true
>> >                true
>> >                true
>> >                > > key="hibernate.current_session_context_class">thread
>> >                true
>> >                
>> >                
>> >                
>> >                > > key="hibernate.jdbc.use_streams_for_binary">true
>> >                > > key="hibernate.j
>>
>>
>> --
>>  View message @
>> http://apache-wicket.1842946.n4.nabble.com/help-me-please-Wicket-Spring-Hibernate-configuration-woes-tp3088768p3089324.html
>>
>> To start a new topic under Apache Wicket, email
>> ml-node+1842946-1499480286-201...@n4.nabble.com
>> To unsubscribe from Apache Wicket, click 
>> here<http://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=1842946&code=YWRhbS5zLmdpYmJvbnNAZ21haWwuY29tfDE4NDI5NDZ8LTUzNzMyMDU4OQ==>.
>>
>>
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/help-me-please-Wicket-Spring-Hibernate-configuration-woes-tp3088768p3089377.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: help me please!!! Wicket/Spring/Hibernate configuration woes

2010-12-15 Thread adam.gibbons
g.reflect.Method.invoke(Method.java:597)
> > at
> >
> org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
>
> > at
> >
> org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
>
> > at
> >
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
>
> > at
> >
> org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
>
> > at
> >
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
>
> > at
> >
> org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
>
> > at $Proxy10.authenticate(Unknown Source)
> > at java.lang.reflect.Method.invoke(Method.java:597)
> > at
> >
> org.apache.wicket.proxy.LazyInitProxyFactory$JdkHandler.invoke(LazyInitProxyFactory.java:416)
>
> > at org.apache.wicket.proxy.$Proxy15.authenticate(Unknown Source)
> > at
> >
> uk.co.company.product.presentation.wicket.app.CustomAuthenticatedWebSession.authenticate(CustomAuthenticatedWebSession.java:29)
>
> >
> > I was under the impression that the OpenSessionInViewFilter was supposed
> to
>
> > do this for us?
> >
> >
> > Once again here is the source code:
> >
> >
> > web.xml:
> >
> > 
> >  >xmlns="http://java.sun.com/xml/ns/j2ee";
> >xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> >xsi:schemaLocation="
> >http://java.sun.com/xml/ns/j2ee
> >http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd
> >"
> >version="2.4"
> > >
> >ZenTemplate
> >
> >contextConfigLocation
> >classpath:applicationContext.xml
> >
> >
> >
> >
> org.springframework.web.context.ContextLoaderListener
>
> >
> >
> >opensessioninview
> >
> >
> org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
>
> >
> >
> >wicket-spring-hibernate
> >
> > org.apache.wicket.protocol.http.WicketFilter
>
> >
> >applicationFactoryClassName
> >
> >
> org.apache.wicket.spring.SpringWebApplicationFactory
>
> >
> >
> >applicationClassName
> >
> >
> uk.co.company.product.presentation.wicket.app.WicketApplication
>
>
> >
> >
> >
> >opensessioninview
> >/*
> >
> >
> >wicket-spring-hibernate
> >/*
> >
> > 
> >
> >
> >
> > applicationContext.xml:
> >
> > 
> >  >xmlns="http://www.springframework.org/schema/beans";
> >xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> >xmlns:aop="http://www.springframework.org/schema/aop";
> >xmlns:tx="http://www.springframework.org/schema/tx";
> >xmlns:context="http://www.springframework.org/schema/context";
> >xsi:schemaLocation="
> >http://www.springframework.org/schema/beans
> > http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
> >http://www.springframework.org/schema/aop
> > http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
> >http://www.springframework.org/schema/tx
> > http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
> >http://www.springframework.org/schema/context
> > http://www.springframework.org/schema/context/spring-context-2.5.xsd
> >"
> >default-autowire="byType"
> >default-lazy-init="false"
> > >
> > > class="uk.co.company.product.presentation.wicket.app.WicketApplication"
> />
> >
> > >
> class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"
>
>
> > autowire="byName">
> >
> > > value="SYSTEM_PROPERTIES_MODE_OVERRIDE" />
> >
> >
> >classpath*:/application.properties
> >
> >
> >
> > > class="org.springframework.jdbc.datasource.DriverManagerDataSource"
> > autowire="byName">
> > > name="driverClassName">${jdbc.driver}
> >${jdbc.url}
> > nam

Re: help me please!!! Wicket/Spring/Hibernate configuration woes

2010-12-15 Thread adam.gibbons
nate.bytecode.use_reflection_optimizer">true
>> > key="hibernate.cglib.use_reflection_optimizer">true
>> 
>> 
>> 
>> 
>> 
>> 
>> uk.co.company.product.persistance.hibernate
>> 
>> 
>>  
>>  
>> 
>>
>>
>> CustomAuthenticatedWebSession.java:
>>
>>
>> public class CustomAuthenticatedWebSession extends
>> AuthenticatedWebSession{
>> private static final long serialVersionUID = 4713195500103052768L;
>>
>> @SpringBean
>> private UserService userService;
>> public void setUserService(final UserService userService){
>> this.userService = userService;
>> }
>>
>> transient private String currentUser = null;
>>
>> public CustomAuthenticatedWebSession(final Request request){
>> super(request);
>> InjectorHolder.getInjector().inject(this);//<-- VERY IMPORTANT to
>> get Spring DI to work (within Wicket objects)
>>
>> }
>>
>> @Override
>> public boolean authenticate(final String username, final String
>> password){
>> currentUser = username;
>> return userService.authenticate(username, password);
>> }
>>
>> @Override
>> public Roles getRoles(){
>>         return userService.getRoles(currentUser, isSignedIn());
>> }
>> }
>>
>>
>> UserServiceImpl.java:
>>
>> @Service
>> public class UserServiceImpl extends _AbstractService implements
>> UserService{
>>
>> final private TestUserService testUserService = new TestUserService();
>>
>> @Autowired
>> private Temp1DAO temp1DAO;
>> @Override
>> @Required
>> final public void setTemp1DAO(final Temp1DAO temp1dao){
>> temp1DAO = temp1dao;
>> }
>>
>> public UserServiceImpl(){
>> super();
>> //InjectorHolder.getInjector().inject(this);//<-- VERY IMPORTANT
>> to get Spring DI to work.
>> }
>>
>>     /* (non-Javadoc)
>>  * @see
>> uk.co.company.product.business.spring.UserService#authenticate(java.lang.String,
>> java.lang.String)
>>  */
>> @Override
>> @Transactional
>> final public boolean authenticate(final String userName, final String
>> password){
>> final Temp1 temp1 = new Temp1();
>> temp1.setValue(userName);
>> temp1DAO.save(temp1);
>> return testUserService.authenticate(userName, password);
>>     }
>>
>> /* (non-Javadoc)
>>  * @see
>> uk.co.company.product.business.spring.UserService#getRoles(java.lang.String,
>> boolean)
>>  */
>> @Override
>> @Transactional
>> final public Roles getRoles(final String userName, final boolean
>> signedIn){
>> return testUserService.getRoles(userName, signedIn);
>> }
>> }
>>
>>
>> Temp1DAOImpl.java:
>>
>> @Repository
>> public class Temp1DAOImpl extends AbstractTemp1DAO implements Temp1DAO{
>> private static final Log log = LogFactory.getLog(Temp1DAOImpl.class);
>>
>> public Temp1DAOImpl(){
>> super();
>> log.debug("Temp1DAO created.");
>> }
>>
>> @Autowired
>> public void init(final SessionFactory factory) {
>> setSessionFactory(factory);
>> }
>> }
>>
>>
>>
>>
>> --
>>  View message @
>> http://apache-wicket.1842946.n4.nabble.com/help-me-please-Wicket-Spring-Hibernate-configuration-woes-tp3088768p3089284.html<http://apache-wicket.1842946.n4.nabble.com/help-me-please-Wicket-Spring-Hibernate-configuration-woes-tp3088768p3089284.html?by-user=t>
>>
>> To start a new topic under Apache Wicket, email [hidden 
>> email]<http://user/SendEmail.jtp?type=node&node=3089321&i=1>
>> To unsubscribe from Apache Wicket, click 
>> here<http://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=1842946&code=amNnYXJjaWFtQGdtYWlsLmNvbXwxODQyOTQ2fDEyNTYxMzc3ODY=&by-user=t>.
>>
>>
>
>
>
> --
> Sincerely,
> JC (http://www.linkedin.com/in/jcgarciam)
> --Anyone who has never made a mistake has never tried anything new.--
>
>
>
>
> --
>  View message @
> http://apache-wicket.1842946.n4.nabble.com/help-me-please-Wicket-Spring-Hibernate-configuration-woes-tp3088768p3089321.html
>
> To start a new topic under Apache Wicket, email
> ml-node+1842946-1499480286-201...@n4.nabble.com
> To unsubscribe from Apache Wicket, click 
> here<http://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=1842946&code=YWRhbS5zLmdpYmJvbnNAZ21haWwuY29tfDE4NDI5NDZ8LTUzNzMyMDU4OQ==>.
>
>

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/help-me-please-Wicket-Spring-Hibernate-configuration-woes-tp3088768p3089371.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: help me please!!! Wicket/Spring/Hibernate configuration woes

2010-12-15 Thread Hielke Hoeve
Hey Adam,

This is still a spring error, you need a sessionfactory and
transactionfactory and link them together. The opensessioninview filter only
opens a transaction if you get this right. The spring forums are filled with
examples.

Hielke
On 15 Dec 2010 16:58, "adam.gibbons"  wrote:
>
>
> Ok, I think this is now back to a Wicket question. Start up is ok now.
> However when I try and invoke UserServiceImpl.authenticate(){
>final Temp1 temp1 = new Temp1();
>temp1.setValue(userName);
>temp1DAO.save(temp1);
>return testUserService.authenticate(userName, password);
> }
>
> I get the following error through the GUI:
>
> Method onFormSubmitted of interface
> org.apache.wicket.markup.html.form.IFormSubmitListener targeted at
component
> [MarkupContainer [Component id = signInForm]] threw an exception
>
> Root cause:
>
> org.hibernate.HibernateException: persist is not valid without active
> transaction
> at
>
org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:297)
> at $Proxy18.persist(Unknown Source)
> at
>
uk.co.company.product.persistance.hibernate.AbstractTemp1DAO.save(AbstractTemp1DAO.java:21)
> at
>
uk.co.company.product.persistance.hibernate.Temp1DAOImpl.save(Temp1DAOImpl.java:1)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at
>
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
> at
>
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
> at
>
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
> at
>
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
> at
>
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
> at
>
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
> at $Proxy9.save(Unknown Source)
> at
>
uk.co.company.product.business.spring.UserServiceImpl.authenticate(UserServiceImpl.java:42)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at
>
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
> at
>
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
> at
>
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
> at
>
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
> at
>
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
> at
>
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
> at $Proxy10.authenticate(Unknown Source)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at
>
org.apache.wicket.proxy.LazyInitProxyFactory$JdkHandler.invoke(LazyInitProxyFactory.java:416)
> at org.apache.wicket.proxy.$Proxy15.authenticate(Unknown Source)
> at
>
uk.co.company.product.presentation.wicket.app.CustomAuthenticatedWebSession.authenticate(CustomAuthenticatedWebSession.java:29)
>
> I was under the impression that the OpenSessionInViewFilter was supposed
to
> do this for us?
>
>
> Once again here is the source code:
>
>
> web.xml:
>
> 
> xmlns="http://java.sun.com/xml/ns/j2ee";
>xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>xsi:schemaLocation="
>http://java.sun.com/xml/ns/j2ee
>http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd
>"
>version="2.4"
> >
>ZenTemplate
>
>contextConfigLocation
>classpath:applicationContext.xml
>
>
>
>
org.springframework.web.context.ContextLoaderListener
>
>
>opensessioninview
>
>
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
>
>
>wicket-spring-hibernate
>
> org.apache.wicket.protocol.http.WicketFilter
>
>applicationFactoryClassName
>
>
org.apache.wicket.spring.SpringWebApplicationFactory
>
>
>applicationClassName
>
>
uk.co.company.product.presentation.wicket.app.WicketApplication
>
>
>
>opensessioninview
>/*
>
>
>wicket-spring-hibernate
>/*
>
> 
>
>
>
> applicationContext.xml:
>
> 
> xmlns="http://www.springframework.org/schema/beans";
>xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>xmlns:aop="http://www.springframework.org/schema/aop";
>xmlns:tx="http://www.springframework.org/schema/tx";
>xmlns:context="http://www.springframework.org/schema/context";
>xsi:schemaLocation="
>http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
>http://www.springframework.org/schema/aop
> http://www.springframework.org/schema/aop/spring-aop-2.5.xsd

Re: help me please!!! Wicket/Spring/Hibernate configuration woes

2010-12-15 Thread jcgarciam
  }
>
> /* (non-Javadoc)
>  * @see
> uk.co.company.product.business.spring.UserService#authenticate(java.lang.String,
> java.lang.String)
>  */
> @Override
> @Transactional
> final public boolean authenticate(final String userName, final String
> password){
> final Temp1 temp1 = new Temp1();
> temp1.setValue(userName);
> temp1DAO.save(temp1);
> return testUserService.authenticate(userName, password);
> }
>
> /* (non-Javadoc)
>  * @see
> uk.co.company.product.business.spring.UserService#getRoles(java.lang.String,
> boolean)
>  */
> @Override
> @Transactional
> final public Roles getRoles(final String userName, final boolean
> signedIn){
> return testUserService.getRoles(userName, signedIn);
> }
> }
>
>
> Temp1DAOImpl.java:
>
> @Repository
> public class Temp1DAOImpl extends AbstractTemp1DAO implements Temp1DAO{
> private static final Log log = LogFactory.getLog(Temp1DAOImpl.class);
>
> public Temp1DAOImpl(){
> super();
> log.debug("Temp1DAO created.");
> }
>
> @Autowired
> public void init(final SessionFactory factory) {
> setSessionFactory(factory);
> }
> }
>
>
>
>
> --
>  View message @
> http://apache-wicket.1842946.n4.nabble.com/help-me-please-Wicket-Spring-Hibernate-configuration-woes-tp3088768p3089284.html
>
> To start a new topic under Apache Wicket, email
> ml-node+1842946-398011874-65...@n4.nabble.com
> To unsubscribe from Apache Wicket, click 
> here<http://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=1842946&code=amNnYXJjaWFtQGdtYWlsLmNvbXwxODQyOTQ2fDEyNTYxMzc3ODY=>.
>
>



-- 
Sincerely,
JC (http://www.linkedin.com/in/jcgarciam)
--Anyone who has never made a mistake has never tried anything new.--

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/help-me-please-Wicket-Spring-Hibernate-configuration-woes-tp3088768p3089321.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: help me please!!! Wicket/Spring/Hibernate configuration woes

2010-12-15 Thread adam.gibbons
ties




${jdbc.driver}
${jdbc.url}
${jdbc.username}
${jdbc.password}















${hibernate.dialect}
true
hibernate.format_sql
zen_template
2

pojo
true
true
true
thread
true



true
true

8
false
5




 
 true
true






uk.co.company.product.persistance.hibernate


 
 



CustomAuthenticatedWebSession.java:

public class CustomAuthenticatedWebSession extends AuthenticatedWebSession{
private static final long serialVersionUID = 4713195500103052768L;

@SpringBean
private UserService userService;
public void setUserService(final UserService userService){
this.userService = userService;
}

transient private String currentUser = null;

public CustomAuthenticatedWebSession(final Request request){
super(request);
InjectorHolder.getInjector().inject(this);//<-- VERY IMPORTANT to
get Spring DI to work (within Wicket objects)
}

@Override
public boolean authenticate(final String username, final String
password){
currentUser = username;
return userService.authenticate(username, password);
}

@Override
public Roles getRoles(){
return userService.getRoles(currentUser, isSignedIn());
}
}


UserServiceImpl.java:

@Service
public class UserServiceImpl extends _AbstractService implements
UserService{

final private TestUserService testUserService = new TestUserService();

@Autowired
private Temp1DAO temp1DAO;
@Override
@Required
final public void setTemp1DAO(final Temp1DAO temp1dao){
temp1DAO = temp1dao;
}

public UserServiceImpl(){
super();
//InjectorHolder.getInjector().inject(this);//<-- VERY IMPORTANT to
get Spring DI to work.
}

/* (non-Javadoc)
 * @see
uk.co.company.product.business.spring.UserService#authenticate(java.lang.String,
java.lang.String)
 */
@Override
@Transactional
final public boolean authenticate(final String userName, final String
password){
final Temp1 temp1 = new Temp1();
temp1.setValue(userName);
temp1DAO.save(temp1);
return testUserService.authenticate(userName, password);
}

/* (non-Javadoc)
 * @see
uk.co.company.product.business.spring.UserService#getRoles(java.lang.String,
boolean)
 */
@Override
@Transactional
final public Roles getRoles(final String userName, final boolean
signedIn){
return testUserService.getRoles(userName, signedIn);
}
}


Temp1DAOImpl.java:

@Repository
public class Temp1DAOImpl extends AbstractTemp1DAO implements Temp1DAO{
private static final Log log = LogFactory.getLog(Temp1DAOImpl.class);

public Temp1DAOImpl(){
super();
log.debug("Temp1DAO created.");
}

@Autowired
public void init(final SessionFactory factory) {
    setSessionFactory(factory);
}
}

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/help-me-please-Wicket-Spring-Hibernate-configuration-woes-tp3088768p3089284.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: help me please!!! Wicket/Spring/Hibernate configuration woes

2010-12-15 Thread James Carman
Put a log statement in your DAO's constructor to see if it's getting
instantiated (it's probably not).  Then turn on component scanning as
suggested by someone else.


On Wed, Dec 15, 2010 at 10:01 AM, adam.gibbons  wrote:
>
> There is definitely only 1 implementation. I read the error as it finds 0
> implementations...
>
> On 15 December 2010 14:54, jcgarciam [via Apache Wicket] <
> ml-node+3089160-35062030-201...@n4.nabble.com
>> wrote:
>
>> It seems be two Implementation in the classpath, and �...@autowired can't 
>> pick
>> one of them.
>>
>> On Wed, Dec 15, 2010 at 11:50 AM, James Carman [via Apache Wicket] <[hidden
>> email] > wrote:
>>
>>> Now this isn't a Wicket question.  This is a Spring question.  Wrong
>>> forum.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: help me please!!! Wicket/Spring/Hibernate configuration woes

2010-12-15 Thread James Carman
stered the JBDC
>> >> >> driver
>> >> >>>>> [com.mysql.jdbc.Driver] but failed to unregister it when the web
>> >> >>>> application
>> >> >>>>> was stopped. To prevent a memory leak, the JDBC Driver has been
>> >> >> forcibly
>> >> >>>>> unregistered.
>> >> >>>>> 15-Dec-2010 10:33:44 org.apache.catalina.loader.WebappClassLoader
>> >> >>>>> clearReferencesThreads
>> >> >>>>> SEVERE: The web application [/ZenTemplate-0] appears to have
>> started
>> >> a
>> >> >>
>> >> >>>>> thread named [MySQL Statement Cancellation Timer] but has failed
>> to
>> >> >> stop
>> >> >>>> it.
>> >> >>>>> This is very likely to create a memory leak.
>> >> >>>>>
>> >> >>>>> web.xml:
>> >> >>>>>
>> >> >>>>> 
>> >> >>>>> > >> >>>>>   xmlns="http://java.sun.com/xml/ns/j2ee";
>> >> >>>>>   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>> >> >>>>>   xsi:schemaLocation="
>> >> >>>>>       http://java.sun.com/xml/ns/j2ee
>> >> >>>>>       http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd
>> >> >>>>>   "
>> >> >>>>>   version="2.4"
>> >> >>>>>>
>> >> >>>>>   ZenTemplate
>> >> >>>>>   
>> >> >>>>>       contextConfigLocation
>> >> >>>>>       classpath:applicationContext.xml
>> >> >>>>>   
>> >> >>>>>   
>> >> >>>>>
>> >> >>>>>
>> >> >>>>
>> >> >>
>> >>
>> org.springframework.web.context.ContextLoaderListener
>>
>> >>
>> >> >>
>> >> >>>>
>> >> >>>>>   
>> >> >>>>>   
>> >> >>>>>       opensessioninview
>> >> >>>>>
>> >> >>>>>
>> >> >>>>
>> >> >>
>> >>
>> org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
>>
>> >>
>> >> >>
>> >> >>>>
>> >> >>>>>   
>> >> >>>>>   
>> >> >>>>>       wicket-spring-hibernate
>> >> >>>>>
>> >> >>>>>
>> >> >>
>> >>
>> org.apache.wicket.protocol.http.WicketFilter
>> >> >>>>
>> >> >>>>>       
>> >> >>>>>           applicationFactoryClassName
>> >> >>>>>
>> >> >>>>>
>> >> >>>>
>> >> >>
>> >>
>> org.apache.wicket.spring.SpringWebApplicationFactory
>>
>> >>
>> >> >>
>> >> >>>>
>> >> >>>>>       
>> >> >>>>>       
>> >> >>>>>           applicationClassName
>> >> >>>>>
>> >> >>>>>
>> >> >>>>
>> >> >>
>> >>
>> uk.co.company.product.presentation.wicket.app.WicketApplication
>>
>> >>
>> >> >>
>> >> >>>>
>> >> >>>>>       
>> >> >>>>>   
>> >> >>>>>   
>> >> >>>>>       opensessioninview
>> >> >>>>>       /*
>> >> >>>>>   
>> >> >>>>>   
>> >> >>>>>       wicket-spring-hibernate
>> >> >>>>>       /*
>> >> >>>>>   
>> >> >>>>> 
>> >> >>>>>
>> >> >>>>> applicationContext.xml:
>> >> >>>>>
>> >> >>>>> 
>> >> >>>>> > >> >>>>>   xmlns="http://www.springframework.org/schema/beans";
>> >> >>>>>   xml

Re: help me please!!! Wicket/Spring/Hibernate configuration woes

2010-12-15 Thread adam.gibbons
ringframework.org/schema/context";
> >> >> >xsi:schemaLocation="
> >> >> >http://www.springframework.org/schema/beans
> >> >> > http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
> >> >> >http://www.springframework.org/schema/aop
> >> >> > http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
> >> >> >http://www.springframework.org/schema/tx
> >> >> > http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
> >> >> >http://www.springframework.org/schema/context
> >> >> >
> http://www.springframework.org/schema/context/spring-context-2.5.xsd
> >> >> >"
> >> >> >default-autowire-candidates="*Service,*DAO,*Bean"
> >> >> >default-autowire="byType"
> >> >> >default-lazy-init="false"
> >> >> >>
> >> >> >
> >> >> >
> >> >> > >> >> >
> >> >>
> >>
> class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
>
> >>
> >> >>
> >> >> > value="false"
> >> />
> >> >> > >> >> > value="SYSTEM_PROPERTIES_MODE_OVERRIDE" />
> >> >> >
> >> >> >
> >> >> >classpath*:/application.properties
> >> >> >
> >> >> >
> >> >> >
> >> >> > >> >> >
> class="org.springframework.jdbc.datasource.DriverManagerDataSource">
> >> >> > >> >> > name="driverClassName">${jdbc.driver}
> >> >> >${jdbc.url}
> >> >> > >> >> name="username">${jdbc.username}
> >> >> > >> >> name="password">${jdbc.password}
> >> >> >
> >> >> >
> >> >> >
> >> >> >
> >> >> > >> >> >
> >> class="org.springframework.orm.hibernate3.HibernateTransactionManager">
> >> >> >
> >> >> >
> >> >> >
> >> >> >
> >> >> >
> >> >> > >> >> >
> >> >>
> >>
> class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
>
> >>
> >> >>
> >> >> >
> >> >> >
> >> >> >    
> >> >> >    
> >> >> > >> key="hibernate.dialect">${hibernate.dialect}
> >> >> >true
> >> >> > >> key="hibernate.show_sql">hibernate.format_sql
> >> >>
> >> >> > >> key="hibernate.default_schema">zen_template
> >> >> >2
> >> >> >
> >> >> > key="hibernate.default_entity_mode">pojo
> >> >> >true
> >> >> > key="hibernate.generate_statistics">true
> >> >> > >> key="hibernate.use_identifier_rollback">true
> >> >> > >> >> > key="hibernate.current_session_context_class">thread
> >> >> >true
> >> >> >
> >> >> >
> >> >> >
> >> >> > >> >> > key="hibernate.jdbc.use_streams_for_binary">true
> >> >> > >> >> > key="hibernate.jdbc.use_get_generated_keys">true
> >> >> >
> >> >> >     key="hibernate.connection.isolation">8
> >> >> >         >> key="hibernate.connection.autocommit">false
> >> >> >5
> >> >> >        
> >> >> >    
> >> >> >
> >> >> >     

Re: help me please!!! Wicket/Spring/Hibernate configuration woes

2010-12-15 Thread adam.gibbons
.orm.hibernate3.support.OpenSessionInViewFilter
>
> >>
> >> >>
> >> >>>>
> >> >>>>>   
> >> >>>>>   
> >> >>>>>   wicket-spring-hibernate
> >> >>>>>
> >> >>>>>
> >> >>
> >>
> org.apache.wicket.protocol.http.WicketFilter
> >> >>>>
> >> >>>>>   
> >> >>>>>   applicationFactoryClassName
> >> >>>>>
> >> >>>>>
> >> >>>>
> >> >>
> >>
> org.apache.wicket.spring.SpringWebApplicationFactory
>
> >>
> >> >>
> >> >>>>
> >> >>>>>   
> >> >>>>>   
> >> >>>>>   applicationClassName
> >> >>>>>
> >> >>>>>
> >> >>>>
> >> >>
> >>
> uk.co.company.product.presentation.wicket.app.WicketApplication
>
> >>
> >> >>
> >> >>>>
> >> >>>>>   
> >> >>>>>   
> >> >>>>>   
> >> >>>>>   opensessioninview
> >> >>>>>   /*
> >> >>>>>   
> >> >>>>>   
> >> >>>>>   wicket-spring-hibernate
> >> >>>>>   /*
> >> >>>>>   
> >> >>>>> 
> >> >>>>>
> >> >>>>> applicationContext.xml:
> >> >>>>>
> >> >>>>> 
> >> >>>>>  >> >>>>>   xmlns="http://www.springframework.org/schema/beans";
> >> >>>>>   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> >> >>>>>   xmlns:aop="http://www.springframework.org/schema/aop";
> >> >>>>>   xmlns:tx="http://www.springframework.org/schema/tx";
> >> >>>>>   xmlns:context="http://www.springframework.org/schema/context";
> >> >>>>>   xsi:schemaLocation="
> >> >>>>>   http://www.springframework.org/schema/beans
> >> >>>>> http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
> >> >>>>>   http://www.springframework.org/schema/aop
> >> >>>>> http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
> >> >>>>>   http://www.springframework.org/schema/tx
> >> >>>>> http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
> >> >>>>>   http://www.springframework.org/schema/context
> >> >>>>>
> http://www.springframework.org/schema/context/spring-context-2.5.xsd
> >> >>>>>   "
> >> >>>>>   default-autowire-candidates="*Service,*DAO,*Bean"
> >> >>>>>   default-autowire="byType"
> >> >>>>>   default-lazy-init="false"
> >> >>>>>>
> >> >>>>>   
> >> >>>>>
> >> >>>>>>> >>>>>
> >> >>>>
> >> >>
> >>
> class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
>
> >>
> >> >>
> >> >>>>
> >> >>>>>value="false"
> >> >> />
> >> >>>>>>> >>>>> value="SYSTEM_PROPERTIES_MODE_OVERRIDE" />
> >> >>>>>   
> >> >>>>>   
> >> >>>>>   classpath*:/application.properties
> >> >>>>>   
> >> >>>>>   
> >> >>>>>
> >> >>>>>>> >>>>>
> class="org.springframework.jdbc.datasource.DriverManagerDataSource">
> >> >>>>>>> >>>>> name="driverClassName">${jdbc.driver}
> >> >>>>>   ${jdbc.url}
> >> >>>>>>> >>>> name="username">${jdbc.username}
> >> >>>>>>> >>>> name="password">${jdbc.password}

Re: help me please!!! Wicket/Spring/Hibernate configuration woes

2010-12-15 Thread James Carman
gt;> >                > key="hibernate.default_schema">zen_template
>> >> >                2
>> >> >                
>> >> >                pojo
>> >> >                true
>> >> >                true
>> >> >                > key="hibernate.use_identifier_rollback">true
>> >> >                > >> > key="hibernate.current_session_context_class">thread
>> >> >                true
>> >> >                
>> >> >                
>> >> >                
>> >> >                > >> > key="hibernate.jdbc.use_streams_for_binary">true
>> >> >                > >> > key="hibernate.jdbc.use_get_generated_keys">true
>> >> >                
>> >> >                8
>> >> >                > key="hibernate.connection.autocommit">false
>> >> >                5
>> >> >                
>> >> >                
>> >> >                
>> >> >                
>> >> >                 
>> >> >                 > >> > key="hibernate.bytecode.use_reflection_optimizer">true
>> >> >                > >> > key="hibernate.cglib.use_reflection_optimizer">true
>> >> >                
>> >> >                
>> >> >            
>> >> >        
>> >> >        
>> >> >        
>> >> >            uk.co.company.product.persistance.hibernate
>> >> >        
>> >> >    
>> >> >     
>> >> > 
>> >> >
>> >> > my WicketApplication.java:
>> >> >
>> >> > public class WicketApplication extends AuthenticatedWebApplication{
>> >> >
>> >> >    public WicketApplication(){
>> >> >        super();
>> >> >    }
>> >> >
>> >> >   �...@override
>> >> >    final public Class getHomePage(){
>> >> >        return HomePage.class;
>> >> >    }
>> >> >
>> >> >   �...@override
>> >> >    final protected Class getSignInPageClass(){
>> >> >        return LoginPage.class;
>> >> >    }
>> >> >
>> >> >   �...@override
>> >> >    final protected Class
>> >> > getWebSessionClass() {
>> >> >        return CustomAuthenticatedWebSession.class;
>> >> >    }
>> >> >
>> >> >   �...@override
>> >> >    final protected void init(){
>> >> >        super.init();
>> >> >        addComponentInstantiationListener(new
>> >> > SpringComponentInjector(this));
>> >> >        final IApplicationSettings appSettings =
>> getApplicationSettings();
>> >>
>> >> >        appSettings.setAccessDeniedPage(CustomAccessDeniedPage.class);
>> >> >        //appSettings.setPageExpiredErrorPage(null);
>> >> >        //appSettings.setInternalErrorPage(null);
>> >> >    }
>> >> > }
>> >> >
>> >> > my CustomAuthenticatedWebSession:
>> >> >
>> >> > public class CustomAuthenticatedWebSession extends
>> >> AuthenticatedWebSession{
>> >> >    private static final long serialVersionUID = 4713195500103052768L;
>> >> >
>> >> >   �...@springbean
>> >> >    private UserService userService;
>> >> >    public void setUserService(final UserService userService){
>> >> >        this.userService = userService;
>> >> >    }
>> >> >
>> >> >    transient private String currentUser = null;
>> >> >
>> >> >    public CustomAuthenticatedWebSession(final Request request){
>> >> >        super(request);
>> >> >        InjectorHolder.getInjector().inject(this);//<-- VERY IMPORTANT
>> to
>> >> > get Spring DI to work.
>> >> >    }
>> >> >
>> >> >   �...@override
>> >> >    public boolean authenticate(final String username, final String
>> >> > password){
>> >> >        currentUser = username;
>> >> >        return userService.authenticate(username, password);
>> >> >    }
>> >> >
>> >> >   �...@override
>> >> >    public Roles getRoles(){
>> >> >        return userService.getRoles(currentUser, isSignedIn());
>> >> >    }
>> >> > }
>> >> >
>> >> >
>> >> > my UserServiceImpl.java:
>> >> >
>> >> > @Service
>> >> > public class UserServiceImpl extends _AbstractService implements
>> >> > UserService{
>> >> >
>> >> >    final private TestUserService testUserService = new
>> TestUserService();
>> >>
>> >> >
>> >> >   �...@springbean
>> >> >    private Temp1DAO temp1DAO;
>> >> >    /* (non-Javadoc)
>> >> >     * @see
>> >> >
>> >>
>> uk.co.company.product.business.spring.UserService#setTemp1DAO(uk.co.company.product.persistance.hibernate.Temp1DAO)
>>
>> >>
>> >> >     */
>> >> >   �...@override
>> >> >   �...@required
>> >> >    final public void setTemp1DAO(final Temp1DAO temp1dao){
>> >> >        temp1DAO = temp1dao;
>> >> >    }
>> >> >
>> >> >    public UserServiceImpl(){
>> >> >        super();
>> >> >        InjectorHolder.getInjector().inject(this);//<-- VERY IMPORTANT
>> to
>> >> > get Spring DI to work.
>> >> >    }
>> >> >
>> >> >    /* (non-Javadoc)
>> >> >     * @see
>> >> >
>> >>
>> uk.co.company.product.business.spring.UserService#authenticate(java.lang.String,
>>
>> >>
>> >> > java.lang.String)
>> >> >     */
>> >> >   �...@override
>> >> >   �...@transactional
>> >> >    final public boolean authenticate(final String userName, final
>> String
>> >> > password){
>> >> >        final Temp1 temp1 = new Temp1();
>> >> >        temp1.setValue(userName);
>> >> >        temp1DAO.save(temp1);
>> >> >        return testUserService.authenticate(userName, password);
>> >> >    }
>> >> >
>> >> >    /* (non-Javadoc)
>> >> >     * @see
>> >> >
>> >>
>> uk.co.company.product.business.spring.UserService#getRoles(java.lang.String,
>>
>> >>
>> >> > boolean)
>> >> >     */
>> >> >   �...@override
>> >> >   �...@transactional
>> >> >    final public Roles getRoles(final String userName, final boolean
>> >> > signedIn){
>> >> >        return testUserService.getRoles(userName, signedIn);
>> >> >    }
>> >> > }
>> >> >
>> >> > and finally Temp1DAOImpl.java:
>> >> >
>> >> > @Repository
>> >> > public class Temp1DAOImpl extends AbstractTemp1DAO implements
>> Temp1DAO{
>> >> >    private static final Log log =
>> LogFactory.getLog(Temp1DAOImpl.class);
>> >> >
>> >> >    public Temp1DAOImpl(){
>> >> >        super();
>> >> >        log.debug("Temp1DAO created.");
>> >> >    }
>> >> > }
>> >> >
>> >> > I did have this working to the point where it would start up without
>> >> errors,
>> >> > although it would die when trying to call
>> userServiceImpl.authenticate()
>> >> due
>> >> > to a NPE for temp1DAO. (It seemed odd before that it would do DI for
>> >> > Services but not for DAOs...)
>> >> > I'm sure I'm missing something blindingly obvious, but I'd really
>> >> appriciate
>> >> > a second opinion.
>> >> >
>> >> > Thanks in advance for all help and assistance!!
>> >> >
>> >> >
>> >> > Cheers,
>> >> > Adam
>> >> >
>> >>
>> >> -
>> >> To unsubscribe, e-mail: [hidden email]<
>> http://user/SendEmail.jtp?type=node&node=3088802&i=1>
>> >> For additional commands, e-mail: [hidden email]<
>> http://user/SendEmail.jtp?type=node&node=3088802&i=2>
>> >>
>> >>
>> >>
>> >> --
>> >>  View message @
>> >>
>> http://apache-wicket.1842946.n4.nabble.com/help-me-please-Wicket-Spring-Hibernate-configuration-woes-tp3088768p3088802.html<http://apache-wicket.1842946.n4.nabble.com/help-me-please-Wicket-Spring-Hibernate-configuration-woes-tp3088768p3088802.html?by-user=t>
>> >>
>> >> To start a new topic under Apache Wicket, email
>> >> [hidden email] 
>> >> <http://user/SendEmail.jtp?type=node&node=3089041&i=3><[hidden
>> email] <http://user/SendEmail.jtp?type=node&node=3089041&i=4>>
>> >> To unsubscribe from Apache Wicket, click here<
>> http://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=1842946&code=YWRhbS5zLmdpYmJvbnNAZ21haWwuY29tfDE4NDI5NDZ8LTUzNzMyMDU4OQ==<http://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=1842946&code=YWRhbS5zLmdpYmJvbnNAZ21haWwuY29tfDE4NDI5NDZ8LTUzNzMyMDU4OQ==&by-user=t>>.
>>
>> >>
>> >>
>> >
>> > --
>> > View this message in context:
>> http://apache-wicket.1842946.n4.nabble.com/help-me-please-Wicket-Spring-Hibernate-configuration-woes-tp3088768p3089024.html<http://apache-wicket.1842946.n4.nabble.com/help-me-please-Wicket-Spring-Hibernate-configuration-woes-tp3088768p3089024.html?by-user=t>
>> > Sent from the Users forum mailing list archive at Nabble.com.
>> >
>> > -
>> > To unsubscribe, e-mail: [hidden 
>> > email]<http://user/SendEmail.jtp?type=node&node=3089041&i=5>
>> > For additional commands, e-mail: [hidden 
>> > email]<http://user/SendEmail.jtp?type=node&node=3089041&i=6>
>> >
>> >
>>
>> -
>> To unsubscribe, e-mail: [hidden 
>> email]<http://user/SendEmail.jtp?type=node&node=3089041&i=7>
>> For additional commands, e-mail: [hidden 
>> email]<http://user/SendEmail.jtp?type=node&node=3089041&i=8>
>>
>>
>>
>> --
>>  View message @
>> http://apache-wicket.1842946.n4.nabble.com/help-me-please-Wicket-Spring-Hibernate-configuration-woes-tp3088768p3089041.html
>>
>> To start a new topic under Apache Wicket, email
>> ml-node+1842946-1499480286-201...@n4.nabble.com
>> To unsubscribe from Apache Wicket, click 
>> here<http://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=1842946&code=YWRhbS5zLmdpYmJvbnNAZ21haWwuY29tfDE4NDI5NDZ8LTUzNzMyMDU4OQ==>.
>>
>>
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/help-me-please-Wicket-Spring-Hibernate-configuration-woes-tp3088768p3089093.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: help me please!!! Wicket/Spring/Hibernate configuration woes

2010-12-15 Thread James Carman
>>>>>
>> >>>>
>> >>
>> org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
>>
>> >>
>> >>>>
>> >>>>>   
>> >>>>>   
>> >>>>>       wicket-spring-hibernate
>> >>>>>
>> >>>>>
>> >>
>> org.apache.wicket.protocol.http.WicketFilter
>> >>>>
>> >>>>>       
>> >>>>>           applicationFactoryClassName
>> >>>>>
>> >>>>>
>> >>>>
>> >>
>> org.apache.wicket.spring.SpringWebApplicationFactory
>>
>> >>
>> >>>>
>> >>>>>       
>> >>>>>       
>> >>>>>           applicationClassName
>> >>>>>
>> >>>>>
>> >>>>
>> >>
>> uk.co.company.product.presentation.wicket.app.WicketApplication
>>
>> >>
>> >>>>
>> >>>>>       
>> >>>>>   
>> >>>>>   
>> >>>>>       opensessioninview
>> >>>>>       /*
>> >>>>>   
>> >>>>>   
>> >>>>>       wicket-spring-hibernate
>> >>>>>       /*
>> >>>>>   
>> >>>>> 
>> >>>>>
>> >>>>> applicationContext.xml:
>> >>>>>
>> >>>>> 
>> >>>>> > >>>>>   xmlns="http://www.springframework.org/schema/beans";
>> >>>>>   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>> >>>>>   xmlns:aop="http://www.springframework.org/schema/aop";
>> >>>>>   xmlns:tx="http://www.springframework.org/schema/tx";
>> >>>>>   xmlns:context="http://www.springframework.org/schema/context";
>> >>>>>   xsi:schemaLocation="
>> >>>>>       http://www.springframework.org/schema/beans
>> >>>>> http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
>> >>>>>       http://www.springframework.org/schema/aop
>> >>>>> http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
>> >>>>>       http://www.springframework.org/schema/tx
>> >>>>> http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
>> >>>>>       http://www.springframework.org/schema/context
>> >>>>> http://www.springframework.org/schema/context/spring-context-2.5.xsd
>> >>>>>   "
>> >>>>>   default-autowire-candidates="*Service,*DAO,*Bean"
>> >>>>>   default-autowire="byType"
>> >>>>>   default-lazy-init="false"
>> >>>>>>
>> >>>>>   
>> >>>>>
>> >>>>>   > >>>>>
>> >>>>
>> >>
>> class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
>>
>> >>
>> >>>>
>> >>>>>       > >> />
>> >>>>>       > >>>>> value="SYSTEM_PROPERTIES_MODE_OVERRIDE" />
>> >>>>>       
>> >>>>>       
>> >>>>>           classpath*:/application.properties
>> >>>>>       
>> >>>>>   
>> >>>>>
>> >>>>>   > >>>>> class="org.springframework.jdbc.datasource.DriverManagerDataSource">
>> >>>>>       > >>>>> name="driverClassName">${jdbc.driver}
>> >>>>>       ${jdbc.url}
>> >>>>>       > >>>> name="username">${jdbc.username}
>> >>>>>       > >>>> name="password">${jdbc.password}
>> >>>>>   
>> >>>>>
>> >>>>>   
>> >>>>>
>> >>>>>   > >>>>>
>> >> class="org.springframework.orm.hibernate3.HibernateTransactionManager">
>> >>>>>       
>> >>>>>   
>> >>>>>
>> >>>>>   
>> >>>>>
>

Re: help me please!!! Wicket/Spring/Hibernate configuration woes

2010-12-15 Thread adam.gibbons
uot;http://www.springframework.org/schema/tx";
> >> >xmlns:context="http://www.springframework.org/schema/context";
> >> >xsi:schemaLocation="
> >> >http://www.springframework.org/schema/beans
> >> > http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
> >> >http://www.springframework.org/schema/aop
> >> > http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
> >> >http://www.springframework.org/schema/tx
> >> > http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
> >> >http://www.springframework.org/schema/context
> >> > http://www.springframework.org/schema/context/spring-context-2.5.xsd
> >> >"
> >> >default-autowire-candidates="*Service,*DAO,*Bean"
> >> >default-autowire="byType"
> >> >default-lazy-init="false"
> >> >>
> >> >
> >> >
> >> > >> >
> >>
> class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
>
> >>
> >> > />
> >> > >> > value="SYSTEM_PROPERTIES_MODE_OVERRIDE" />
> >> >
> >> >
> >> >classpath*:/application.properties
> >> >
> >> >
> >> >
> >> > >> > class="org.springframework.jdbc.datasource.DriverManagerDataSource">
> >> > >> > name="driverClassName">${jdbc.driver}
> >> >${jdbc.url}
> >> > >> name="username">${jdbc.username}
> >> > >> name="password">${jdbc.password}
> >> >
> >> >
> >> >
> >> >
> >> > >> >
> class="org.springframework.orm.hibernate3.HibernateTransactionManager">
> >> >
> >> >
> >> >
> >> >
> >> >
> >> > >> >
> >>
> class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
>
> >>
> >> >
> >> >
> >> >
> >> >
> >> > key="hibernate.dialect">${hibernate.dialect}
> >> >true
> >> > key="hibernate.show_sql">hibernate.format_sql
> >>
> >> > key="hibernate.default_schema">zen_template
> >> >2
> >> >
> >> >pojo
> >> >true
> >> >true
> >> > key="hibernate.use_identifier_rollback">true
> >> > >> > key="hibernate.current_session_context_class">thread
> >> >true
> >> >
> >> >
> >> >
> >> > >> > key="hibernate.jdbc.use_streams_for_binary">true
> >> > >> > key="hibernate.jdbc.use_get_generated_keys">true
> >> >
> >> >8
> >> > key="hibernate.connection.autocommit">false
> >> >5
> >> >
> >> >
> >> >
> >> >
> >> > 
> >> >  >> > key="hibernate.bytecode.use_reflection_optimizer">true
> >> > >> > key="hibernate.cglib.use_reflection_optimizer">true
> >> >
> >> >
> >> >
> >> >
> >> >
> >> >
> >> >uk.co.company.product.persistance.hibernate
> >> >
> >> >
> >> > 
> >> > 
> >> >
> >> > my WicketApplication.java:
> >> >
> >> > public class WicketApplication extends AuthenticatedWebApplication{
> >> >
> >> >public WicketApplication(){
> >> >super();
> >> >    }
> >> >
> >> >@Overri

Re: help me please!!! Wicket/Spring/Hibernate configuration woes

2010-12-15 Thread adam.gibbons
>>>>>   http://www.springframework.org/schema/beans
> >>>>> http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
> >>>>>   http://www.springframework.org/schema/aop
> >>>>> http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
> >>>>>   http://www.springframework.org/schema/tx
> >>>>> http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
> >>>>>   http://www.springframework.org/schema/context
> >>>>> http://www.springframework.org/schema/context/spring-context-2.5.xsd
> >>>>>   "
> >>>>>   default-autowire-candidates="*Service,*DAO,*Bean"
> >>>>>   default-autowire="byType"
> >>>>>   default-lazy-init="false"
> >>>>>>
> >>>>>   
> >>>>>
> >>>>>>>>>>
> >>>>
> >>
> class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
>
> >>
> >>>>
> >>>>>>> />
> >>>>>>>>>> value="SYSTEM_PROPERTIES_MODE_OVERRIDE" />
> >>>>>   
> >>>>>   
> >>>>>   classpath*:/application.properties
> >>>>>   
> >>>>>   
> >>>>>
> >>>>>>>>>> class="org.springframework.jdbc.datasource.DriverManagerDataSource">
> >>>>>>>>>> name="driverClassName">${jdbc.driver}
> >>>>>   ${jdbc.url}
> >>>>>>>>> name="username">${jdbc.username}
> >>>>>>>>> name="password">${jdbc.password}
> >>>>>   
> >>>>>
> >>>>>   
> >>>>>
> >>>>>>>>>>
> >> class="org.springframework.orm.hibernate3.HibernateTransactionManager">
> >>>>>   
> >>>>>   
> >>>>>
> >>>>>   
> >>>>>
> >>>>>>>>>>
> >>>>
> >>
> class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
>
> >>
> >>>>
> >>>>>   
> >>>>>   
> >>>>>   
> >>>>>   
> >>>>>>> key="hibernate.dialect">${hibernate.dialect}
> >>>>>   true
> >>>>>>> key="hibernate.show_sql">hibernate.format_sql
> >>>>
> >>>>>>> key="hibernate.default_schema">zen_template
> >>>>>   2
> >>>>>   
> >>>>>   pojo
> >>>>>   true
> >>>>>   true
> >>>>>>> key="hibernate.use_identifier_rollback">true
> >>>>>>>>>> key="hibernate.current_session_context_class">thread
> >>>>>   true
> >>>>>   
> >>>>>       
> >>>>>   
> >>>>>>>>>> key="hibernate.jdbc.use_streams_for_binary">true
> >>>>>>>>>> key="hibernate.jdbc.use_get_generated_keys">true
> >>>>>   
> >>>>>   8
> >>>>>>> key="hibernate.connection.autocommit">false
> >>>>>   5
> >>>>>   
> >>>>>   
> >>>>>   
> >>>>>   
> >>>>>
> >>>>> >>>>> key="hibernate.bytecode.use_reflection_optimizer">true
> >>>>>>>>>> key="hibernate.cglib.use_reflection_optimizer">true
> >>>>>   
> >>>>>   
> >>>>>   
> >>>>>   
> >>>>>   
>

Re: help me please!!! Wicket/Spring/Hibernate configuration woes

2010-12-15 Thread James Carman
What's the code for UserServiceImpl?

On Wed, Dec 15, 2010 at 9:02 AM, adam.gibbons  wrote:
>
> New log:
> org.springframework.beans.factory.BeanCreationException: Error creating bean
> with name 'userServiceImpl' defined in file
> [C:\tomcat6\webapps\ZenTemplate-0\WEB-INF\classes\uk\co\company\product\business\spring\UserServiceImpl.class]:
> Instantiation of bean failed; nested exception is
> org.springframework.beans.BeanInstantiationException: Could not instantiate
> bean class [uk.co.company.product.business.spring.UserServiceImpl]:
> Constructor threw exception; nested exception is org.apache.wicket.Wicket
> RuntimeException: There is no application attached to current thread
> ContainerBackgroundProcessor[StandardEngine[Catalina]]

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: help me please!!! Wicket/Spring/Hibernate configuration woes

2010-12-15 Thread Matthias Gasser
">zen_template
>>>>>   2
>>>>>   
>>>>>   pojo
>>>>>   true
>>>>>       true
>>>>>   > key="hibernate.use_identifier_rollback">true
>>>>>   >>>> key="hibernate.current_session_context_class">thread
>>>>>   true
>>>>>   
>>>>>   
>>>>>   
>>>>>   >>>> key="hibernate.jdbc.use_streams_for_binary">true
>>>>>   >>>> key="hibernate.jdbc.use_get_generated_keys">true
>>>>>   
>>>>>   8
>>>>>   > key="hibernate.connection.autocommit">false
>>>>>   5
>>>>>   
>>>>>   
>>>>>   
>>>>>       
>>>>>    
>>>>>>>>> key="hibernate.bytecode.use_reflection_optimizer">true
>>>>>   >>>> key="hibernate.cglib.use_reflection_optimizer">true
>>>>>   
>>>>>   
>>>>>   
>>>>>   
>>>>>   
>>>>>   
>>>>>   uk.co.company.product.persistance.hibernate
>>>>>   
>>>>>   
>>>>>
>>>>> 
>>>>> 
>>>>> my WicketApplication.java:
>>>>> 
>>>>> public class WicketApplication extends AuthenticatedWebApplication{
>>>>> 
>>>>>   public WicketApplication(){
>>>>>   super();
>>>>>   }
>>>>> 
>>>>>   @Override
>>>>>   final public Class getHomePage(){
>>>>>   return HomePage.class;
>>>>>   }
>>>>> 
>>>>>   @Override
>>>>>   final protected Class getSignInPageClass(){
>>>>>   return LoginPage.class;
>>>>>   }
>>>>> 
>>>>>   @Override
>>>>>   final protected Class
>>>>> getWebSessionClass() {
>>>>>   return CustomAuthenticatedWebSession.class;
>>>>>   }
>>>>> 
>>>>>   @Override
>>>>>   final protected void init(){
>>>>>   super.init();
>>>>>   addComponentInstantiationListener(new
>>>>> SpringComponentInjector(this));
>>>>>   final IApplicationSettings appSettings =
>> getApplicationSettings();
>>>> 
>>>>>   appSettings.setAccessDeniedPage(CustomAccessDeniedPage.class);
>>>>>   //appSettings.setPageExpiredErrorPage(null);
>>>>>   //appSettings.setInternalErrorPage(null);
>>>>>   }
>>>>> }
>>>>> 
>>>>> my CustomAuthenticatedWebSession:
>>>>> 
>>>>> public class CustomAuthenticatedWebSession extends
>>>> AuthenticatedWebSession{
>>>>>   private static final long serialVersionUID = 4713195500103052768L;
>>>>> 
>>>>>   @SpringBean
>>>>>   private UserService userService;
>>>>>   public void setUserService(final UserService userService){
>>>>>   this.userService = userService;
>>>>>   }
>>>>> 
>>>>>   transient private String currentUser = null;
>>>>> 
>>>>>   public CustomAuthenticatedWebSession(final Request request){
>>>>>   super(request);
>>>>>   InjectorHolder.getInjector().inject(this);//<-- VERY IMPORTANT
>> to
>>>>> get Spring DI to work.
>>>>>   }
>>>>> 
>>>>>   @Override
>>>>>   public boolean authenticate(final String username, final String
>>>>> password){
>>>>>   currentUser = username;
>>>>>   return userService.authenticate(username, password);
>>>>>   }
>>>>> 
>>>>>   @Override
>>>>>   public Roles getRoles(){
>>>>>   return userService.getRoles(currentUser, isSignedIn());
>>>>>   }
>>>>> }
>>>>> 
>>>>> 
>>>>> my UserServiceImpl.java:
>>>>> 
>>>>> @Service
>>>>> public class UserServiceImpl extends _AbstractService implements
>>>>> UserService{
>>>>> 
>>>>>   final private TestUserService testUserService = new
>> TestUserService();
>>>> 
>>>>> 
>>>>>   @SpringBean
>>>>>   private Temp1DAO temp1DAO;
>>>>>   /* (non-Javadoc)
>>>>>* @see
>>>>> 
>>>> 
>> uk.co.company.product.business.spring.UserService#setTemp1DAO(uk.co.company.product.persistance.hibernate.Temp1DAO)
>> 
>>>> 
>>>>>*/
>>>>>   @Override
>>>>>   @Required
>>>>>   final public void setTemp1DAO(final Temp1DAO temp1dao){
>>>>>   temp1DAO = temp1dao;
>>>>>   }
>>>>> 
>>>>>   public UserServiceImpl(){
>>>>>   super();
>>>>>   InjectorHolder.getInjector().inject(this);//<-- VERY IMPORTANT
>> to
>>>>> get Spring DI to work.
>>>>>   }
>>>>> 
>>>>>   /* (non-Javadoc)
>>>>>* @see
>>>>> 
>>>> 
>> uk.co.company.product.business.spring.UserService#authenticate(java.lang.String,
>> 
>>>> 
>>>>> java.lang.String)
>>>>>*/
>>>>>   @Override
>>>>>   @Transactional
>>>>>   final public boolean authenticate(final String userName, final
>> String
>>>>> password){
>>>>>   final Temp1 temp1 = new Temp1();
>>>>>   temp1.setValue(userName);
>>>>>   temp1DAO.save(temp1);
>>>>>   return testUserService.authenticate(userName, password);
>>>>>   }
>>>>> 
>>>>>   /* (non-Javadoc)
>>>>>* @see
>>>>> 
>>>> 
>> uk.co.company.product.business.spring.UserService#getRoles(java.lang.String,
>> 
>>>> 
>>>>> boolean)
>>>>>*/
>>>>>   @Override
>>>>>   @Transactional
>>>>>   final public Roles getRoles(final String userName, final boolean
>>>>> signedIn){
>>>>>   return testUserService.getRoles(userName, signedIn);
>>>>>   }
>>>>> }
>>>>> 
>>>>> and finally Temp1DAOImpl.java:
>>>>> 
>>>>> @Repository
>>>>> public class Temp1DAOImpl extends AbstractTemp1DAO implements
>> Temp1DAO{
>>>>>   private static final Log log =
>> LogFactory.getLog(Temp1DAOImpl.class);
>>>>> 
>>>>>   public Temp1DAOImpl(){
>>>>>   super();
>>>>>   log.debug("Temp1DAO created.");
>>>>>   }
>>>>> }
>>>>> 
>>>>> I did have this working to the point where it would start up without
>>>> errors,
>>>>> although it would die when trying to call
>> userServiceImpl.authenticate()
>>>> due
>>>>> to a NPE for temp1DAO. (It seemed odd before that it would do DI for
>>>>> Services but not for DAOs...)
>>>>> I'm sure I'm missing something blindingly obvious, but I'd really
>>>> appriciate
>>>>> a second opinion.
>>>>> 
>>>>> Thanks in advance for all help and assistance!!
>>>>> 
>>>>> 
>>>>> Cheers,
>>>>> Adam
>>>>> 
>>>> 
>>>> -
>>>> To unsubscribe, e-mail: [hidden email]<
>> http://user/SendEmail.jtp?type=node&node=3088802&i=1>
>>>> For additional commands, e-mail: [hidden email]<
>> http://user/SendEmail.jtp?type=node&node=3088802&i=2>
>>>> 
>>>> 
>>>> 
>>>> --
>>>> View message @
>>>> 
>> http://apache-wicket.1842946.n4.nabble.com/help-me-please-Wicket-Spring-Hibernate-configuration-woes-tp3088768p3088802.html<http://apache-wicket.1842946.n4.nabble.com/help-me-please-Wicket-Spring-Hibernate-configuration-woes-tp3088768p3088802.html?by-user=t>
>>>> 
>>>> To start a new topic under Apache Wicket, email
>>>> [hidden email] 
>>>> <http://user/SendEmail.jtp?type=node&node=3089041&i=3><[hidden
>> email] <http://user/SendEmail.jtp?type=node&node=3089041&i=4>>
>>>> To unsubscribe from Apache Wicket, click here<
>> http://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=1842946&code=YWRhbS5zLmdpYmJvbnNAZ21haWwuY29tfDE4NDI5NDZ8LTUzNzMyMDU4OQ==<http://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=1842946&code=YWRhbS5zLmdpYmJvbnNAZ21haWwuY29tfDE4NDI5NDZ8LTUzNzMyMDU4OQ==&by-user=t>>.
>> 
>>>> 
>>>> 
>>> 
>>> --
>>> View this message in context:
>> http://apache-wicket.1842946.n4.nabble.com/help-me-please-Wicket-Spring-Hibernate-configuration-woes-tp3088768p3089024.html<http://apache-wicket.1842946.n4.nabble.com/help-me-please-Wicket-Spring-Hibernate-configuration-woes-tp3088768p3089024.html?by-user=t>
>>> Sent from the Users forum mailing list archive at Nabble.com.
>>> 
>>> -
>>> To unsubscribe, e-mail: [hidden 
>>> email]<http://user/SendEmail.jtp?type=node&node=3089041&i=5>
>>> For additional commands, e-mail: [hidden 
>>> email]<http://user/SendEmail.jtp?type=node&node=3089041&i=6>
>>> 
>>> 
>> 
>> -
>> To unsubscribe, e-mail: [hidden 
>> email]<http://user/SendEmail.jtp?type=node&node=3089041&i=7>
>> For additional commands, e-mail: [hidden 
>> email]<http://user/SendEmail.jtp?type=node&node=3089041&i=8>
>> 
>> 
>> 
>> --
>> View message @
>> http://apache-wicket.1842946.n4.nabble.com/help-me-please-Wicket-Spring-Hibernate-configuration-woes-tp3088768p3089041.html
>> 
>> To start a new topic under Apache Wicket, email
>> ml-node+1842946-1499480286-201...@n4.nabble.com
>> To unsubscribe from Apache Wicket, click 
>> here<http://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=1842946&code=YWRhbS5zLmdpYmJvbnNAZ21haWwuY29tfDE4NDI5NDZ8LTUzNzMyMDU4OQ==>.
>> 
>> 
> 
> -- 
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/help-me-please-Wicket-Spring-Hibernate-configuration-woes-tp3088768p3089056.html
> Sent from the Users forum mailing list archive at Nabble.com.
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
> 


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: help me please!!! Wicket/Spring/Hibernate configuration woes

2010-12-15 Thread adam.gibbons
 >> >
> >> > 
> >> > 
> >> >
> >> > my WicketApplication.java:
> >> >
> >> > public class WicketApplication extends AuthenticatedWebApplication{
> >> >
> >> >public WicketApplication(){
> >> >        super();
> >> >    }
> >> >
> >> >@Override
> >> >final public Class getHomePage(){
> >> >return HomePage.class;
> >> >}
> >> >
> >> >@Override
> >> >final protected Class getSignInPageClass(){
> >> >return LoginPage.class;
> >> >}
> >> >
> >> >@Override
> >> >final protected Class
> >> > getWebSessionClass() {
> >> >return CustomAuthenticatedWebSession.class;
> >> >}
> >> >
> >> >@Override
> >> >final protected void init(){
> >> >super.init();
> >> >addComponentInstantiationListener(new
> >> > SpringComponentInjector(this));
> >> >final IApplicationSettings appSettings =
> getApplicationSettings();
> >>
> >> >appSettings.setAccessDeniedPage(CustomAccessDeniedPage.class);
> >> >//appSettings.setPageExpiredErrorPage(null);
> >> >//appSettings.setInternalErrorPage(null);
> >> >}
> >> > }
> >> >
> >> > my CustomAuthenticatedWebSession:
> >> >
> >> > public class CustomAuthenticatedWebSession extends
> >> AuthenticatedWebSession{
> >> >private static final long serialVersionUID = 4713195500103052768L;
> >> >
> >> >@SpringBean
> >> >private UserService userService;
> >> >public void setUserService(final UserService userService){
> >> >        this.userService = userService;
> >> >}
> >> >
> >> >transient private String currentUser = null;
> >> >
> >> >public CustomAuthenticatedWebSession(final Request request){
> >> >super(request);
> >> >InjectorHolder.getInjector().inject(this);//<-- VERY IMPORTANT
> to
> >> > get Spring DI to work.
> >> >}
> >> >
> >> >    @Override
> >> >    public boolean authenticate(final String username, final String
> >> > password){
> >> >currentUser = username;
> >> >return userService.authenticate(username, password);
> >> >}
> >> >
> >> >@Override
> >> >public Roles getRoles(){
> >> >return userService.getRoles(currentUser, isSignedIn());
> >> >}
> >> > }
> >> >
> >> >
> >> > my UserServiceImpl.java:
> >> >
> >> > @Service
> >> > public class UserServiceImpl extends _AbstractService implements
> >> > UserService{
> >> >
> >> >final private TestUserService testUserService = new
> TestUserService();
> >>
> >> >
> >> >@SpringBean
> >> >private Temp1DAO temp1DAO;
> >> >/* (non-Javadoc)
> >> > * @see
> >> >
> >>
> uk.co.company.product.business.spring.UserService#setTemp1DAO(uk.co.company.product.persistance.hibernate.Temp1DAO)
>
> >>
> >> > */
> >> >@Override
> >> >@Required
> >> >final public void setTemp1DAO(final Temp1DAO temp1dao){
> >> >temp1DAO = temp1dao;
> >> >}
> >> >
> >> >public UserServiceImpl(){
> >> >super();
> >> >InjectorHolder.getInjector().inject(this);//<-- VERY IMPORTANT
> to
> >> > get Spring DI to work.
> >> >}
> >> >
> >> >/* (non-Javadoc)
> >> > * @see
> >> >
> >>
> uk.co.company.product.business.spring.UserService#authenticate(java.lang.String,
>
> >>
> >> > java.lang.String)
> >> > */
> >> >@Override
> >> >@Transactional
> >> >final public boolean authenticate(final String userName, final
> String
> >> > password){
> >> >final Temp1 temp1 = new Temp1();
> >> >temp1.setValue(userName);
> >> >temp1DAO.save(temp1);
> >> >return testUserService.authenticate(userName, password);
> >> >}
> >> >
> >> >/* (non-Javadoc)
> >> > * @see
> >> >
> >>
> uk.co.company.product.business.spring.UserService#getRoles(java.lang.String,
>
> >>
> >> > boolean)
> >> > */
> >> >@Override
> >> >@Transactional
> >> >final public Roles getRoles(final String userName, final boolean
> >> > signedIn){
> >> >return testUserService.getRoles(userName, signedIn);
> >> >}
> >> > }
> >> >
> >> > and finally Temp1DAOImpl.java:
> >> >
> >> > @Repository
> >> > public class Temp1DAOImpl extends AbstractTemp1DAO implements
> Temp1DAO{
> >> >private static final Log log =
> LogFactory.getLog(Temp1DAOImpl.class);
> >> >
> >> >public Temp1DAOImpl(){
> >> >super();
> >> >log.debug("Temp1DAO created.");
> >> >}
> >> > }
> >> >
> >> > I did have this working to the point where it would start up without
> >> errors,
> >> > although it would die when trying to call
> userServiceImpl.authenticate()
> >> due
> >> > to a NPE for temp1DAO. (It seemed odd before that it would do DI for
> >> > Services but not for DAOs...)
> >> > I'm sure I'm missing something blindingly obvious, but I'd really
> >> appriciate
> >> > a second opinion.
> >> >
> >> > Thanks in advance for all help and assistance!!
> >> >
> >> >
> >> > Cheers,
> >> > Adam
> >> >
> >>
> >> -
> >> To unsubscribe, e-mail: [hidden email]<
> http://user/SendEmail.jtp?type=node&node=3088802&i=1>
> >> For additional commands, e-mail: [hidden email]<
> http://user/SendEmail.jtp?type=node&node=3088802&i=2>
> >>
> >>
> >>
> >> --
> >>  View message @
> >>
> http://apache-wicket.1842946.n4.nabble.com/help-me-please-Wicket-Spring-Hibernate-configuration-woes-tp3088768p3088802.html<http://apache-wicket.1842946.n4.nabble.com/help-me-please-Wicket-Spring-Hibernate-configuration-woes-tp3088768p3088802.html?by-user=t>
> >>
> >> To start a new topic under Apache Wicket, email
> >> [hidden email] 
> >> <http://user/SendEmail.jtp?type=node&node=3089041&i=3><[hidden
> email] <http://user/SendEmail.jtp?type=node&node=3089041&i=4>>
> >> To unsubscribe from Apache Wicket, click here<
> http://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=1842946&code=YWRhbS5zLmdpYmJvbnNAZ21haWwuY29tfDE4NDI5NDZ8LTUzNzMyMDU4OQ==<http://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=1842946&code=YWRhbS5zLmdpYmJvbnNAZ21haWwuY29tfDE4NDI5NDZ8LTUzNzMyMDU4OQ==&by-user=t>>.
>
> >>
> >>
> >
> > --
> > View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/help-me-please-Wicket-Spring-Hibernate-configuration-woes-tp3088768p3089024.html<http://apache-wicket.1842946.n4.nabble.com/help-me-please-Wicket-Spring-Hibernate-configuration-woes-tp3088768p3089024.html?by-user=t>
> > Sent from the Users forum mailing list archive at Nabble.com.
> >
> > -
> > To unsubscribe, e-mail: [hidden 
> > email]<http://user/SendEmail.jtp?type=node&node=3089041&i=5>
> > For additional commands, e-mail: [hidden 
> > email]<http://user/SendEmail.jtp?type=node&node=3089041&i=6>
> >
> >
>
> -
> To unsubscribe, e-mail: [hidden 
> email]<http://user/SendEmail.jtp?type=node&node=3089041&i=7>
> For additional commands, e-mail: [hidden 
> email]<http://user/SendEmail.jtp?type=node&node=3089041&i=8>
>
>
>
> --
>  View message @
> http://apache-wicket.1842946.n4.nabble.com/help-me-please-Wicket-Spring-Hibernate-configuration-woes-tp3088768p3089041.html
>
> To start a new topic under Apache Wicket, email
> ml-node+1842946-1499480286-201...@n4.nabble.com
> To unsubscribe from Apache Wicket, click 
> here<http://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=1842946&code=YWRhbS5zLmdpYmJvbnNAZ21haWwuY29tfDE4NDI5NDZ8LTUzNzMyMDU4OQ==>.
>
>

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/help-me-please-Wicket-Spring-Hibernate-configuration-woes-tp3088768p3089056.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: help me please!!! Wicket/Spring/Hibernate configuration woes

2010-12-15 Thread James Carman
true
>> >                hibernate.format_sql
>>
>> >                zen_template
>> >                2
>> >                
>> >                pojo
>> >                true
>> >                true
>> >                true
>> >                > > key="hibernate.current_session_context_class">thread
>> >                true
>> >                
>> >                
>> >                
>> >                > > key="hibernate.jdbc.use_streams_for_binary">true
>> >                > > key="hibernate.jdbc.use_get_generated_keys">true
>> >                
>> >                8
>> >                false
>> >                5
>> >                
>> >                
>> >                
>> >                
>> >                 
>> >                 > > key="hibernate.bytecode.use_reflection_optimizer">true
>> >                > > key="hibernate.cglib.use_reflection_optimizer">true
>> >                
>> >                
>> >            
>> >        
>> >        
>> >        
>> >            uk.co.company.product.persistance.hibernate
>> >        
>> >    
>> >     
>> > 
>> >
>> > my WicketApplication.java:
>> >
>> > public class WicketApplication extends AuthenticatedWebApplication{
>> >
>> >    public WicketApplication(){
>> >        super();
>> >    }
>> >
>> >   �...@override
>> >    final public Class getHomePage(){
>> >        return HomePage.class;
>> >    }
>> >
>> >   �...@override
>> >    final protected Class getSignInPageClass(){
>> >        return LoginPage.class;
>> >    }
>> >
>> >   �...@override
>> >    final protected Class
>> > getWebSessionClass() {
>> >        return CustomAuthenticatedWebSession.class;
>> >    }
>> >
>> >   �...@override
>> >    final protected void init(){
>> >        super.init();
>> >        addComponentInstantiationListener(new
>> > SpringComponentInjector(this));
>> >        final IApplicationSettings appSettings = getApplicationSettings();
>>
>> >        appSettings.setAccessDeniedPage(CustomAccessDeniedPage.class);
>> >        //appSettings.setPageExpiredErrorPage(null);
>> >        //appSettings.setInternalErrorPage(null);
>> >    }
>> > }
>> >
>> > my CustomAuthenticatedWebSession:
>> >
>> > public class CustomAuthenticatedWebSession extends
>> AuthenticatedWebSession{
>> >    private static final long serialVersionUID = 4713195500103052768L;
>> >
>> >   �...@springbean
>> >    private UserService userService;
>> >    public void setUserService(final UserService userService){
>> >        this.userService = userService;
>> >    }
>> >
>> >    transient private String currentUser = null;
>> >
>> >    public CustomAuthenticatedWebSession(final Request request){
>> >        super(request);
>> >        InjectorHolder.getInjector().inject(this);//<-- VERY IMPORTANT to
>> > get Spring DI to work.
>> >    }
>> >
>> >   �...@override
>> >    public boolean authenticate(final String username, final String
>> > password){
>> >        currentUser = username;
>> >        return userService.authenticate(username, password);
>> >    }
>> >
>> >   �...@override
>> >    public Roles getRoles(){
>> >        return userService.getRoles(currentUser, isSignedIn());
>> >    }
>> > }
>> >
>> >
>> > my UserServiceImpl.java:
>> >
>> > @Service
>> > public class UserServiceImpl extends _AbstractService implements
>> > UserService{
>> >
>> >    final private TestUserService testUserService = new TestUserService();
>>
>> >
>> >   �...@springbean
>> >    private Temp1DAO temp1DAO;
>> >    /* (non-Javadoc)
>> >     * @see
>> >
>> uk.co.company.product.business.spring.UserService#setTemp1DAO(uk.co.company.product.persistance.hibernate.Temp1DAO)
>>
>> >     */
>> >   �...@override
>> >   �...@required
>> >    final public void setTemp1DAO(final Temp1DAO temp1dao){
>> >        temp1DAO = temp1dao;
>> >    }
>> >
>> >    public UserServiceImpl(){
>> >        super();
>> >        InjectorHolder.getInjector().inject(this);//<-- VERY IMPORTANT to
>> > get Spring DI to work.
>> >    }
>> >
>> >    /* (non-Javadoc)
>> >     * @see
>> >
>> uk.co.company.product.business.spring.UserService#authenticate(java.lang.String,
>>
>> > java.lang.String)
>> >     */
>> >   �...@override
>> >   �...@transactional
>> >    final public boolean authenticate(final String userName, final String
>> > password){
>> >        final Temp1 temp1 = new Temp1();
>> >        temp1.setValue(userName);
>> >        temp1DAO.save(temp1);
>> >        return testUserService.authenticate(userName, password);
>> >    }
>> >
>> >    /* (non-Javadoc)
>> >     * @see
>> >
>> uk.co.company.product.business.spring.UserService#getRoles(java.lang.String,
>>
>> > boolean)
>> >     */
>> >   �...@override
>> >   �...@transactional
>> >    final public Roles getRoles(final String userName, final boolean
>> > signedIn){
>> >        return testUserService.getRoles(userName, signedIn);
>> >    }
>> > }
>> >
>> > and finally Temp1DAOImpl.java:
>> >
>> > @Repository
>> > public class Temp1DAOImpl extends AbstractTemp1DAO implements Temp1DAO{
>> >    private static final Log log = LogFactory.getLog(Temp1DAOImpl.class);
>> >
>> >    public Temp1DAOImpl(){
>> >        super();
>> >        log.debug("Temp1DAO created.");
>> >    }
>> > }
>> >
>> > I did have this working to the point where it would start up without
>> errors,
>> > although it would die when trying to call userServiceImpl.authenticate()
>> due
>> > to a NPE for temp1DAO. (It seemed odd before that it would do DI for
>> > Services but not for DAOs...)
>> > I'm sure I'm missing something blindingly obvious, but I'd really
>> appriciate
>> > a second opinion.
>> >
>> > Thanks in advance for all help and assistance!!
>> >
>> >
>> > Cheers,
>> > Adam
>> >
>>
>> -
>> To unsubscribe, e-mail: [hidden 
>> email]<http://user/SendEmail.jtp?type=node&node=3088802&i=1>
>> For additional commands, e-mail: [hidden 
>> email]<http://user/SendEmail.jtp?type=node&node=3088802&i=2>
>>
>>
>>
>> --
>>  View message @
>> http://apache-wicket.1842946.n4.nabble.com/help-me-please-Wicket-Spring-Hibernate-configuration-woes-tp3088768p3088802.html
>>
>> To start a new topic under Apache Wicket, email
>> ml-node+1842946-1499480286-201...@n4.nabble.com
>> To unsubscribe from Apache Wicket, click 
>> here<http://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=1842946&code=YWRhbS5zLmdpYmJvbnNAZ21haWwuY29tfDE4NDI5NDZ8LTUzNzMyMDU4OQ==>.
>>
>>
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/help-me-please-Wicket-Spring-Hibernate-configuration-woes-tp3088768p3089024.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: help me please!!! Wicket/Spring/Hibernate configuration woes

2010-12-15 Thread adam.gibbons
mePage(){
> >return HomePage.class;
> >}
> >
> >@Override
> >final protected Class getSignInPageClass(){
> >return LoginPage.class;
> >}
> >
> >@Override
> >final protected Class
> > getWebSessionClass() {
> >return CustomAuthenticatedWebSession.class;
> >}
> >
> >@Override
> >final protected void init(){
> >super.init();
> >addComponentInstantiationListener(new
> > SpringComponentInjector(this));
> >final IApplicationSettings appSettings = getApplicationSettings();
>
> >appSettings.setAccessDeniedPage(CustomAccessDeniedPage.class);
> >//appSettings.setPageExpiredErrorPage(null);
> >//appSettings.setInternalErrorPage(null);
> >}
> > }
> >
> > my CustomAuthenticatedWebSession:
> >
> > public class CustomAuthenticatedWebSession extends
> AuthenticatedWebSession{
> >private static final long serialVersionUID = 4713195500103052768L;
> >
> >@SpringBean
> >private UserService userService;
> >public void setUserService(final UserService userService){
> >this.userService = userService;
> >}
> >
> >transient private String currentUser = null;
> >
> >public CustomAuthenticatedWebSession(final Request request){
> >super(request);
> >InjectorHolder.getInjector().inject(this);//<-- VERY IMPORTANT to
> > get Spring DI to work.
> >}
> >
> >@Override
> >public boolean authenticate(final String username, final String
> > password){
> >currentUser = username;
> >return userService.authenticate(username, password);
> >}
> >
> >@Override
> >public Roles getRoles(){
> >return userService.getRoles(currentUser, isSignedIn());
> >}
> > }
> >
> >
> > my UserServiceImpl.java:
> >
> > @Service
> > public class UserServiceImpl extends _AbstractService implements
> > UserService{
> >
> >final private TestUserService testUserService = new TestUserService();
>
> >
> >@SpringBean
> >private Temp1DAO temp1DAO;
> >/* (non-Javadoc)
> > * @see
> >
> uk.co.company.product.business.spring.UserService#setTemp1DAO(uk.co.company.product.persistance.hibernate.Temp1DAO)
>
> > */
> >@Override
> >@Required
> >final public void setTemp1DAO(final Temp1DAO temp1dao){
> >temp1DAO = temp1dao;
> >}
> >
> >public UserServiceImpl(){
> >super();
> >InjectorHolder.getInjector().inject(this);//<-- VERY IMPORTANT to
> > get Spring DI to work.
> >}
> >
> >/* (non-Javadoc)
> > * @see
> >
> uk.co.company.product.business.spring.UserService#authenticate(java.lang.String,
>
> > java.lang.String)
> > */
> >@Override
> >@Transactional
> >final public boolean authenticate(final String userName, final String
> > password){
> >final Temp1 temp1 = new Temp1();
> >temp1.setValue(userName);
> >temp1DAO.save(temp1);
> >return testUserService.authenticate(userName, password);
> >}
> >
> >/* (non-Javadoc)
> > * @see
> >
> uk.co.company.product.business.spring.UserService#getRoles(java.lang.String,
>
> > boolean)
> > */
> >@Override
> >@Transactional
> >final public Roles getRoles(final String userName, final boolean
> > signedIn){
> >return testUserService.getRoles(userName, signedIn);
> >}
> > }
> >
> > and finally Temp1DAOImpl.java:
> >
> > @Repository
> > public class Temp1DAOImpl extends AbstractTemp1DAO implements Temp1DAO{
> >private static final Log log = LogFactory.getLog(Temp1DAOImpl.class);
> >
> >public Temp1DAOImpl(){
> >super();
> >log.debug("Temp1DAO created.");
> >}
> > }
> >
> > I did have this working to the point where it would start up without
> errors,
> > although it would die when trying to call userServiceImpl.authenticate()
> due
> > to a NPE for temp1DAO. (It seemed odd before that it would do DI for
> > Services but not for DAOs...)
> > I'm sure I'm missing something blindingly obvious, but I'd really
> appriciate
> > a second opinion.
> >
> > Thanks in advance for all help and assistance!!
> >
> >
> > Cheers,
> > Adam
> >
>
> -
> To unsubscribe, e-mail: [hidden 
> email]<http://user/SendEmail.jtp?type=node&node=3088802&i=1>
> For additional commands, e-mail: [hidden 
> email]<http://user/SendEmail.jtp?type=node&node=3088802&i=2>
>
>
>
> --
>  View message @
> http://apache-wicket.1842946.n4.nabble.com/help-me-please-Wicket-Spring-Hibernate-configuration-woes-tp3088768p3088802.html
>
> To start a new topic under Apache Wicket, email
> ml-node+1842946-1499480286-201...@n4.nabble.com
> To unsubscribe from Apache Wicket, click 
> here<http://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=1842946&code=YWRhbS5zLmdpYmJvbnNAZ21haWwuY29tfDE4NDI5NDZ8LTUzNzMyMDU4OQ==>.
>
>

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/help-me-please-Wicket-Spring-Hibernate-configuration-woes-tp3088768p3089024.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: help me please!!! Wicket/Spring/Hibernate configuration woes

2010-12-15 Thread James Carman
@SpringBean isn't for use inside your Spring services, just Wicket
stuff.  Just use the native Spring injection mechanisms.  Try
@Autowired.

On Wed, Dec 15, 2010 at 5:43 AM, Adam Gibbons  wrote:
> Hi there,
>
> For some time now I have been trying to put together a simple project to get
> me off the ground with a Wicket/Spring/Hibernate setup. I've had lots of ups
> and downs, and found this guide really useful:
> http://wicketinaction.com/2009/06/wicketspringhibernate-configuration/
> However, I still seem to be having some problems and I've no idea where to
> look now.
>
> Here's the error I get in my log:
>
> org.springframework.beans.factory.BeanCreationException: Error creating bean
> with name 'userServiceImpl' defined in file
> [C:\tomcat6\webapps\ZenTemplate-0\WEB-INF\classes\uk\co\company\product\business\spring\UserServiceImpl.class]:
> Instantiation of bean failed; nested exception is
> org.springframework.beans.BeanInstantiationException: Could not instantiate
> bean class [uk.co.company.product.business.spring.UserServiceImpl]:
> Constructor threw exception; nested exception is org.apache.wicket.Wicket
> RuntimeException: There is no application attached to current thread
> ContainerBackgroundProcessor[StandardEngine[Catalina]]
>        at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:883)
>        at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:839)
>        at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440)
>        at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
>        at java.security.AccessController.doPrivileged(Native Method)
>        at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
>        at
> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
>        at
> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
>        at
> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
>        at
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
>        at
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
>        at
> org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
>        at
> org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
>        at
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
>        at
> org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)
>        at
> org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
>        at
> org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
>        at
> org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4135)
>        at
> org.apache.catalina.core.StandardContext.start(StandardContext.java:4630)
>        at
> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
>        at
> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
>        at
> org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546)
>        at
> org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:905)
>        at
> org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:740)
>        at
> org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:500)
>        at
> org.apache.catalina.startup.HostConfig.check(HostConfig.java:1345)
>        at
> org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:303)
>        at
> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
>        at
> org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337)
>        at
> org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)
>        at
> org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
>        at
> org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
>        at java.lang.Thread.run(Thread.java:619)
> Caused by: org.springframework.beans.BeanInstantiationException: Could not
> instantiate b

help me please!!! Wicket/Spring/Hibernate configuration woes

2010-12-15 Thread Adam Gibbons
Hi there,

For some time now I have been trying to put together a simple project to get
me off the ground with a Wicket/Spring/Hibernate setup. I've had lots of ups
and downs, and found this guide really useful:
http://wicketinaction.com/2009/06/wicketspringhibernate-configuration/
However, I still seem to be having some problems and I've no idea where to
look now.

Here's the error I get in my log:

org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'userServiceImpl' defined in file
[C:\tomcat6\webapps\ZenTemplate-0\WEB-INF\classes\uk\co\company\product\business\spring\UserServiceImpl.class]:
Instantiation of bean failed; nested exception is
org.springframework.beans.BeanInstantiationException: Could not instantiate
bean class [uk.co.company.product.business.spring.UserServiceImpl]:
Constructor threw exception; nested exception is org.apache.wicket.Wicket
RuntimeException: There is no application attached to current thread
ContainerBackgroundProcessor[StandardEngine[Catalina]]
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:883)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:839)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
at
org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)
at
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
at
org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
at
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4135)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4630)
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546)
at
org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:905)
at
org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:740)
at
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:500)
at
org.apache.catalina.startup.HostConfig.check(HostConfig.java:1345)
at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:303)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at
org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337)
at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)
at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
at java.lang.Thread.run(Thread.java:619)
Caused by: org.springframework.beans.BeanInstantiationException: Could not
instantiate bean class
[uk.co.company.product.business.spring.UserServiceImpl]: Constructor threw
exception; nested exception is org.apache.wicket.WicketRuntimeException:
There is no application attached to current thread
ContainerBackgroundProcessor[StandardEngine[Catalina]]
at
org.springframework.beans.BeanUtils.instantiateClass(Bean