POJO and persistence

Hi *,
Maybe I'm trying something silly but anyway...
For various reasons I have (read 'would like to have') the following components in my ejb tier.
A message-driven bean which on reception of a message calls a singleton POJO which processes the data in the message and needs some persistent object in order to do so.
I thought that because my POJO is created by an application managed MDB, it will also be container managed, but it seems not since e.g. @PersistenceContext is not supported. Am I right?
No problem I thought, I'll use JNDI to lookup my persistence unit in the following way:
In the POJO:
InitialContext ic = new InitialContext();
EntityManager em = (EntityManager)ic.lookup("java:comp/env/persistence/Z-persistence-ejbPU");and in sun-ejb-jar.xml:
<sun-ejb-jar>
<enterprise-beans>
<persistence-unit-ref>
<persistence-unit-ref-name>persistence/Z-persistence-ejbPU</persistence-unit-ref-name>
<persistence-unit-name>Z-persistence-ejbPU</persistence-unit-name>
</persistence-unit-ref>
</enterprise-beans>
</sun-ejb-jar>But this gives me following error:
file:/C:/Sun/AppServer/domains/domain1/applications/j2ee-apps/Z-persistence/Z-persistence-ejb_jar/-Z-persistence-ejbPU login successful
javax.naming.NameNotFoundException: No object bound to name java:comp/env/persistence/Z-persistence-ejbPUSo it seems that the PU is not bound to the JNDI context. However, my application uses other entitties which are created and persisted in a session bean and this works.
Can somebody provide me with a hint of what I'm missing?
Best regards,
Vaak

Hello,
I am trying the same thing on JBoss 4.2.2,but I am also getting same errori.e the persistent context is not bound to the JNDI name.
The ejb-jar file:
<message-driven>
     <ejb-name>MessageReceiver</ejb-name>
     <ejb-class>com.ecebs.hops.messaging.MessageReceiver</ejb-class>
     <activation-config>
          <activation-config-property>
          <activation-config-property-name>destination</activation-config-property-name>
          <activation-config-property-value>queue/hopsLM2/messaging/msgQueue</activation-config-property-value>
          </activation-config-property>
          <activation-config-property>
          <activation-config-property-name>destinationType</activation-config-property-name>
          <activation-config-property-value>javax.jms.Queue</activation-config-property-value>
          </activation-config-property>
     </activation-config>
     <persistence-context-ref>
          <persistence-context-ref-name>hopsLM/messaging/entity_manager</persistence-context-ref-name>
          <persistence-unit-name>hopsMessagingLM</persistence-unit-name>
     </persistence-context-ref>
</message-driven>
The error thrown:
09:38:13,700 ERROR [STDERR] javax.naming.NameNotFoundException: hopsLM not bound
09:38:13,700 ERROR [STDERR]      at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
09:38:13,700 ERROR [STDERR]      at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
09:38:13,700 ERROR [STDERR]      at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
09:38:13,700 ERROR [STDERR]      at org.jnp.server.NamingServer.lookup(NamingServer.java:267)
09:38:13,700 ERROR [STDERR]      at org.jnp.server.NamingServer.lookup(NamingServer.java:270)
If you have resolved it,please suggest what mistakes I have done.
Thanks and Regards,
Yugant Shah.

