Search Results

Search found 222 results on 9 pages for 'pojo'.

Page 5/9 | < Previous Page | 1 2 3 4 5 6 7 8 9  | Next Page >

  • Example of persisting an inheritance relationship using ORM

    - by Schemer
    I have some experience with OOP and RDBs, but very little exposure to web programming. I am trying to understand what non-trivial types of problems are solved by ORM. Of course, I am familiar with the need for data persistence, but I have never encountered a need for persisting relationships between objects, a situation which is indicated in many online articles about ORM. I am not asking about the process of persisting a POJO to a database and restoring it later. Nor am I asking about why ORM frameworks are useful -- or a pain in the butt -- for doing so. I am particularly interested in how the need arises to persist and restore relationships between objects. In various documentation, I have seen many examples of persisting POJOs to a database, but the examples have all been for only very simple objects that are essentially nothing more than records anyway: a constructor, some private fields, and getter/setter methods. The motivation for persisting such an "object-record" seems obvious and trivial. This example: Hibernate ORM Tutorial offers such an example, but goes on to discuss mismatch issues of granularity, inheritance, identity, associations, and navigation that are not motivated by the example. If someone could offer a toy example of an instance where, say, the need arises to persist an inheritance relationship, I would be grateful. This might be blindingly obvious for anyone who has already encountered this situation but I have not and a great deal of searching and reading have not turned up any examples.

    Read the article

  • Java Virtual Developer Day Session Videos Available

    - by Tori Wieldt
    How are Lambdas handled on a bytecode level? How does replacing assembly code with Java code improve performance? Can we send flat files/comma separated/XML files to process in Batch? In a Java EE app, can I inject an EJB bean inside a REST POJO using @EJB annotation? Where I can find JavaFX UI controls? At OTN's Virtual Developer Day, Java experts answered these questions and more. Session are now available for you to view on demand (registration required). This is limited time offer: the sessions will be up to view for free for the next two weeks.  You can view sessions from these tracks: Java SE 8 Track Learn about the features scheduled for Java SE 8, including Lambda expressions, extension methods for interfaces and a new Date and Time API. Learn how to create basic apps with JavaFX.  Java EE Track Take a close look at the new functionality in Java EE 7. Get presentations and demos on JSON, WebSockets, Batch, Concurrency, JAX-RS 2, JMS 2,  Java Embedded Track Provides an introductions to the Raspberry Pi, the Keil board, ARM architecture, and how to make it all work with Java Embedded. You know Java, now really know Java. Check out the OTN Virtual Developer Day sessions!

    Read the article

  • Java EE 6????????????????! ??????????????????????J2EE??????????J2EE??????JavaOne Tokyo 2012?????

    - by ??? 03
    Java EE???????Java EE???????????????·????????????Core J2EE Patterns(J2EE????)?????????????????????10???????????????? “????????????”?????????????Java EE??????6?????????WebLogic Server?????????????·???????????????J2EE???????????????????????????????2012?4???????JavaOne Tokyo 2012??????????Java EE 6???J2EE???????????????? ???????????????????????????????J2EE????????????????????Java EE 6??????J2EE???????????????(???)? J2EE???????????3???????????J2EE(J2EE 1.4???Java EE)????????????????????????????????????????J2EE???????????J2EE?????????????????????????????????????????????????????????????????J2EE?????????????·?????????????????????????Core J2EE Patterns??????? ??J2EE?????????10?????????????????????????????Java EE???????????????????????????????????????????????????J2EE?????????????????????/???????????????????????????????J2EE????????????????????3??????????? ?????? ?????????????? ???????????????????1?????????????Java EE 6????????EJB 3.1?JPA(Java Persistence API) 2.0?CDI(Contexts and Dependency Injection) 1.0????????????????????2???????????·????????????????????·?????Java EE????????????????????????3???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????(??)???????????????????????????????(???) Anemic?“??DOM”??????????????????????????????DOM????????????????????Java EE??????????????????????????????·?????????DOM(Domain Object Model)????????????????????? ?????????·???????????????????????????????????????Anemic(??)???DOM?????????????????????????????????????????????????????????????????????????????????Anemic?DOM??????????????????????????????????????????????????????·????????????????Java EE 6??????????????????????????DOM????????????????????????????????????????????????????????????????·???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????DOM??????????????????????????????/????????????????????????????????????????????DOM?????????????DOM?Java EE????????????????????????????(???) ???DOM??????????J2EE???Java EE 6??????????????????????????J2EE??????????????????????Anemic???DOM?????????????????????????DOM???????DAO(Data Access Object)?????????????????????????????????DOM???????????????DOM?????????????????????????????????????????????????????????Java EE???Java EE 6??????JPA 2.0????????????DOM??????????????????????????????DOM????????????????????? ???JPA???????????????????????Java EE????J2EE?????????????????Java EE???????????????????????Java EE????????????DOM?????????????????????????????????????????????????????DOM?????????????????????Java EE???????????????????????????(???)????????????3???????????? ?????????????? ????????????? ????? ?????????????????10????????????J2EE?????????????????????????????????????????????????????????????????Session Fac,ade?Application Service?Business Object(Composite Entity)???????????????Transfer Object?Value List Handler?????????????????????????????????????????????????????????????????????Java EE???????????????????????????????????Business Delegate?Service Locator??????????????Java EE??????????????? Session Fac,ade??????????????????????????????????????????????????????????????Session Fac,ade????????Application Service?Business Object????????????????????????????????Java EE 6???????????????(????)??????????????????Session Fac,ade???????????????????·?????????????????????????????????Application Service?????????????????????·????????????????????????Business Object??????????·?????????POJO??????????????????????????????????????????????????????????????????? J2EE??????????????Java EE 6???????????????????????????????????????Java EE???DAO?Domain Store?????????????Service Activator?Web Service Broker???API??????????????????? ????DAO?????·???????????????????????????????????????????1???????????????·???????????????????????????????????????????????????????????????????????(????)?????????????????????????????????DAO??????????EntityManager???????????????????????????????????DAO?????????????????????????????????????????????????????????????Criteria Object????????????????????????DAO??????????????????????DAO?????????????????? ???Service Activator????????????????????????????????????????????????JMS(Java Message Service)?MDB(Message Driven Bean)????????????????Java EE 6??????EJB 3.1????Session Bean?????·????????????@Asynchronous?????????????????????????????????Future?????????????????????????????????????????Java EE 6?????????????????????Service Activator????????????????? ????????·?????????????????????????????????????????????MDB?????????????????????????????????@Asynchronous?????????SLA????????????????????????????????????????????????????????? ??????????????Web???????????????????????????????????????????JSF(Java Server Faces)?????????????????????JSF???????????????????Intercepting Filter??????????????????????????????????JSF???????????? ??????????J2EE???????????????????????????Java EE?????????????????????????????????????Session Fac,ade?Business Object????Application Service??????????????????????????????????????????????Java EE??????????????????????????????????????????????????????????????????????????????????????????????????????????????

    Read the article

  • Java EE 6???????????WebLogic Server 12c????

    - by ???02
    Java EE 6?Java SE 7?????????200??????????/???????WebLogic Server 12c??????????????????????????????????????????????????????????????? ?????2??????WebLogic Server 12c???/??????????????????????????????????????????????????????????(???) Eclipse?NetBeans?JDeveloper????IDE?????????? WebLogic Server 12c????????????????????????? Fusion Middleware?????? ????????? Cloud Application Foundation???????? ???????????????????? WebLogic Server 12c????????????????????????/??????????????POJO???????·??????????XML???????????Java EE 6???????????????????WebLogic Server 12c??????????????????????????????? 1????????????????????????????????????????????????NetBeans IDE???Eclipse???Oracle Enterprise Pack for Eclipse 12c????????????Oracle JDeveloper??IDE???????????(JDeveloper???Java EE 6?????)? ???Oracle Enterprise Pack for Eclipse 12c??????????Eclipse????????????Eclipse????????Java EE 6???????????????????????????????Java SE 7????????????????????????Eclipse????WebLogic Server 12c??????Java EE?????????????????? JRockit Mission Control?Eclipse??????? WebLogic Server????????????????????????/??????Oracle JRockit Mission Control (JRMC) 4.1?????????????WebLogic Server 12c????????JRMC???????????????OutOfMemory????????????????????????????????????????????????????????????????????????4.1??????Mac OS X?Solaris?????HotSpot/Solaris?DTrace???????????????????????????????? ????WebLogic Server 12c?????JRMC ?Eclipse??????????????????Eclipse??JRMC????????????????????????????Eclipse?????????????????????????????????????????????????? Maven??????????????????? ????????????????????Apache Maven????????????????????????????????Maven??????????????????????????????????????????????????????????????????????? WebLogic Server???????Maven???????????????WebLogic Server???????????????????????????????????/??/??/?????????Maven??????????? ????????WebLogic Server 12c????????????ZIP????????????????WebLogic Server????????WebLogic????????WebLogic Server?????????/???????????????????????????Maven?????????????????????????????????????????????? ???168MB?ZIP??????????????????????????? ???????Maven???????????????????????????????????ZIP????????????????? ZIP?????????????????????WebLogic Server????????????????WebLogic Server ?????ZIP?????????????????????WebLogic Server?????????????????????????????????????????? ???WebLogic Server 12c??ZIP????????????????168MB??????????????????USB?????????????????????????????? ??ZIP????????????Maven??????????????????????????????????????????????????????????????Maven???????????????????????????????WebLogic Server??????????????????????Maven?????????????????ZIP????????????????????????????????????????? ????????????????????·????????? WebLogic Server 12c???????????????????????????????????????????????????????????·?????????(CAT:Classloader Analysis Tool)?????????? ???Java EE?????Struts?Spring Framework????????????·?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? ??????????????????????CAT????CAT??????????????????????????WebLogic Server????????????????????????????????????/??????????????????????/??????????????????????????????????CAT? “?????”?????????WebLogic Server?????????????? ??????WebLogic Server 12c?????????????????????????????????Java EE???????????????????????????????????????????WebLogic Server 12c???/???????????????????

    Read the article

  • ??????????????·???????????????Java EE 6??????????WebLogic Server 12c Forum 2012?????

    - by ???02
    ????????IT?????????????????????????????????????????????????·??????????????????????????????????????“??????”?????????????????????????????????????????????????????????????????????????????????????2009????????Java EE 6??2012?8????????WebLogic Server 12c Forum 2012??????????????????·???????????????????????Java EE 6????????????·??????????????????????(???) ??????????Java EE 6??? 2009???????????WebLogic Server 12c???????????????·????????????????Java EE 6??????????????Java EE 6????????Java EE 6??????????????????????????????? ???????????????????????????????????·???????Java EE 6?????????????????????????2012?8???????????WebLogic Server 12c Forum 2012????????UFJ??????NEC???????????????????????????????????????Java EE 6????????????????2?????????????????Java EE 6????????? Java EE 6??Java EE??????????????????? ????????????Java EE??????????????????????·??????????????????????????????????????J2EE 1.4?????????????????????????????????????????+COBOL???????????????·??????·????????????????????????Java EE???????????·????????????????????Java EE??????????????·??????????????????????? ???????J2EE 1.4???????????????????????·???????????????????????????????????????????????????????????(Ease of Development)???????????Java EE??????????????????????????????????????????????????WebLogic Server 12c Forum 2012????????????(???????????????? ???????)?????????????? ????????????????????? ???????????????????????? ?????????????????? ???·???????????????????????????????????????????????·?????????????????????????????????????????Java EE????????????????????????????????????????????????????????????????????????????????/???????????API????????????????????????????????????????????????????????????Java EE???????????·???????????????????????? ??????????????????????????????????????Java EE?????/??????????????????????????????“????????”????????????????????2003??????Java EE 5????Java EE 5????????????????????????????????JSF(JSF 1.2)?????????????POJO???????·?????????????DI(Dependency Injection)????????EJB 3.0??O/R?????????????????????·????????????JPA(JPA 1.0)????????????????Java EE????????????????????????? ??Java EE 5?????????????????????????????????????????Java EE 5???????????????????WebLogic Server 12c Forum 2012?????????UFJ???????????????????????????????????????????·??????????????????????????????????????????JSF?????·???????EJB?????????????JPA??????Java EE 5???????????????????????????????????????????????? ????Java EE 5????????????????2009????????Java EE 6??Java EE 5????????????????Java EE 6?????????????????? ?Java EE 5???DI/AOP?????????????????????????????EJB?????????DI?????????EJB???????????????????????????????Java EE 6??CDI(Contexts and Dependency Injection)???????????????????DI/AOP????????? ?JSF 1.2????????·?????AJAX???????????????????????????????????·?????AJAX??????????????????????????????????Java EE 6?JSF(JSF 2.0)????????·????(Facelets)?AJAX????????????????????????????????? ?JPA 1.0????????Criteria????????·??????·???????????????????????????????O/R?????·????????????????????Java EE 6?JPA(JPA 2.0)????????Criteria?????????????·????????????????????·?????????? ??????????????????????Java EE????????????????????????????? ???????·?????Java EE 6????? ????????????????????????????????????????Java EE 6????????????Java EE???????????????????????????????????????WebLogic Server 12c Forum 2012?????NEC?????(??????????? ??)????? ???????NEC??SystemDirector Enterprise(SystemDirector Enterprise for Java????SDE)????????????????????????????Java EE????????????????NEC????????????????????????????/???????????·????????????????????????????????????????????????SDE??????????? ?????????????????????????????????????????????????????????????????????·???????????????????????????????Java EE??????????????????????????????????????????????????????????????????????????????????????? ?????????????????????????Java EE 6?????????????SDE????????2011??WebLogic Server 10g?????????·??????????????Java EE 6?????????????????????????????????????????????????????2012??Java EE 6?????WebLogic Server 12c??????????????????Java EE 6??????????·????????????Java EE 6????????????????????????????????????

    Read the article

  • Facelet selectOneMenu with POJOs and converter problem

    - by c0d3x
    Hi, I want to have a facelet page with a formular and a dropdown menu. With the dropdown menu the user shoul select a POJO of the type Lieferant: public class Lieferant extends AbstractPersistentWarenwirtschaftsObject { private String firma; public Lieferant(WarenwirtschaftDatabaseLayer database, String firma) { this(database, null, firma); } public Lieferant(WarenwirtschaftDatabaseLayer database, Long primaryKey, String firma) { super(database, primaryKey); this.firma = firma; } public String getFirma() { return firma; } @Override public String toString() { return getFirma(); } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((firma == null) ? 0 : firma.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Lieferant other = (Lieferant) obj; if (firma == null) { if (other.firma != null) return false; } else if (!firma.equals(other.firma)) return false; return true; } } Here is the facelet code that I wrote: <h:selectOneMenu> tag. This tag should display a list of POJOs (not beans) of the type Lieferant. Here is the facelet code: <h:selectOneMenu id="lieferant" value="#{lieferantenBestellungBackingBean.lieferant}"> <f:selectItems var="lieferant" value="#{lieferantenBackingBean.lieferanten}" itemLabel="#{lieferant.firma}" itemValue="#{lieferant.primaryKey}" /> <f:converter converterId="LieferantConverter" /> </h:selectOneMenu> Here is the refenrenced managed backing bean @ManagedBean @RequestScoped public class LieferantenBackingBean extends AbstractWarenwirtschaftsBackingBean { private List<Lieferant> lieferanten; public List<Lieferant> getLieferanten() { if (lieferanten == null) { lieferanten = getApplication().getLieferanten(); } return lieferanten; } } As far as I know, I need a custom converter, to swap beetween POJO and String representations of the Lieferant objects. Here is what the converter looks like: @FacesConverter(value="LieferantConverter") public class LieferantConverter implements Converter { @Override public Object getAsObject(FacesContext context, UIComponent component, String value) { long primaryKey = Long.parseLong(value); WarenwirtschaftApplicationLayer application = WarenwirtschaftApplication.getInstance(); Lieferant lieferant = application.getLieferant(primaryKey); return lieferant; } @Override public String getAsString(FacesContext context, UIComponent component, Object value) { return value.toString(); } } The page loads without any error. When I fill out the formular and submit it, there is an error message displayed on the page: Bestellung:lieferantenBestellungForm:lieferant: Validierungsfehler: Wert ist keine gültige Auswahl translated: validation error: value is not a valid selection Unfortunaltely it does not say which value it is talking about. The converter seems to work correctly. I found this similar question from stackoverflow and this article about selectOneMenu and converters, but I was not able to find the problem in my code. Why is List<SelectItem> used in the example from the second link. Gives the same error for me. Any help would be appreciated. Thanks in advance.

    Read the article

  • Call a web service and parse xml response in blackberry

    - by Nirmal
    Hello All... Currently I have a ready design for blackberry application. Now, I need to call the web service in my app, and that web service will give me some xml response. So, I need to parse that response from xml to some POJO. So, for parsing the xml response should I go with the basic DOM praser, or should I use any other J2ME specific prasing concept ? If anybody have any sample tutorial link for the same then it would be very much useful to me. Thanks in advance....

    Read the article

  • Could not initialize proxy - No Session again

    - by Iapilgrim
    Hi I get these error log when viewing a page ERROR [TP-Processor11] (LazyInitializationException.java:42) - could not initialize proxy - no Session org.hibernate.LazyInitializationException: could not initialize proxy - no Session at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:132) at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:174) at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:190) at org.osmoz.contents.model.enm.ContentType_$$_javassist_71.getDefaultShortMode(ContentType_$$_javassist_71.java) at org.osmoz.contents.web.tapestry.components.EnmContentZone.getTemplate(EnmContentZone.java:67) at org.osmoz.contents.web.tapestry.base.AbstractRawContentZone.getContent(AbstractRawContentZone.java:67) at $PropertyConduit_1276091af82.get($PropertyConduit_1276091af82.java) at org.apache.tapestry5.internal.bindings.PropBinding.get(PropBinding.java:58) at org.apache.tapestry5.internal.structure.InternalComponentResourcesImpl$1.read(InternalComponentResourcesImpl.java:510) at org.apache.tapestry5.internal.structure.InternalComponentResourcesImpl$1.read(InternalComponentResourcesImpl.java:496) at org.apache.tapestry5.corelib.components.OutputRaw._$read_parameter_value(OutputRaw.java) at org.apache.tapestry5.corelib.components.OutputRaw.beginRender(OutputRaw.java:43) at org.apache.tapestry5.corelib.components.OutputRaw.beginRender(OutputRaw.java) at I know the problem is Session has been closed. But I really don't know why this error occur not so often that why I don't know the root cause is. Enviroment: Tapestry5, JPA, Hibernate 3.3.2.GA I've set <filter-class>org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter</filter-class> in web.xml also

    Read the article

  • How to learn high-level Java web development concepts

    - by titaniumdecoy
    I have some experience writing web applications in Java for class projects. My first project used Servlets and my second, the Stripes framework. However, I feel that I am missing the greater picture of Java web development. I don't really understand the web.xml and context.xml files. I'm not sure what constitutes a Java EE application as opposed to a generic Java web application. I can't figure out how a bean is different from an ordinary Java class (POJO?) and how that differs from an Enterprise Java Bean (EJB). These are just the first few questions I could think of, but there are many more. What is a good way to learn how Java web applications function from the top down rather than simply how to develop an application with a specific framework? (Is there a book for this sort of thing?) Ultimately, I would like to understand Java web applications well enough to write my own framework.

    Read the article

  • XStream <-> Alternative binary formats (e.g. protocol buffers)

    - by sehugg
    We currently use XStream for encoding our web service inputs/outputs in XML. However we are considering switching to a binary format with code generator for multiple languages (protobuf, Thrift, Hessian, etc) to make supporting new clients easier and less reliant on hand-coding (also to better support our message formats which include binary data). However most of our objects on the server are POJOs with XStream handling the serialization via reflection and annotations, and most of these libraries assume they will be generating the POJOs themselves. I can think of a few ways to interface an alternative library: Write an XStream marshaler for the target format. Write custom code to marshal the POJOs to/from the classes generated by the alternative library. Subclass the generated classes to implement the POJO logic. May require some rewriting. (Also did I mention we want to use Terracotta?) Use another library that supports both reflection (like XStream) and code generation. However I'm not sure which serialization library would be best suited to the above techniques.

    Read the article

  • csutom converter in XStream

    - by Raja Chandra Rangineni
    Hi All, I am using XStream to serialize my Objects to XML format. The formatted xml that I get is as below: node1, node2, node 3 are attributes of pojo,DetailDollars 100 25 10 I have requirement where in I have to calucluate a percentage, for example 100/ 25 and add the new node to the existing ones. So, the final output should be : 100 25 10 4 I wrote a custom converter and registered to my xstream object. public void marshal(..){ writer.startNode("node4"); writer.setValue(getNode1()/ getnode2() ); writer.endNode(); } But, the xml stream I get has only the new node: 4 I am not sure which xstream api would get me the desired format. could you please help me with this . Thanks, Raja chandra Rangineni.

    Read the article

  • Error : java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.<init>(I)V

    - by Hitesh Solanki
    Hiii.... I am developing small spring application. I have to store the details of the student information in the database. I have develop one simpleformcontroller.I have used netbeans + hibernate mapping + spring. when I deploy the project,the following errors is occured. please help me.. Thanks in advance..... My spring-config-db-applicationContext.xml is shown below: <?xml version="1.0" encoding="UTF-8"?> ${driverClassName} ${url} ${username} ${password} WEB-INF/classes/hibernate.cfg.xml -- hibernate.cfg.xml org.hibernate.cfg.AnnotationConfiguration -- <property name="hibernateProperties"> <props> <prop key="hibernate.dialect">${dialect}</prop> <prop key="hibernate.show_sql">true</prop> <!--<prop key="hibernate.hbm2ddl.auto">create</prop>--> </props> </property> </bean> Following error is occured: ERROR (org.springframework.web.context.ContextLoader:213) - Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in URL [jndi:/localhost/Student/WEB-INF/classes/config/spring-db-applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.(I)V at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1395) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:512) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:289) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:286) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:188) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:526) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:730) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:387) at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:270) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4342) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525) at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:627) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:511) at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1231) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:297) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836) at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761) at org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1471) at org.apache.catalina.manager.ManagerServlet.deploy(ManagerServlet.java:824) at org.apache.catalina.manager.ManagerServlet.doGet(ManagerServlet.java:350) at javax.servlet.http.HttpServlet.service(HttpServlet.java:617) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:196) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Thread.java:619) Caused by: java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.(I)V at net.sf.cglib.core.DebuggingClassWriter.(DebuggingClassWriter.java:47) at net.sf.cglib.core.DefaultGeneratorStrategy.getClassWriter(DefaultGeneratorStrategy.java:30) at net.sf.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:24) at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:216) at net.sf.cglib.core.KeyFactory$Generator.create(KeyFactory.java:144) at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:116) at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:108) at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:104) at net.sf.cglib.proxy.Enhancer.(Enhancer.java:69) at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.getProxyFactory(CGLIBLazyInitializer.java:117) at org.hibernate.proxy.pojo.cglib.CGLIBProxyFactory.postInstantiate(CGLIBProxyFactory.java:43) at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactory(PojoEntityTuplizer.java:162) at org.hibernate.tuple.entity.AbstractEntityTuplizer.(AbstractEntityTuplizer.java:135) at org.hibernate.tuple.entity.PojoEntityTuplizer.(PojoEntityTuplizer.java:55) at org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping.(EntityEntityModeToTuplizerMapping.java:56) at org.hibernate.tuple.entity.EntityMetamodel.(EntityMetamodel.java:302) at org.hibernate.persister.entity.AbstractEntityPersister.(AbstractEntityPersister.java:434) at org.hibernate.persister.entity.SingleTableEntityPersister.(SingleTableEntityPersister.java:108) at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:61) at org.hibernate.impl.SessionFactoryImpl.(SessionFactoryImpl.java:238) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1304) at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:813) at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:731) at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1454) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1392) ... 48 more Mar 12, 2010 5:32:28 PM org.apache.catalina.core.StandardContext start SEVERE: Error listenerStart

    Read the article

  • Using OpenSessionInViewInterceptor with Hibernate and JSF 2

    - by sammy
    I'm building an application in Hibernate, Spring and JSF2 using only annotations. How can I take advantage of OpenSessionInViewInterceptor found in Spring to catch any hibernate session that might open within a bean? I'm trying to elegantly solve the common “failed to lazily initialize a collection of role: your.Class.assocation no session or session was closed.” problem when trying to read from a yet uninitialized list of POJOs inside another POJO (A Tag entity retrieved by a DAO that contains a List of Project objects I want to read). I've found this: http://www.paulcodding.com/blog/2008/01/21/using-the-opensessioninviewinterceptor-for-spring-hibernate3/ but failed to make use of it in my environment. Please provide a detailed answer, as the Internet is full of foggy, unhelpful tutorials. I'll also be greatful for an alternative solution, given a step-by-step instruction is provided.

    Read the article

  • Best Persistence API for use with GWT

    - by KevMo
    What is the best persistence API for use with GWT? Sadly, the application will be hosted on my own java server, as I will need more control than GAE will give me. I know I will need to have two sets of my entities, one for the server side, and some pojo's for the client side. I'm looking to make the mapping of the data as simple as possible between the two, but these will be deeply nested objects so it has to be robust. I was looking at Dozer for my mapping needs. Previously I've used EJB3 with TopLink, so that's very familiar to me, but I would like to get community input on what other API's work well with Dozer and GWT.

    Read the article

  • custom converter in XStream

    - by Raja Chandra Rangineni
    Hi All, I am using XStream to serialize my Objects to XML format. The formatted xml that I get is as below: node1, node2, node 3 are attributes of pojo,DetailDollars DetailDollars node1 100 /node1 node2 25 /node2 node3 10 /node3 /DetailDollars I have requirement where in I have to calucluate a percentage, for example 100/ 25 and add the new node to the existing ones. So, the final output should be : DetailDollars node1 100 /node1 node2 25 /node2 node3 10 /node3 node4 4 /node4 DetailDollars I wrote a custom converter and registered to my xstream object. public void marshal(..){ writer.startNode("node4"); writer.setValue(getNode1()/ getnode2() ); writer.endNode(); } But, the xml stream I get has only the new node: DetailDollars node4 4 /node4 /DetailDollars I am not sure which xstream api would get me the desired format. could you please help me with this . Thanks, Raja chandra Rangineni.

    Read the article

  • How to make Spring accept fluent (non-void) setters?

    - by Chris
    Hi, I have an API which I am turning into an internal DSL. As such, most methods in my PoJos return a reference to this so that I can chain methods together declaratively as such (syntactic sugar). myComponent .setID("MyId") .setProperty("One") .setProperty2("Two") .setAssociation(anotherComponent) .execute(); My API does not depend on Spring but I wish to make it 'Spring-Friendly' by being PoJo friendly with zero argument constructors, getters and setters. The problem is that Spring seems to not detect my setter methods when I have a non-void return type. The return type of this is very convenient when chaining together my commands so I don't want to destroy my programmatic API just be to compatible with Spring injection. Is there a setting in Spring to allow me to use non-void setters? Chris

    Read the article

  • How to make Spring accept non-void setters?

    - by Chris
    Hi, I have an API which I am turning into an internal DSL. As such, most methods in my PoJos return a reference to this so that I can chain methods together declaratively as such (syntactic sugar). myComponent .setID("MyId") .setProperty("One","1") .setProperty("Two","2") .setAssociation(anotherComponent) .execute(); My API does not depend on Spring but I wish to make it 'Spring-Friendly' by being PoJo friendly with zero argument constructors, getters and setters. The problem is that Spring seems to not detect my setter methods when I have a non-void return type. The return type of this is very convenient when chaining together my commands so I don't want to destroy my programmatic API just be to compatible with Spring injection. Is there a setting in Spring to allow me to use non-void setters? Chris

    Read the article

  • Use of Java constructors in persistent entities

    - by Mr Morgan
    Hello I'm new to JPA and using persistence in Java anyway and I have two questions I can't quite work out: I have generated tags as: @JoinColumn(name = "UserName", referencedColumnName = "UserName") @ManyToOne(optional = false) private User userName; @JoinColumn(name = "DatasetNo", referencedColumnName = "DatasetNo") @ManyToOne(optional = false) private Dataset datasetNo; But in one of the constructors for the class, no reference is made to columns UserName or DatasetNo whereas all other columns in the class are referenced in the constructor. Can anyone tell me why this is? Both columns UserName and DatasetNo are 'foreign keys' on the entity Visualisation which corresponds to a database table of the same name. I can't quite work out the ORM. And when using entity classes, or POJO, is it better to have class variables like: private User userName; Where an instance of a class is specified or simply the key of that class instance like: private String userName; Thanks Mr Morgan.

    Read the article

  • Why should i use EJB?

    - by Nitesh Panchal
    Hello, As we all know that EJB's in 3.1 or 3.0 are simple POJOs. You just need to give annotations here and there and it gets converted to EJB from simple class. So, now my question is why should i use EJBs at all? Can i not do without them? In .Net i created class library and got things done. I never felt the need for anything like EJB. Simple classes were enough. Then, why in Java people stress on EJB? What is difference between a simple POJO and EJB in terms of execution and memory? Further which function should i write in EJB and which should i write in simple class? Should i dump every function in EJB only? or there is some kind of strategy? Does EJB provide anything special?

    Read the article

  • Watching a variable for changes without polling.

    - by milkfilk
    I'm using a framework called Processing which is basically a Java applet. It has the ability to do key events because Applet can. You can also roll your own callbacks of sorts into the parent. I'm not doing that right now and maybe that's the solution. For now, I'm looking for a more POJO solution. So I wrote some examples to illustrate my question. Please ignore using key events on the command line (console). Certainly this would be a very clean solution but it's not possible on the command line and my actual app isn't a command line app. In fact, a key event would be a good solution for me but I'm trying to understand events and polling beyond just keyboard specific problems. Both these examples flip a boolean. When the boolean flips, I want to fire something once. I could wrap the boolean in an Object so if the Object changes, I could fire an event too. I just don't want to poll with an if() statement unnecessarily. import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; /* * Example of checking a variable for changes. * Uses dumb if() and polls continuously. */ public class NotAvoidingPolling { public static void main(String[] args) { boolean typedA = false; String input = ""; System.out.println("Type 'a' please."); while (true) { InputStreamReader isr = new InputStreamReader(System.in); BufferedReader br = new BufferedReader(isr); try { input = br.readLine(); } catch (IOException ioException) { System.out.println("IO Error."); System.exit(1); } // contrived state change logic if (input.equals("a")) { typedA = true; } else { typedA = false; } // problem: this is polling. if (typedA) System.out.println("Typed 'a'."); } } } Running this outputs: Type 'a' please. a Typed 'a'. On some forums people suggested using an Observer. And although this decouples the event handler from class being observed, I still have an if() on a forever loop. import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Observable; import java.util.Observer; /* * Example of checking a variable for changes. * This uses an observer to decouple the handler feedback * out of the main() but still is polling. */ public class ObserverStillPolling { boolean typedA = false; public static void main(String[] args) { // this ObserverStillPolling o = new ObserverStillPolling(); final MyEvent myEvent = new MyEvent(o); final MyHandler myHandler = new MyHandler(); myEvent.addObserver(myHandler); // subscribe // watch for event forever Thread thread = new Thread(myEvent); thread.start(); System.out.println("Type 'a' please."); String input = ""; while (true) { InputStreamReader isr = new InputStreamReader(System.in); BufferedReader br = new BufferedReader(isr); try { input = br.readLine(); } catch (IOException ioException) { System.out.println("IO Error."); System.exit(1); } // contrived state change logic // but it's decoupled now because there's no handler here. if (input.equals("a")) { o.typedA = true; } } } } class MyEvent extends Observable implements Runnable { // boolean typedA; ObserverStillPolling o; public MyEvent(ObserverStillPolling o) { this.o = o; } public void run() { // watch the main forever while (true) { // event fire if (this.o.typedA) { setChanged(); // in reality, you'd pass something more useful notifyObservers("You just typed 'a'."); // reset this.o.typedA = false; } } } } class MyHandler implements Observer { public void update(Observable obj, Object arg) { // handle event if (arg instanceof String) { System.out.println("We received:" + (String) arg); } } } Running this outputs: Type 'a' please. a We received:You just typed 'a'. I'd be ok if the if() was a NOOP on the CPU. But it's really comparing every pass. I see real CPU load. This is as bad as polling. I can maybe throttle it back with a sleep or compare the elapsed time since last update but this is not event driven. It's just less polling. So how can I do this smarter? How can I watch a POJO for changes without polling? In C# there seems to be something interesting called properties. I'm not a C# guy so maybe this isn't as magical as I think. private void SendPropertyChanging(string property) { if (this.PropertyChanging != null) { this.PropertyChanging(this, new PropertyChangingEventArgs(property)); } }

    Read the article

  • deep injection - spring

    - by Bob
    What is the best way (or options) for accessing spring components at layers deep within the application that aren't managed by spring? For example, I have a low level utility POJO class into which I need to autowire/inject a spring component. I'll call it LowLevelHelper. There are multiple classes that use LowLevelHelper - most are layers away from anything that is hooked up with spring. One option would be to make all the layers in to spring components, but that seems like I'm hacking my design to force spring to help me. I have some complex things going on that won't be nearly as clean if I have to @Autowire all the pieces and don't new anything. Another option might be to manually inject the component in the low level class, but I'm not really sure if this is possible or the right solution.

    Read the article

  • Mapping java.util.Date to xs:date instead of xs:dateTime in JAX-WS

    - by Larsing
    Hi all, We hav an EJB, jws-anotated as a web service. It has a pretty complex pojo-model that generates an equally complex xsd. The pojos contain numerous java.util.Date. These all map to xs:dateTime. This service is used as "business service" in Oracle(BEA) OSB(AquaLogic). We also have a "proxy service" which we map to the BS with XQuery (the OSB/AquaLogic way). The proxy service's xsd has xs:date for the corresponding fields. For some reason, Oracle's implementation of XQuery does not support casting from xs:date to xs:dateTime(!). I could solve this by casting to xs:string and concat:ing with "T00:00:00", however, i would rather try to get JAX-WS to generate an xsd with xs:date instead. Only, I can't find any info on how to do this (anotations?). Can anyone give me a hint? Kind regards, Lars

    Read the article

  • In an Android TextView, is it possible to insert paragraphs?

    - by johnrock
    Below is an example of the type of problem that I have. I have data in a pojo that I need to display in a textview... the data has pseudo code that denotes each paragraph with [p] I would like to somehow parse the [p]'s into paragraphs when they are displayed in the textview. Can this be done? Is there something I can substitute for the [p] that will make a new paragraph in the textview? Question question = new Question(); question.setText("Here is the first paragraph.[p] And this should be the second."); TextView view = (TextView) findViewById(R.id.qtext); view.setText(question.getParsedText());

    Read the article

  • how to remove the mapping resource property from hibernate.cfg file

    - by Mrityunjay
    hi, i am currently working on one project. In my project there are many entity/POJO files. currently i am using simple hibernate.cfg.xml to add all the mapping files in to the configuration like :- <mapping resource="xml/ClassRoom.hbm.xml"/> <mapping resource="xml/Teacher.hbm.xml"/> <mapping resource="xml/Student.hbm.xml"/> i am having huge number of mapping files, which makes my hibernate.cfg file looks a bit messy, so is there any way so that i do not need to add the above in to the hibernate.cfg file. rather there can be any other way to achieve the same.. please help

    Read the article

  • How to preserve object identity across different VMs

    - by wheleph
    To be specific let me illustrate the question with Spring http-remoting example. Suppose we have such implementation of a simple interface: public SearchServiceImpl implements SearchService { public SearchJdo processSearch(SearchJdo search) { search.name = "a funky name"; return search; } } SearchJdo is itself a simple POJO. Now when we call the method from a client through http-remoting we'll get: public class HTTPClient { public static void main(final String[] arguments) { final ApplicationContext context = new ClassPathXmlApplicationContext( "spring-http-client-config.xml"); final SearchService searchService = (SearchService) context.getBean("searchService"); SearchJdo search = new SearchJdo(); search.name = "myName"; // this method actually returns the same object it gets as an argument SearchJdo search2 = searchService.processSearch(search); System.out.println(search == search2); // prints "false" } } The problem is that the search objects are different because of serializaton although from logical prospective they are the same. The question is whether there are some technique that allows to support or emulate object identity across VMs.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9  | Next Page >