Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!

John Eric Hamacher

Ranch Hand
+ Follow
since Apr 25, 2007
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by John Eric Hamacher

Hello,

I am trying to find the best way maintain state on my custom view when users rotate their phone. The custom view has an instance variable which is of type Board (my creation). Board in turn contains instance variables which are custom objects themselves. I looked into the Parcelable approach but it doesn't appear possible to "chain" Parcelables for recreating my object graph. Another idea that came to mind would be to use onRetainNonConfigurationInstance() to store the custom view itself, but after that thought, I felt I had to take a shower. I'm pretty new to Android so I am looking for other possible approaches.

Thanks, Eric
5 years ago
Thanks for the responses. I'll try it out.

Eric
Spring 3.1.1
Maven 3.0.4
JPA
Eclipse wtp indigo

Hello,
I am getting the following exception on server startup. I have just one persistence.xml in my project. Any ideas? Thanks Eric

Caused by: java.lang.IllegalStateException: Conflicting persistence unit definitions for name 'cassandra_pu': file:/C:/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/cassandra/WEB-INF/classes/, file:/C:/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/cassandra/WEB-INF/classes/
at org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager.preparePersistenceUnitInfos(DefaultPersistenceUnitManager.java:362)
at org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager.afterPropertiesSet(DefaultPersistenceUnitManager.java:326)
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:235)
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:310)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)
... 62 more

My context file:




My persistence.xml file is in META-INF where it should be:



Thanks for the response. I can use this code for multiple transactions (all using the same DAO) on a single thread and somehow it knows to create a new EntityManager for each. The documentation seems very nonchalant about this but it is usually very good to warn about misuse of what it presents. I wonder if AOP is helping but I never specified any AOP in my application context.

Thanks, Eric
Hello,


In the Spring documentation (section 13.5.2) I see a DAO:




which is described as a thread-safe way to use a shared EntityManager. So I assume this means I could use this DAO as a singleton in a web container and not have to worry about different users grabbing the same EntityManager?
Just want to make sure. Just learning this stuff.

Thanks, Eric
Thank you! Thank you for the responses! It is working now.
Hello:

I am getting:

  • Caused by: java.lang.IllegalArgumentException: No PersistenceProvider specified in EntityManagerFactory configuration, and chosen PersistenceUnitInfo does not specify a provider class name either
    at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:250)
    at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:310)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)
    ... 37 more



  • My app context contains:




    My persistence file (located in META-INF under classes). hibernate.cfg.xml is located in WEB-INF but I specified WEB-INF as part of my classpath when I ran the program.




    My hibernate.cfg.xml:



    Thanks , Eric
    Sorry,

    its complaining about the header. I read that should create an AbstractPdfView implementation. This seems like an awful amount of work just to set some headers.

    com.ibm.ws.webcontainer.srt.SRTServletResponse setHeader WARNING: Cannot set header. Response already committed.
    6 years ago
    Hello:

    I am streaming PDFs to the client using Spring 3 MVC. I am getting a "Response already committed" error in the following code. Where can I set response headers?

    Thanks Eric


    6 years ago
    MyBatis 3.1.0
    Spring 3.1.1
    IBM JDK 6

    Hello:

    I am trying to use the <foreach> element in MyBatis but no matter how I pass my collection to the element (I've tried several things) I get, for instance:



    for:




    and the mapper class:




    Any help would be appreciated.

    Eric


    IBM JDK 1.6
    RAD
    Axis 1.6.1

    Hello:

    I get the following error using a client stub created by wsdl2java for Axis 1.6.1. It looks like a version mismatch but I only have 1.6.1 on my classpath. Any help would be appreciated. Eric


    Code:








    java.lang.InstantiationError: org.apache.axis2.databinding.ADBDataSource
    [4/11/12 13:07:09:001 CDT] 0000001a SystemErr R at com.lyonsreg.www.webservice.abaservice.ABAServiceStub$Logon.getOMElement(ABAServiceStub.java:12523)
    [4/11/12 13:07:09:001 CDT] 0000001a SystemErr R at com.lyonsreg.www.webservice.abaservice.ABAServiceStub.toEnvelope(ABAServiceStub.java:13386)
    [4/11/12 13:07:09:001 CDT] 0000001a SystemErr R at com.lyonsreg.www.webservice.abaservice.ABAServiceStub.logon(ABAServiceStub.java:662)
    [4/11/12 13:07:09:001 CDT] 0000001a SystemErr R at gov.wi.state.dpi.aidsbanking.service.EntryServiceImpl.logon(EntryServiceImpl.java:83)
    [4/11/12 13:07:09:001 CDT] 0000001a SystemErr R at gov.wi.state.dpi.aidsbanking.service.EntryServiceImpl.getBankNameFromWebService(EntryServiceImpl.java:70)
    [4/11/12 13:07:09:001 CDT] 0000001a SystemErr R at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [4/11/12 13:07:09:001 CDT] 0000001a SystemErr R at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
    [4/11/12 13:07:09:001 CDT] 0000001a SystemErr R at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
    [4/11/12 13:07:09:001 CDT] 0000001a SystemErr R at java.lang.reflect.Method.invoke(Method.java:600)
    [4/11/12 13:07:09:001 CDT] 0000001a SystemErr R at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:318)
    [4/11/12 13:07:09:001 CDT] 0000001a SystemErr R at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:196)
    [4/11/12 13:07:09:001 CDT] 0000001a SystemErr R at $Proxy208.getBankNameFromWebService(Unknown Source)
    [4/11/12 13:07:09:001 CDT] 0000001a SystemErr R at gov.wi.state.dpi.aidsbanking.controller.EntryController.bankNameLookup(EntryController.java:133)
    [4/11/12 13:07:09:001 CDT] 0000001a SystemErr R at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [4/11/12 13:07:09:002 CDT] 0000001a SystemErr R at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
    [4/11/12 13:07:09:002 CDT] 0000001a SystemErr R at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
    [4/11/12 13:07:09:002 CDT] 0000001a SystemErr R at java.lang.reflect.Method.invoke(Method.java:600)
    [4/11/12 13:07:09:002 CDT] 0000001a SystemErr R at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:213)
    [4/11/12 13:07:09:002 CDT] 0000001a SystemErr R at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:126)
    [4/11/12 13:07:09:002 CDT] 0000001a SystemErr R at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:96)
    [4/11/12 13:07:09:002 CDT] 0000001a SystemErr R at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:617)
    [4/11/12 13:07:09:002 CDT] 0000001a SystemErr R at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:578)
    [4/11/12 13:07:09:002 CDT] 0000001a SystemErr R at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80)
    [4/11/12 13:07:09:002 CDT] 0000001a SystemErr R at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923)
    [4/11/12 13:07:09:002 CDT] 0000001a SystemErr R at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)
    [4/11/12 13:07:09:002 CDT] 0000001a SystemErr R at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
    [4/11/12 13:07:09:002 CDT] 0000001a SystemErr R at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)
    [4/11/12 13:07:09:002 CDT] 0000001a SystemErr R at javax.servlet.http.HttpServlet.service(HttpServlet.java:718)
    [4/11/12 13:07:09:002 CDT] 0000001a SystemErr R at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
    [4/11/12 13:07:09:002 CDT] 0000001a SystemErr R at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1661)
    [4/11/12 13:07:09:002 CDT] 0000001a SystemErr R at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1595)
    [4/11/12 13:07:09:002 CDT] 0000001a SystemErr R at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:131)
    [4/11/12 13:07:09:002 CDT] 0000001a SystemErr R at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:311)
    [4/11/12 13:07:09:002 CDT] 0000001a SystemErr R at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:116)
    [4/11/12 13:07:09:002 CDT] 0000001a SystemErr R at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
    [4/11/12 13:07:09:002 CDT] 0000001a SystemErr R at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
    [4/11/12 13:07:09:002 CDT] 0000001a SystemErr R at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
    [4/11/12 13:07:09:002 CDT] 0000001a SystemErr R at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
    [4/11/12 13:07:09:002 CDT] 0000001a SystemErr R at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:101)
    [4/11/12 13:07:09:003 CDT] 0000001a SystemErr R at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
    [4/11/12 13:07:09:003 CDT] 0000001a SystemErr R at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
    [4/11/12 13:07:09:003 CDT] 0000001a SystemErr R at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
    [4/11/12 13:07:09:003 CDT] 0000001a SystemErr R at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
    [4/11/12 13:07:09:003 CDT] 0000001a SystemErr R at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
    [4/11/12 13:07:09:003 CDT] 0000001a SystemErr R at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
    [4/11/12 13:07:09:003 CDT] 0000001a SystemErr R at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
    [4/11/12 13:07:09:003 CDT] 0000001a SystemErr R at org.springframework.security.web.authentication.preauth.AbstractPreAuthenticatedProcessingFilter.doFilter(AbstractPreAuthenticatedProcessingFilter.java:88)
    [4/11/12 13:07:09:003 CDT] 0000001a SystemErr R at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
    [4/11/12 13:07:09:003 CDT] 0000001a SystemErr R at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
    [4/11/12 13:07:09:003 CDT] 0000001a SystemErr R at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
    [4/11/12 13:07:09:003 CDT] 0000001a SystemErr R at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
    [4/11/12 13:07:09:003 CDT] 0000001a SystemErr R at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
    [4/11/12 13:07:09:003 CDT] 0000001a SystemErr R at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:173)
    [4/11/12 13:07:09:003 CDT] 0000001a SystemErr R at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
    [4/11/12 13:07:09:003 CDT] 0000001a SystemErr R at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
    [4/11/12 13:07:09:003 CDT] 0000001a SystemErr R at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:188)
    [4/11/12 13:07:09:003 CDT] 0000001a SystemErr R at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:116)
    [4/11/12 13:07:09:003 CDT] 0000001a SystemErr R at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:77)
    [4/11/12 13:07:09:003 CDT] 0000001a SystemErr R at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:908)
    [4/11/12 13:07:09:003 CDT] 0000001a SystemErr R at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:932)
    [4/11/12 13:07:09:003 CDT] 0000001a SystemErr R at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:500)
    [4/11/12 13:07:09:003 CDT] 0000001a SystemErr R at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)
    [4/11/12 13:07:09:004 CDT] 0000001a SystemErr R at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3826)
    [4/11/12 13:07:09:004 CDT] 0000001a SystemErr R at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:276)
    [4/11/12 13:07:09:004 CDT] 0000001a SystemErr R at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:931)
    [4/11/12 13:07:09:004 CDT] 0000001a SystemErr R at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1583)
    [4/11/12 13:07:09:004 CDT] 0000001a SystemErr R at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:186)
    [4/11/12 13:07:09:004 CDT] 0000001a SystemErr R at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:455)
    [4/11/12 13:07:09:004 CDT] 0000001a SystemErr R at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:384)
    [4/11/12 13:07:09:004 CDT] 0000001a SystemErr R at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:83)
    [4/11/12 13:07:09:004 CDT] 0000001a SystemErr R at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
    [4/11/12 13:07:09:004 CDT] 0000001a SystemErr R at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
    [4/11/12 13:07:09:004 CDT] 0000001a SystemErr R at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
    [4/11/12 13:07:09:004 CDT] 0000001a SystemErr R at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
    [4/11/12 13:07:09:004 CDT] 0000001a SystemErr R at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
    [4/11/12 13:07:09:004 CDT] 0000001a SystemErr R at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
    [4/11/12 13:07:09:004 CDT] 0000001a SystemErr R at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
    [4/11/12 13:07:09:004 CDT] 0000001a SystemErr R at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1550)
    6 years ago
    Thanks for the response:

    Yes, I meant (amp)lt(semi-colon). It is a very small XML response from a web service. When I print the response to my console, all of the < and > are escaped (except for the root node, which is normal). I receive the response as an InputStream which I feed to an XML parser:




    The unescaped XML looks like (this is what this message board does to the document when it is escaped):




    6 years ago
    (apos)lt(semi-colon)
    6 years ago
    (apos)lt(semicolon)
    6 years ago
    I can't convey this right . . . lt convert to <
    6 years ago