Similar Messages

  • Platform and persistence layer in package setup

    we are attempting to set up packages for MI7, and have come to the stage of
    "5.      Choose the platform and persistence layer you want to generate the setup package for. The package can be created for one platform only."
    However when we select the picklist for the platform and persistence they are empty.  How do we populate this information?
    Thanks
    Marina

    Hi,
    do you already have MI client installation files uploaded to your landscape.
    Each .sda file from mobile contains a description of what the uploaded file is all about, e.g.:
    <?xml version="1.0" encoding="utf-8"?>
    <mobile_component>
         <mcd_namespace/>
         <mcd_name>MOBILEENGINE_AWT</mcd_name>
         <mcd_version>701300</mcd_version>
         <mcd_create_date>20070518</mcd_create_date>
         <mcd_create_time>081314</mcd_create_time>
         <mcd_created_by>SAP</mcd_created_by>
         <mcd_modify_date>00000000</mcd_modify_date>
         <mcd_modify_time>000000</mcd_modify_time>
         <mcd_modified_by></mcd_modified_by>
         <memsd_text>
              <description>
                   <language>D</language>
                   <text>SAP Netweaver Mobile Client</text>
              </description>
              <description>
                   <language>E</language>
                   <text>SAP Netweaver Mobile Client</text>
              </description>
         </memsd_text>
         <memsd_prop>
              <property>
                   <property_type>CLIENT.BUILDNUMBER</property_type>
                   <value>200705180805</value>
              </property>
              <property>
                   <property_type>HOMEPAGE.INVISIBLE</property_type>
                   <value>X</value>
              </property>
              <property>
                   <property_type>PLATFORM</property_type>
                   <value>WINCE</value>
              </property>
              <property>
                   <property_type>RUNTIME</property_type>
                   <value>AWT</value>
              </property>
              <property>
                   <property_type>TYPE</property_type>
                   <value>FRAMEWORK</value>
              </property>
              <property>
                   <property_type>COMPONENT_FILE</property_type>
                   <value>NWM_AWT_WINCE.zip</value>
              </property>
         </memsd_prop>
         <memsd_dep/>
         <memsd_cust>
              <customizing>
                   <cust_attribute>ROLEASSIGNEMENT</cust_attribute>
                   <cust_index>0000000001</cust_index>
                   <attribute_name>DEFAULT</attribute_name>
                   <attribute_value></attribute_value>
              </customizing>
         </memsd_cust>
    </mobile_component>
    You can see the PLATFORM and the RUNTIME tags here, those should be populated to the corresponding backend tables, I guess.
    Cheers
    stefan

  • Java framework/toolkit for POJO, database persistence and XML

    Hi all,
    I've been wondering if there's a toolkit or framework for developing Java program (could be standalone Java program, EJBs etc.)
    I surfed around casually and found some but there isn't any detailed description of what and how each framework/toolkit does. So I hope to ask around if you've anything that you have used before and would like to point to me to look further.
    Given the huge number of open source toolkits, libraries and frameworks out there, it can be quite confusing as to which one is more suitable for me. Also with Sun's move into JDO and Java Persistence API, things become more messy and complicated - there isn't any clear leader in this area and things are starting to change with the inclusion of JDO which seems to be the future standard persistence API to use.
    So far, I've only worked with Hibernate for database persistence before. So I'm wondering if there're other options such as Hibernate with XDoclet, Castor and Spring framework etc. that can easily transform Plain Old Java Objects (POJO) -- hopefully using Java Reflection w/o using mapping XML files like in Hibernate -- into SQL for database persistence and XML text data and vice-versa. The current problem is that I've been spending tons of time writing code to transform data in Java objects into XML (using my own format) and also doing mapping files for Hibernate.
    I am hoping for something simple like:
    Object o = new Object();
    o.setProperty = "something";
    String xml = o.toXML(); // Convert object to XML text.
    o.save(); // Save to database.
    // The reverse: Parse XML into object and load from database
    Object o = new Object();
    o.fromXML(xml);
    o.load();
    // Properties should be initialized from database or XML.
    Anything similar to this out there?

    Hi,
    Just to share what I've found after surfing a bit more on this issue to promote more discussion on this area.
    For mapping of Java objects to XML, we can try looking more at Castor and JAXB.
    For database persistence to/from Java objects, look at Hibernate and JDO.
    There is this Hydrate project (hydrate.sourceforge.net) that I do not know where it fits in still. But it is supposed to do data transformation and mapping between Java objects, XML and database representation.
    Fyi.

  • Using pojos and jsf

    Hi guys
    I am trying to connect Pojos with jsf. I 've found that the problem is in the ejbs.
    I am using eclipse 3.1.1, jboss-4.0.4RC1 and myfaces.
    I think the application doesn't inicialize the context. Because all class work with servlet. I already have tested it.
    The error shows me
    0:20:29,981 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
    javax.faces.el.EvaluationException: Cannot get value for expression '#{PropiedadesBean.allProperties}'
         at org.apache.myfaces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:397)
         at javax.faces.component.UIData.getValue(UIData.java:779)
         at javax.faces.component.UIData.createDataModel(UIData.java:545)
         at javax.faces.component.UIData.getDataModel(UIData.java:534)
         at javax.faces.component.UIData.getRowCount(UIData.java:103)
         at org.apache.myfaces.renderkit.html.HtmlTableRendererBase.encodeInnerHtml(HtmlTableRendererBase.java:124)
         at org.apache.myfaces.renderkit.html.HtmlTableRendererBase.encodeChildren(HtmlTableRendererBase.java:94)
         at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:319)
         at javax.faces.webapp.UIComponentTag.encodeChildren(UIComponentTag.java:343)
         at javax.faces.webapp.UIComponentTag.doEndTag(UIComponentTag.java:251)
         at org.apache.myfaces.taglib.UIComponentBodyTagBase.doEndTag(UIComponentBodyTagBase.java:55)
         at org.apache.jsp.paginas.propiedades_jsp._jspx_meth_h_dataTable_0(org.apache.jsp.paginas.propiedades_jsp:196)
         at org.apache.jsp.paginas.propiedades_jsp._jspx_meth_h_form_0(org.apache.jsp.paginas.propiedades_jsp:145)
         at org.apache.jsp.paginas.propiedades_jsp._jspx_meth_f_view_0(org.apache.jsp.paginas.propiedades_jsp:113)
         at org.apache.jsp.paginas.propiedades_jsp._jspService(org.apache.jsp.paginas.propiedades_jsp:78)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
         at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
         at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
         at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
         at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:415)
         at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:234)
         at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:352)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:107)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
         at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
         at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
         at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
         at org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:693)
         at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:660)
         at org.apache.jsp.index_jsp._jspService(org.apache.jsp.index_jsp:49)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
         at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
         at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
         at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
         at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:415)
         at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:234)
         at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:352)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:107)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(ExtensionsFilter.java:122)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
         at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:54)
         at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:174)
         at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:868)
         at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:663)
         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
         at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
         at java.lang.Thread.run(Unknown Source)
    Caused by: javax.faces.el.EvaluationException: org.jboss.jose.db.PropiedadesBean
         at org.apache.myfaces.el.PropertyResolverImpl.getValue(PropertyResolverImpl.java:78)
         at org.apache.myfaces.el.ELParserHelper$MyPropertySuffix.evaluate(ELParserHelper.java:532)
         at org.apache.commons.el.ComplexValue.evaluate(ComplexValue.java:145)
         at org.apache.myfaces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:378)
         ... 77 more
    Caused by: javax.faces.el.EvaluationException: Bean: org.jboss.jose.db.PropiedadesBean, property: allProperties
         at org.apache.myfaces.el.PropertyResolverImpl.getProperty(PropertyResolverImpl.java:404)
         at org.apache.myfaces.el.PropertyResolverImpl.getValue(PropertyResolverImpl.java:71)
         ... 80 more
    Caused by: java.lang.reflect.InvocationTargetException
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at org.apache.myfaces.el.PropertyResolverImpl.getProperty(PropertyResolverImpl.java:400)
         ... 81 more
    Caused by: java.lang.NullPointerException
         at org.jboss.jose.db.PropiedadesBean.getAllProperties(PropiedadesBean.java:71)
         ... 86 more
    10:20:30,001 ERROR [[Faces Servlet]] Servlet.service() for servlet Faces Servlet threw exception
    javax.faces.FacesException: Cannot get value for expression '#{PropiedadesBean.allProperties}'
         at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:421)
         at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:234)
         at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:352)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:107)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
         at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
         at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
         at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
         at org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:693)
         at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:660)
         at org.apache.jsp.index_jsp._jspService(org.apache.jsp.index_jsp:49)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
         at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
         at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
         at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
         at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:415)
         at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:234)
         at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:352)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:107)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(ExtensionsFilter.java:122)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
         at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:54)
         at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:174)
         at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:868)
         at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:663)
         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
         at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
         at java.lang.Thread.run(Unknown Source)
    Caused by: org.apache.jasper.JasperException: Cannot get value for expression '#{PropiedadesBean.allProperties}'
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:370)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
         at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
         at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
         at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
         at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:415)
         ... 50 more
    10:20:30,022 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
    javax.faces.FacesException: Cannot get value for expression '#{PropiedadesBean.allProperties}'
         at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:421)
         at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:234)
         at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:352)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:107)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
         at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
         at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
         at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
         at org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:693)
         at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:660)
         at org.apache.jsp.index_jsp._jspService(org.apache.jsp.index_jsp:49)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
         at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
         at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
         at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
         at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:415)
         at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:234)
         at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:352)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:107)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(ExtensionsFilter.java:122)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
         at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:54)
         at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:174)
         at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:868)
         at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:663)
         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
         at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
         at java.lang.Thread.run(Unknown Source)
    Caused by: org.apache.jasper.JasperException: Cannot get value for expression '#{PropiedadesBean.allProperties}'
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:370)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
         at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
         at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
         at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
         at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:415)
         ... 50 more
    10:20:30,032 ERROR [[Faces Servlet]] Servlet.service() for servlet Faces Servlet threw exception
    javax.faces.FacesException: Cannot get value for expression '#{PropiedadesBean.allProperties}'
         at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:421)
         at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:234)
         at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:352)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:107)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(ExtensionsFilter.java:122)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
         at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:54)
         at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:174)
         at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:868)
         at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:663)
         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
         at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
         at java.lang.Thread.run(Unknown Source)
    Caused by: javax.servlet.ServletException: Cannot get value for expression '#{PropiedadesBean.allProperties}'
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:121)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
         at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
         at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
         at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
         at org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:693)
         at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:660)
         at org.apache.jsp.index_jsp._jspService(org.apache.jsp.index_jsp:49)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
         at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
         at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
         at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
         at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:415)
         ... 25 moreMy jsf is that
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
        pageEncoding="ISO-8859-1"%>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>propiedad</title>
    </head>
    <body>
    <f:view>
         <h:form id ="Properties">
              <h:dataTable id ="Propiedades" value="#{PropiedadesBean.allProperties}" var="prop" border="1">
                   <h:column>
                        <f:facet name="header">
                             <h:outputText value="Referencia"></h:outputText>
                        </f:facet>
                        <h:outputText value="#{prop.referencia}"></h:outputText>
                   </h:column>
                   <h:column>
                        <f:facet name="header">
                             <h:outputText value="Habitaciones"></h:outputText>
                        </f:facet>                    
                        <h:outputText value="#{prop.nHabitaciones}"></h:outputText>
                   </h:column>
              </h:dataTable>
         </h:form>
    </f:view>
    </body>
    </html>My bean is that
    import java.io.Serializable;
    import java.util.List;
    import java.util.ArrayList;
    import javax.ejb.Local;
    import javax.ejb.Remote;
    import javax.ejb.Stateless;
    import javax.faces.context.FacesContext;
    import javax.faces.el.ValueBinding;
    import javax.persistence.EntityManager;
    import javax.persistence.PersistenceContext;
    import javax.persistence.Query;
    @Stateless (name="propiedadesLocal")
    public class PropiedadesBean implements LocalPropiedades, Serializable {
         @PersistenceContext (unitName="test")
         private EntityManager em;
         public List <Propiedad> getAllProperties() {
              ArrayList<Propiedad> propiedades = new ArrayList<Propiedad>();
              ValueBinding beanValueBinding = facesContext.getApplication().createValueBinding("#{propiedadesBean.allProperties}");*/
              Query q = em.createQuery("From propiedades");
              for (Object o: q.getResultList()) {
                   propiedades.add((Propiedad) o);
              return propiedades; 
    }this statement doesn't work
    Query q = em.createQuery("From propiedades");
    When I put a checkpoint. I see the em variable is null.
    Here I've got only a function returns a ArrayList. This class implements the business logic.
    My another class implements the pesistence is that.
    package org.jboss.jose.db;
    import javax.persistence.*;
    import java.util.*;
    import java.io.Serializable;
    import javax.persistence.*;
    import javax.persistence.Id;
    @Entity
    @Table(name="propiedades")
    public class Propiedad implements Serializable{
         private int referencia;
         private double precio1;
         private String referenciaCliente;
         private int nHabitaciones;
         private int cuartosDeBa�o;
         private Empleado empleado;
         //static final long serialVersionUID = 1L;;
         public Propiedad(){};
         public int getCuartosDeBa�o() {
              return cuartosDeBa�o;
         public void setCuartosDeBa�o(int cuartosDeBa�o) {
              this.cuartosDeBa�o = cuartosDeBa�o;
         public int getNHabitaciones() {
              return nHabitaciones;
         public void setNHabitaciones(int habitaciones) {
              nHabitaciones = habitaciones;
         public double getPrecio1() {
              return precio1;
         public void setPrecio1(double precio1) {
              this.precio1 = precio1;
         @Id //(generate = GeneratorType.AUTO)
         @GeneratedValue
         @Column (name = "Referencia")     
         public int getReferencia() {
              return referencia;
         public void setReferencia(int referencia) {
              this.referencia = referencia;
         public String getReferenciaCliente() {
              return referenciaCliente;
         public void setReferenciaCliente(String referenciaCliente) {
              this.referenciaCliente = referenciaCliente;
         //@JoinColumn (name = "idEmpleado")
         @ManyToOne
         public Empleado getEmpleado() {
              return empleado;
         public void setEmpleado(Empleado empleado) {
              this.empleado = empleado;
    The servlet that works
    package org.jboss.jose.web;
    import javax.servlet.http.HttpServlet;
    import java.io.IOException;
    import java.io.PrintWriter;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    //import java.io.IOException;
    import org.jboss.jose.db.*;
    //import org.jboss.ejb.PropiedadesBean;
    public class PropiedadServlet extends HttpServlet {
         private LocalPropiedades propiedadesBean;
         private EmpleadosBean empleadosBean;
         protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {          
              this.mostrarPropiedades(req, resp);
         public void init() throws ServletException {
              try {
                   Context context = new InitialContext();
                   this.propiedadesBean = (LocalPropiedades) context.lookup("inmovil/propiedadesLocal/local");
                   this.propiedadesBean.addEmpleadoPropiedad("jose",1,"1",1000.00,"1000",1,1);          
              } catch (NamingException e) {
                   // TODO Auto-generated catch block
                   System.out.println(e.getMessage());
    //               e.printStackTrace();
         private void mostrarPropiedades(HttpServletRequest req, HttpServletResponse resp) throws ServletException ,IOException {
              PrintWriter out = resp.getWriter();
              for (Propiedad prop: this.propiedadesBean.getAllProperties()) {
                   out.p                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            

    I think that I don't load. But I don't know where I write the below line.Than it's clear that you'll get a NullPointerException.
    But I don't know where I write the below line.
    Context context = new InitialContext();
    this.propiedadesBean = (LocalPropiedades)
    context.lookup("inmovil/propiedadesLocal/local");Whenever you need it. For example within an ActionHandler which loads the bean
    and makes a DTO Object (Bean used by the JSF Page) available for the JSF Page.
    But where you actually have to load the Bean depends on your design.
    andi

  • POJOs and createNativeQuery

    We are having lots of complex sql and tonnes of tables in our schema and intend to use JPA(present system is on JDBC). We intend to lower the development time by using the native query support in JPA(createNativeQuery) and reuse the existing SQLs ; so that it plays well with UI which is on ADF.
    So, I have a native query which selects some columns; and i also have a suitable entity(POJO) which maps to the columns that are fetched in the query. Note that the query fetches columns from multiple tables and hence the POJO resembles something like a value object (though in the present parlance its called as an Enitity). All is fine till here.
    Now i need to group by certain columns; how should the result list be now accessed - do i need to create another entity(POJO) which maps to this structure of groupby column name(s) and its respective counts? Is this a fine(and elegant) solution; or can you think of anything else?

    It depends,
    SqlResultSetMapping is cool. But, I think not in your case.
    If you map the values to an entity, the returned entities become managed by the persistence context.
    An entity is a bit more than a single pojo, it must be defined as an entity, and must have an id.
    So you must create entities for all results of your queries, so all result must have an id.
    This is quite limited in JPA.
    so maybe single transformator classes could be better choice.
    if you can use hibernate instead of "standard jpa", you can use resulttranformator, it would be more useful in your case :)

  • Generic Sync Application and Persistence DB2e

    Hi all,
    I have a generic sync application. I need persistence and so, I have created a xml file with many syncbo to manage the persistence with db2e. If I execute the statement before the synchronization:
    SmartSyncRuntime.getInstance().getSyncBoDescriptorFacade().getAllSyncBoDescriptors().size()
    the result is five (because I have five syncbo).
    But when I do a generic synchronization and I try to store data of this synchronization into syncbo, I get an exception because only there is one syncbo.
    In fact, the previous statement returns only one synbo. This syncbo is called MIAUTH and I don´t have defined it.
    How can I solve this issue? Thanks a lot.
    Regards,

    Hi all,
    I know it is better to use persistence API than syncbos in generic sync application but we have many problems with persistence API and SP versions. While SAP solve our problems we are searching any alternative.
    We use MVC and after doing generic synchronization, if the application generates a event and navigate to other jsp and in it, the application generates other event, I get all of my syncbos.
    How could I simulate it, after generic sync finishes, in the same method by code? Any ideas?
    Thanks and Regads.

  • Datasource, POJO and java.sql.Blob

    Hello,
    is "java.sql.Blob" a valid type for a POJO datasource ?
    I declared one but I just dit not succeed in rendering its jpg picture.
    My java code is quite simple :
    ReportClientDocument reportClientDocument = new ReportClientDocument ();
    reportClientDocument.setReportAppServer(ReportClientDocument.inprocConnectionString);
    reportClientDocument.open (REPORT_NAME, OpenReportOptions._openAsReadOnly);
    // lBlob is a class which implements java.sql.Blob interface
    LPOJOData [] dataP = {new LPOJOData(new lBlob("Picture.jpg"))};
    POJOResultSetFactory factory = new POJOResultSetFactory(LPOJOData.class);
    POJOResultSet resultSet = factory.createResultSet(dataP);
    reportClientDocument.getDatabaseController().setDataSource(resultSet, "", "");
    and my POJO class :
    public class LPOJOData {          
              private java.sql.Blob zimage;
              public LPOJOData(java.sql.Blob zp){
                   this.zimage = zp;
              public java.sql.Blob getzimage(){
                   return zimage;
    The field "zimage" on the report is designed through a "field definition only" database, zimage is defined as a Blob field.
    Any clues ?
    Regards,
    Serge

    I have just found a list of the data types supported by a POJO Class :
    # boolean
    # byte
    # char
    # double
    # float
    # int
    # short
    # java.lang.Boolean
    # java.lang.Byte
    # java.lang.Double
    # java.lang.Float
    # java.lang.Integer
    # java.lang.Short
    # java.lang.String
    # java.SQL.Date
    # java.SQL.Time
    Well, java.SQL.Blob is not one of them.
    Is java.SQL_Blob will be a valid POJO type in the future ?
    Is there another way than POJO to feed a report from an in-memory datasource ?

  • Conversion from 10.1.2 to 10.1.3 and persistence Exception

    We are in the process of migrating from ocj 10.1.2 to 10.1.3. We are implementing database replication of HttpSession. During that process we get a stack trace like this. It complains about an object not being able to be serialized. Any suggestions and comments are very welcome.
    thanks
    Sekar

    sorry forgot to include the stack trace
    Internal Exception: java.io.NotSerializableException: common.jsp._setsessionMapping: oracle.toplink.mappings.DirectMapMapping[values]Descriptor: Descriptor(com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.persistence.InternalHttpSessionObject --> [DatabaseTable(OC4J_HTTP_SESSION)])     at oracle.toplink.exceptions.DescriptorException.notSerializable(DescriptorException.java:1169)     at oracle.toplink.mappings.converters.SerializedObjectConverter.convertObjectValueToDataValue(SerializedObjectConverter.java:77)     at oracle.toplink.mappings.DirectCollectionMapping.buildElementClone(DirectCollectionMapping.java:206)     at oracle.toplink.mappings.DirectMapMapping.buildCloneForPartObject(DirectMapMapping.java:116)     at oracle.toplink.internal.indirection.NoIndirectionPolicy.cloneAttribute(NoIndirectionPolicy.java:45)     at oracle.toplink.mappings.ForeignReferenceMapping.buildClone(ForeignReferenceMapping.java:199)     at oracle.toplink.internal.descriptors.ObjectBuilder.populateAttributesForClone(ObjectBuilder.java:2116)     at oracle.toplink.publicinterface.UnitOfWork.cloneAndRegisterNewObject(UnitOfWork.java:674)     at oracle.toplink.publicinterface.UnitOfWork.internalRegisterObject(UnitOfWork.java:2571)     at oracle.toplink.internal.sessions.MergeManager.registerObjectForMergeCloneIntoWorkingCopy(MergeManager.java:821)     at oracle.toplink.internal.sessions.MergeManager.mergeChangesOfCloneIntoWorkingCopy(MergeManager.java:499)     at oracle.toplink.internal.sessions.MergeManager.mergeChanges(MergeManager.java:226)     at oracle.toplink.publicinterface.UnitOfWork.mergeClone(UnitOfWork.java:3050)     at oracle.toplink.publicinterface.UnitOfWork.deepMergeClone(UnitOfWork.java:1439)     at oracle.ias.container.persistence.NonTransactionalInternalPM.writeObject(NonTransactionalInternalPM.java:203)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.PersistenceHttpSession.removeValueFromMap(PersistenceHttpSession.java:239)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.EvermindHttpSession.removeAttribute(EvermindHttpSession.java:232)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.EvermindHttpSession.removeValue(EvermindHttpSession.java:219)     at common.jsp._login._jspService(Unknown Source)     [common/jsp/login.jsp]     at com.orionserver[Oracle Containers for J2EE 10g (10.1.3.0.0) ].http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)     at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:416)     at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:478)     at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:401)     at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:719)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:376)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:870)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:451)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:218)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:119)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)     at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)     at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:230)     at oracle.oc4j.network.ServerSocketAcceptHandler.access$800(ServerSocketAcceptHandler.java:33)     at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:831)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)     at java.lang.Thread.run(Thread.java:595)Caused by: java.io.NotSerializableException: common.jsp._setsession     at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1075)     at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1369)     at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1341)     at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1284)     at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1073)     at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:291)     at oracle.toplink.mappings.converters.SerializedObjectConverter.convertObjectValueToDataValue(SerializedObjectConverter.java:74)

  • Enterprise Services and Persistence

    Hi All,
    One of the useful things about IDocs is that their processing involves 2 steps: 1) persisting the IDoc to a database 2) processing the document. Persisting IDocs is very useful since it allows you to edit and resend them.
    I would like to know if SAP asynchronous Enterprise Services can/do provide persistence as well. Knowing this would help us decide between using IDocs or Enterprise Services in future developments.
    Your help is very much appreciated.
    Cheers
    Gerard

    Dear Gerard
    SAP's asynchronous Enterprise Services uses proxy technology which provides persistence in the local integration engine. It is similar to IDocs, whereby the message data is persisted prior to processing by the application logic.
    Additionally, SAP-delivered Enterprise Services uses Forward Error Handling (FEH) framework to enable error handling capabilities like editing and resending. Together with Error Conflict Handler (ECH) and Post-Processing Office (PPO), this enables capabilities similar to IDoc error handling.
    For more info on FEH/ECH/PPO, you can check the below wiki and blog post
    Error and Conflict Handler (ECH) - ABAP Connectivity - SCN Wiki
    Michal's Tips: SXMB_MONI vs FEH/ECH vs AIF
    I've also blogged about development of custom asynchronous proxies utilizing FEH/ECH/PPO. You can check the blog below for an example of how persistence in the integration engine is, as well as the editing and reprocessing features.
    Custom proxy framework with FEH/ECH
    Rgds
    Eng Swee

  • Help with TableView with POJOs and PropertyValueFactory

    Hi,
    I want to display a POJO without JavaFX Properties in a TableView.
    However, I can't update the cell using a PropertyValueCellFactory.
    It works fine, if I have JavaFX Property. I also tried and implemented PropertyChangeListener support, as it is written in the docs, but it still doesn't work.
    If I implement my own CellValueFactory and add a listener it works.
    Can you help? I guess I forgot something.
    import javafx.application.Application;
    import javafx.beans.property.LongProperty;
    import javafx.beans.property.ObjectProperty;
    import javafx.beans.property.SimpleLongProperty;
    import javafx.beans.property.SimpleObjectProperty;
    import javafx.beans.value.ObservableValue;
    import javafx.collections.FXCollections;
    import javafx.scene.Scene;
    import javafx.scene.control.TableColumn;
    import javafx.scene.control.TableView;
    import javafx.scene.control.cell.PropertyValueFactory;
    import javafx.scene.layout.VBox;
    import javafx.scene.layout.VBoxBuilder;
    import javafx.stage.Stage;
    import javafx.util.Callback;
    import java.beans.PropertyChangeEvent;
    import java.beans.PropertyChangeListener;
    import java.beans.PropertyChangeSupport;
    public class TestApp4 extends Application {
        public static void main(String[] args) {
            launch(args);
        @Override
        public void start(final Stage stage) throws Exception {
            VBox root = new VBox();
            TableView<MyObject> tableView = new TableView<MyObject>();
            TableColumn<MyObject, Number> javafxPropertyColumn = new TableColumn<MyObject, Number>();
            javafxPropertyColumn.setText("JavaFX Property");
            javafxPropertyColumn.setCellValueFactory(new PropertyValueFactory<MyObject, Number>("test1"));
            TableColumn<MyObject, Number> javaBeanColumn = new TableColumn<MyObject, Number>();
            javaBeanColumn.setText("JavaBean");
            javaBeanColumn.setCellValueFactory(new PropertyValueFactory<MyObject, Number>("test2"));
            TableColumn<MyObject, Number> javaBeanColumn2 = new TableColumn<MyObject, Number>();
            javaBeanColumn2.setText("JavaBean2");
            javaBeanColumn2.setCellValueFactory(new Callback<TableColumn.CellDataFeatures<MyObject, Number>, ObservableValue<Number>>() {
                private final ObjectProperty<Number> objectProperty = new SimpleObjectProperty<Number>();
                @Override
                public ObservableValue<Number> call(TableColumn.CellDataFeatures<MyObject, Number> myObjectNumberCellDataFeatures) {
                    myObjectNumberCellDataFeatures.getValue().propertyChangeSupport.addPropertyChangeListener(new PropertyChangeListener() {
                        @Override
                        public void propertyChange(PropertyChangeEvent evt) {
                            System.out.println("PropertyChange: " + evt.getPropertyName());
                            objectProperty.set((Number) evt.getNewValue());
                    return objectProperty;
            tableView.getColumns().add(javafxPropertyColumn);
            tableView.getColumns().add(javaBeanColumn);
            tableView.getColumns().add(javaBeanColumn2);
            final MyObject myObject = new MyObject();
            tableView.setItems(FXCollections.<MyObject>observableArrayList(myObject));
            root.getChildren().add(tableView);
            new Thread(new Runnable() {
                @Override
                public void run() {
                    for (int i = 0; i < 100; i++) {
                        try {
                            Thread.sleep(100);
                        } catch (InterruptedException e) {
                            e.printStackTrace();
                        myObject.test1Property().set(i);
                        myObject.setTest2(i);
            }).start();
            Scene scene = new Scene(VBoxBuilder.create().children(root).build());
            stage.setScene(scene);
            stage.show();
        public class MyObject {
            private PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport(this);
            public MyObject() {
            private LongProperty test1 = new SimpleLongProperty();
            public LongProperty test1Property() {
                return test1;
            private long test2;
            public void setTest2(long test2) {
                if (this.test2 != test2) {
                    propertyChangeSupport.firePropertyChange(new PropertyChangeEvent(this, "test2", this.test2, test2));
                    this.test2 = test2;
            public long getTest2() {
                return test2;
    }

    Hi,
    I want to display a POJO without JavaFX Properties in a TableView.
    However, I can't update the cell using a PropertyValueCellFactory.
    It works fine, if I have JavaFX Property. I also tried and implemented PropertyChangeListener support, as it is written in the docs, but it still doesn't work.
    If I implement my own CellValueFactory and add a listener it works.
    Can you help? I guess I forgot something.
    import javafx.application.Application;
    import javafx.beans.property.LongProperty;
    import javafx.beans.property.ObjectProperty;
    import javafx.beans.property.SimpleLongProperty;
    import javafx.beans.property.SimpleObjectProperty;
    import javafx.beans.value.ObservableValue;
    import javafx.collections.FXCollections;
    import javafx.scene.Scene;
    import javafx.scene.control.TableColumn;
    import javafx.scene.control.TableView;
    import javafx.scene.control.cell.PropertyValueFactory;
    import javafx.scene.layout.VBox;
    import javafx.scene.layout.VBoxBuilder;
    import javafx.stage.Stage;
    import javafx.util.Callback;
    import java.beans.PropertyChangeEvent;
    import java.beans.PropertyChangeListener;
    import java.beans.PropertyChangeSupport;
    public class TestApp4 extends Application {
        public static void main(String[] args) {
            launch(args);
        @Override
        public void start(final Stage stage) throws Exception {
            VBox root = new VBox();
            TableView<MyObject> tableView = new TableView<MyObject>();
            TableColumn<MyObject, Number> javafxPropertyColumn = new TableColumn<MyObject, Number>();
            javafxPropertyColumn.setText("JavaFX Property");
            javafxPropertyColumn.setCellValueFactory(new PropertyValueFactory<MyObject, Number>("test1"));
            TableColumn<MyObject, Number> javaBeanColumn = new TableColumn<MyObject, Number>();
            javaBeanColumn.setText("JavaBean");
            javaBeanColumn.setCellValueFactory(new PropertyValueFactory<MyObject, Number>("test2"));
            TableColumn<MyObject, Number> javaBeanColumn2 = new TableColumn<MyObject, Number>();
            javaBeanColumn2.setText("JavaBean2");
            javaBeanColumn2.setCellValueFactory(new Callback<TableColumn.CellDataFeatures<MyObject, Number>, ObservableValue<Number>>() {
                private final ObjectProperty<Number> objectProperty = new SimpleObjectProperty<Number>();
                @Override
                public ObservableValue<Number> call(TableColumn.CellDataFeatures<MyObject, Number> myObjectNumberCellDataFeatures) {
                    myObjectNumberCellDataFeatures.getValue().propertyChangeSupport.addPropertyChangeListener(new PropertyChangeListener() {
                        @Override
                        public void propertyChange(PropertyChangeEvent evt) {
                            System.out.println("PropertyChange: " + evt.getPropertyName());
                            objectProperty.set((Number) evt.getNewValue());
                    return objectProperty;
            tableView.getColumns().add(javafxPropertyColumn);
            tableView.getColumns().add(javaBeanColumn);
            tableView.getColumns().add(javaBeanColumn2);
            final MyObject myObject = new MyObject();
            tableView.setItems(FXCollections.<MyObject>observableArrayList(myObject));
            root.getChildren().add(tableView);
            new Thread(new Runnable() {
                @Override
                public void run() {
                    for (int i = 0; i < 100; i++) {
                        try {
                            Thread.sleep(100);
                        } catch (InterruptedException e) {
                            e.printStackTrace();
                        myObject.test1Property().set(i);
                        myObject.setTest2(i);
            }).start();
            Scene scene = new Scene(VBoxBuilder.create().children(root).build());
            stage.setScene(scene);
            stage.show();
        public class MyObject {
            private PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport(this);
            public MyObject() {
            private LongProperty test1 = new SimpleLongProperty();
            public LongProperty test1Property() {
                return test1;
            private long test2;
            public void setTest2(long test2) {
                if (this.test2 != test2) {
                    propertyChangeSupport.firePropertyChange(new PropertyChangeEvent(this, "test2", this.test2, test2));
                    this.test2 = test2;
            public long getTest2() {
                return test2;
    }

  • UML, associations and persistence of data

    Well, while studying UML (just started) I came across the following problem. I think it's something that has a very simple answer for someone with a medium knowledge of UML and OO.
    So, suppose I want to model an Employee-Company class association. Each employee works for 1 company, and, of course, a Company has 1..* Employees. If I model this simple class association using a UML tool the following Java code is generated.
    public class Employee {
        public Company company;
    public class Company {
        public java.util.Collection employee = new java.util.TreeSet();
    }Of course in a real scenario, the association between a Company and its Employees should be persistent, with Employees residing on a DB. I have seen a lot of such examples (i.e. School-Student, Gym-Customer.....).
    What's the way to really implement such things?
    Generally speaking how are class associations with a "more than 1" multiplicity at one of the ends of the relationship implemented?
    Thanks in advance.

    cleanzero wrote:
    yawmark wrote:
    cleanzero wrote:
    Ok, so suppose that we all agree, without entering into specific details, that a DB is needed, in terms of UML how is this represented?In what, a class or sequence diagram? It isn't. The class (or object) that interacts with the database, however, could be.
    ~At class level. Is it, as I've done, a Employee * <-> 1 Company association?That's one way. It all depends on your problem. Sounds like that is correct for your case.
    Your object model for the business process doesn't have to know or care whether or not objects persist. Get the classes, relationships, and sequences right first. Persistence can be added later.
    %

  • Integrating Flex and Persistence Layer like Hibernate3

    How we can integrate Flex with any Persistence layer like
    Hibernate 3 ?
    any link, resource ?

    Hibernate is an open source implementation of the Java
    Persistence spec. Though it preceded JPA, and in fact influenced
    the final design, it has been retrofitted to implement the full
    spec (along with some extensions that I won't cover here).
    Hibernate is one of several implementations available, but because
    it is complete, mature, and freely available. Much like JDBC, if
    you stick to the spec and don't use any of Hibernate's extensions,
    you will be able to switch implementations as your needs change in
    the future.

  • Navigation through a new role and persistence of user properties

    Hi there,
    I have a question related to roles and user-experience in the SAP Enterprise Portal.
    Depending on the preference of the portal user I would like to offer a different navigation by assiging a new role to the user.
    For example initially a role offers the navigation show below:
    Role 1:
    Toplevel navigation:     Entry A        Entry B     Entry C
    After a user request for a different navigation the order of the toplevel navigation changes.
    Role 2:
    Toplevel navigation:    Entry B     Entry C    Entry A     
    In order to realize this, I created two worksets for Entry A. By using merge-ids and a difference in sorting I managed to move the Entry A to the end of the toplevel navigation bar after assiging role 2.
    However I noticed that iView properties set by the portal users under role1 are lost after assigning the role2. Is there any way a user can keep the properties set under a previous role when getting assigned to a new role that has the same page?
    Thanks in advance,
    Arko

    FacesContext context = FacesContext.getCurrentInstance();
    context.getApplication().getNavigationHandler().handleNavigation(context,
    null,
    "<<NAVIGATION STRING>>");
    Thanks,
    Navaneeth

  • Custom JTable cell editors and persistence

    I have a JTable with an underlying data model (an extension of AbstractTableModel) that uses custom cell editors in the last column. The cell editor in that column, for a given row, depends on the value selected in another column of the same row. The cell editors include text, date, list, and tree editors (the last one in a separate dialogue). The number of rows is changeable.
    I have need to persist the data for a populated table from time to time, for restoration later on. I've achieved that, such that the data model is recreated, the table appears correct, and the appropriate cell editors activated (by creating new instances of the editors' classes).
    However, my problem is that the (custom) cell editors do not reflect the data in the model when editing mode is begun the first time after restoration. Eg. the text editor is always empty, the list editor shows the first item, and no node is selected in the tree editor.
    If I've restored the model correctly, should the editors properly reflect the underlying data when they are set to editing mode?
    I suspected not, and thus tried to explicitly 'set' the correct values immediately after each editor is recreated ... but to no avail.
    Does anyone have any thoughts, or experience with something similar? I'm happy to supply code.

    You can use html tags within Swing, so I think you can do the following:
    * MyRenderer.java
    * Created on 26 April 2007, 10:27
    * To change this template, choose Tools | Template Manager
    * and open the template in the editor.
    package newpackage;
    import java.awt.Component;
    import javax.swing.JLabel;
    import javax.swing.JTable;
    import javax.swing.SwingConstants;
    import javax.swing.table.TableCellRenderer;
    * @author CS781RJ
    public class MyRenderer extends JLabel implements TableCellRenderer
        public MyRenderer()
            setHorizontalTextPosition(SwingConstants.RIGHT);
            setIconTextGap(3);
            setOpaque(true);
        public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean cellHasFocus, int row, int column)
            if (isSelected)
                setBackground(table.getSelectionBackground());
                setForeground(table.getSelectionForeground());
            else
                setBackground(table.getBackground());
                setForeground(table.getForeground());
            if (value instanceof String)
                if ((value != null) && (value.toString().length() > 0))
                    System.out.println("Value: " + value.toString());
                    setFont(new java.awt.Font("Tahoma", 0, 11));
                    setText("<html>" + value.toString().replaceAll("\n", "<br>") + "</html>");
            return this;
    }In the class that has the JTable, use the code AFTER declaring the values, columns, etc:
    jTable1.getColumnModel().getColumn(0).setCellRenderer(new MyRenderer());
    jTable1.setValueAt("Riz\nJavaid", 0, 0);One thing I haven't done is to resize the cell heights, make sure this is done.
    Hope this helps
    Riz

  • POJOs and posting to a Message Broker Channel

    Hi!
    What we need is to let a JCA Connector publish a message to a Message Broker (MB) Channel. (The messages are subsequentliy picked up by a JPD process.)
    One solution is to let te JCA connector send an JMS message, which is translated to a MB message by a JMSEventGenerator. But we don't want the overhead of JMS.
    Is it possible for a JCA connector to publish a message directly on a MB Channel? Is there some kind of API avaiable for this?
    Thanks in advance :-)
    Anders

    I am having a simialr problem here. I have more then one jpd's(workflows). Now if due to some business logic, one of them is publishing an xml into a Message Broker Queue. This message needs to be subscribed globally(at start node) by other workflows. As per my understanding, this can be done by 'Add Message path'.But i am not able to subscribe to the queue. I have added a control for Subscribing it but the 'add message path' requires a start event and i cannot subscribe using onMessage(data) method of subscribe control as we first need to call the subscribe() method of the control.
    So is there a way by which I can globally publish to a queue and fetch the data(xml) from a queue and do further processing in all the workflows.

Maybe you are looking for