Search Results

Search found 6 results on 1 pages for 'skaffman'.

Page 1/1 | 1 

  • Is it valid for Hibernate list() to return duplicates?

    - by skaffman
    Is anyone aware of the validity of Hibernate's Criteria.list() and Query.list() methods returning multiple occurrences of the same entity? Occasionally I find when using the Criteria API, that changing the default fetch strategy in my class mapping definition (from "select" to "join") can sometimes affect how many references to the same entity can appear in the resulting output of list(), and I'm unsure whether to treat this as a bug or not. The javadoc does not define it, it simply says "The list of matched query results." (thanks guys). If this is expected and normal behaviour, then I can de-dup the list myself, that's not a problem, but if it's a bug, then I would prefer to avoid it, rather than de-dup the results and try to ignore it. Anyone got any experience of this?

    Read the article

  • Recommendations for java captcha libraries

    - by skaffman
    I'm looking for a replacement for JCaptcha, which doesn't seem to be maintained any more, and isn't very good to begin with. The replacement has to integrate nicely with JavaEE webapps. As I can see it, there are three options: JCaptcha - No longer maintained, crude API SimpleCaptcha - much nicer API, nicer captchas, but seems to be Java6 only ReCaptcha - easy to use, uses remote web-service to generate captchas, but not much control over look and feel Has anyone used any others, that they'd recommend?

    Read the article

  • Servlets: forwarding to a resource in a different webapp

    - by skaffman
    I'm trying to construct a java web app along modular principles, with some common resources (JSPs, mainly) in one WAR, and some custom resources in another. This means JSPs scattered across different WARs. Now JavaEE frowns upon this sort of shenanigans, and wants you to put everything in one place. My current workaround to this is to have an Eclipse-triggered Ant script which copies the content of one WAR into the other, but this is not a pleasant solution (it's fragile and too IDE-dependent). Ideally, what I'd like to be able to do is for a servlet to forward to a JSP located in a different WAR to one in which it is itself deployed. This would allow greater freedom in how I assemble my WARs. However, the RequestDispatcher does not seem to support such things. Another possibility is to use <c:import>, which does allow resources to be imported from a different WAR (with some caveats). This would probably allow me to have a "hook" JSP in one WAR, which then drags in the required JSP from another. This is a bit clunky, though, and the fact that <c:import> permits it shows that the underlying servlet API does also. But how do I access that functionality via the RequestDispatcher in a servlet?

    Read the article

  • What GC parameters is a JVM running with?

    - by skaffman
    I'm still investigating issues I have with GC tuning (see prior question), which involves lots of reading and experimentation. Sun Java5+ JVMs attempt to automatically select the optimal GC strategy and parameters based on their environment, which is great, but I can't figure out how to query the running JVM to find out what those parameters are. Ideally, I'd like to see what values of the various GC-related -XX options are being used, as selected automatically by the VM. If I had that, I could have a baseline to begin tweaking. Anyone know to recover these values from a running VM?

    Read the article

  • JSP Document/JSPX: what determines how tabs/space/linebreaks are removed in the output?

    - by NoozNooz42
    I've got a "JSP Document" ("JSP in XML") nicely formatted and when the webpage is generated and sent to the user, some linebreaks are removed. Now the really weird part: apparently the "main" .jsp always gets all its linebreak removed but for any subsequent .jsp included from the main .jsp, linebreaks seems to be randomly removed (some are there, others aren't). For example, if I'm looking at the webpage served from Firefox and ask to "view source", I get to see what is generated. So, what determines when/how linebreaks are kept/removed? This is just an example I made up... Can you force a .jsp to serve this: <body><div id="page"><div id="header"><div class="title">... or this: <body> <div id="page"> <div id="header"> <div class="title">... ? I take it that linebreaks are removed to save on bandwidth, but what if I want to keep them? And what if I want to keep the same XML indentation as in my .jsp file? Is this doable? EDIT Following skaffman's advice, I took a look at the generated .java files and the "main" one doesn't have lots of out.write but not a single one writing tabs nor newlines. Contrary to that file, all the ones that I'm including from that main .jsp have lots of lines like: out.write("\t...\n"); So I guess my question stays exactly the same: what determines how tabs/space/linebreaks are included/removed in the output?

    Read the article

  • Hibernate session problem for transactions.

    - by Jani
    Hi all, I am new to hibernate and trying integrate hibernate with an existing spring based application. I configured session factory and transaction manager, transaction proxy template. I am also using Quartz scheduler in this application. When I run the application, I am getting the following exception. ERROR au.com.michaelpage.ctsgui.utils.OrganisationMergeProfileThread - Error while updating opportunity: Could not open Hibernate Session for transaction; nested exception is java.lang.IllegalStateException: Already value [org.springframework.jdbc.datasource.ConnectionHolder@9f6885] for key [weblogic.jdbc.common.internal.RmiDataSource@32b034] bound to thread [DefaultQuartzScheduler_Worker-0] My hibernate session configuration: <bean id="sessionFactoryAU" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="dataSource"> <ref bean="profileAU" /> </property> <property name="mappingResources"> <list> <value> /au/com/michaelpage/ctsgui/hibernate/dao/mappings/Opportunity.hbm.xml </value> <value> /au/com/michaelpage/ctsgui/hibernate/dao/mappings/Position.hbm.xml </value> <value> /au/com/michaelpage/ctsgui/hibernate/dao/mappings/EventRole.hbm.xml </value> </list> </property> <property name="hibernateProperties"> <props> <!-- Database Settings --> <prop key="hibernate.dialect"> org.hibernate.dialect.SybaseDialect </prop> <prop key="hibernate.query.factory_class"> org.hibernate.hql.ast.ASTQueryTranslatorFactory </prop> <!-- Cache settings --> <prop key="hibernate.cache.provider_class"> org.hibernate.cache.EhCacheProvider </prop> </props> </property> </bean> <!-- Transaction manager for a Hibernate SessionFactory --> <bean id="txManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"> <property name="sessionFactory"> <ref bean="sessionFactoryAU" /> </property> </bean> <!-- Transaction template for Managers --> <bean id="txProxyTemplateHibernateProfileAU" abstract="true" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"> <property name="transactionManager"> <ref bean="txManager" /> </property> <property name="transactionAttributes"> <props> <prop key="create*">PROPAGATION_REQUIRED</prop> <prop key="save*">PROPAGATION_REQUIRED</prop> <prop key="update*">PROPAGATION_REQUIRED</prop> <prop key="delete*">PROPAGATION_REQUIRED</prop> <prop key="remove*">PROPAGATION_REQUIRED</prop> <prop key="get*">PROPAGATION_SUPPORTS</prop> </props> </property> </bean> <bean id="organisationMergeProfileMgrAU" parent="txProxyTemplateHibernateProfileAU"> <property name="target"> <bean class="au.com.michaelpage.ctsgui.mgr.profile.OrganisationMergeProfileMgrImpl"> <property name="commonProfileDao"> <ref bean="commonProfileDaoAU" /> </property> <property name="organisationMergeProfileDao"> <ref bean="organisationMergeDaoAU" /> </property> <property name="hibernateOrganisationDAO"> <ref bean="hibernateOrganisationDAOAU" /> </property> <property name="hibernateOpportunityDAO"> <ref bean="hibernateOpportunityDAOAU" /> </property> <property name="hibernatePositionDAO"> <ref bean="hibernatePositionDAOAU" /> </property> <property name="hibernateEventRoleDAO"> <ref bean="hibernateEventRoleDAOAU" /> </property> </bean> </property> </bean> My Quartz scheduler configuration: <bean id="organisationMergeJobDetail" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"> <property name="targetObject" ref="organisationMergeJob" /> <property name="targetMethod" value="execute" /> <property name="concurrent" value="false" /> </bean> <bean id="organisationMergeProfileRegularCheckerTrigger" class="org.springframework.scheduling.quartz.SimpleTriggerBean"> <property name="jobDetail" ref="organisationMergeJobDetail" /> <property name="repeatInterval"> <util:constant static-field="au.com.michaelpage.ctsgui.common.Constants.CHECK_FREQUENCY" /> </property> </bean> Here is the bean definition for 'organisationMergeJob' <bean id="organisationMergeJob" class="au.com.michaelpage.ctsgui.utils.OrganisationMergeProfileThread"> <property name="organisationMergeMgr" ref="organisationMergeMgr"/> </bean> <bean id="organisationMergeMgr" class="au.com.michaelpage.ctsgui.mgr.OrganisationMergeMgrImpl"> <property name="organisationMergeDao" ref="organisationMergeDao"/> </bean> Any help to solve this? Thank you in advance. Hi skaffman, Here is the stack trace of the error: Could not open Hibernate Session for transaction; nested exception is java.lang.IllegalStateException: Already value [org.springframework.jdbc.datasource.ConnectionHolder@5f2fb8] for key [weblogic.jdbc.common.internal.RmiDataSource@326b7b] bound to thread [DefaultQuartzScheduler_Worker-3] Caused by: java.lang.IllegalStateException: Already value [org.springframework.jdbc.datasource.ConnectionHolder@5f2fb8] for key [weblogic.jdbc.common.internal.RmiDataSource@326b7b] bound to thread [DefaultQuartzScheduler_Worker-3] at org.springframework.transaction.support.TransactionSynchronizationManager.bindResource(TransactionSynchronizationManager.java:163) at org.springframework.orm.hibernate3.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:526) at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:350) at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:262) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:101) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy73.updateEventRole(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304) 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.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy73.updateEventRole(Unknown Source) at au.com.michaelpage.ctsgui.utils.OrganisationMergeProfileThread.execute(OrganisationMergeProfileThread.java:100) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:283) at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:272) at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86) at org.quartz.core.JobRunShell.run(JobRunShell.java:203) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520) Thank you. Here is the bean definition for 'organisationMergeMgr' <bean id="organisationMergeMgr" class="au.com.michaelpage.ctsgui.mgr.OrganisationMergeMgrImpl"> <property name="organisationMergeDao" ref="organisationMergeDao"/> </bean>

    Read the article

1