java-ee

Why is WSDL required for Java Client at runtime?

北慕城南 提交于 2019-12-21 05:09:17
问题 After generating the artifacts for a Java WS client, why is the wsdllocation reference required? why is the WSDL needed at runtime? I might see a reason for some validation, but shouldn't that be optional? 回答1: Summary: While from a design perspective the WSDL is not necessary for a web service client, the implementation effected by Sun for a web service client has a hard dependency on the WSDL. The apparent purpose is to generate some of the runtime dependencies dynamically. First: it is

Two Meta-Inf folders - normal structure?

╄→尐↘猪︶ㄣ 提交于 2019-12-21 05:09:17
问题 I just "discovered" that we have two Meta-Inf folders ... In eclipse and also in the War file. The First one is (in the war): /META-INF/ The Second, and weird one ist: /WEB-INF/classes/META-INF/ In the second folder is a persistance.xml and a something.taglib.xml... If i move the files into the first meta-inf folder i get exceptions from hibernate.. What is the purpose of this second and oddly placed meta-inf folder ? Is this a normal folder structure ? 回答1: The "weird one" location is

java.lang.UnsupportedOperationException: Attempted to serialize java.lang.Class: org.hibernate.proxy.HibernateProxy

纵然是瞬间 提交于 2019-12-21 05:06:33
问题 I'm using a Restful web service (Jersy implementation) with a JSF application and used Json to get the data as follows: carObjectDao = new GenericDAO<carObject>(carObject.class); List<carObject> allCars = carObjectDao.readAll(); Gson gson = new Gson(); String carString = gson.toJson(allCars); System.err.println(carString ); return carString ; i run the application in debug mode and allCars is filled with the data correctly, but after that an exception is thrown : java.lang

Write HQL clause using Hibernate Criteria API

旧时模样 提交于 2019-12-21 05:05:06
问题 I want to write a method that returns a list of last added objects grouped by field 'serviceId'. The following HQL works, but I want to write this using Criteria API: FROM Notification WHERE date IN (SELECT MAX(date) FROM Notification GROUP BY serviceId) ORDER BY date ASC Something like this: Criteria crit = session.createCriteria(Notification.class); crit.add(Restrictions.in("date", <MAX dates>)); criteria.addOrder(Order.desc("date")); Thanks in advance. EDIT: Now I need a similar query that

use JTA transaction or not?

非 Y 不嫁゛ 提交于 2019-12-21 04:27:38
问题 I am developing a J2EE application which is deployed on JBoss application server. The application is composed of an EJB 2.x component and a web component and is running on local computer or remote server. The database is either Oracle or SQL Server and is not in a distributed envrionment. I am using Hibernate 3.6 (JPA 2.0 implementation) for the transactions. Should I use JTA which is container managed transaction or is it overkilled to use it? Currently I am using JTA and it turns out it is

Java Web Framework similar with Ruby on Rails paradigm

心不动则不痛 提交于 2019-12-21 04:27:10
问题 in your opinion, what is java web framework that most close to or similar to the paradigm of the Ruby on Rails (like convention over configuration, DRY, noXML, etc), but without the need to learn scripting languages ​​like Groovy. And of course have a great documentation and community. 回答1: You can take a look to Play Framework it follow MVC and RESTful architectures. 回答2: Take a look at Grails which follows the paradigms of Ruby on Rails. 回答3: Maybe too late, but have looked at Spring Roo?

create ear in grails

拥有回忆 提交于 2019-12-21 04:25:25
问题 grails supports creation of war. But is there any command to create an ear through grails? 回答1: There's no direct support in Grails, but this Gant script will do the job. Simply added to scripts/ dir and invoked as grails ear . Script originally posted by Graeme on mailing list includeTargets << grailsScript("_GrailsWar") target(ear: "Creates an EAR file from a Grails WAR") { war() event("StatusUpdate", ["Building EAR file"]) generateApplicationXml() def warDest = new File(warName).parentFile

JUL Adapter not working for Jersey

▼魔方 西西 提交于 2019-12-21 04:22:05
问题 I am trying to use JUL Adapter to delegate Java Util Logging to Log4j2. More precisely, any third-party library that use JUL to generate logs, should be delegated to Log4j2. As a simple exercise, I created a standalone application that uses a library (I created this library for testing purposes, it generates logs using JUL) to test the JUL Adapter . When I change the log manager as described here I can see the effects. And it works fine. Hers's the code: import org.apache.logging.log4j

Remote polling in ManagedBean and notify client-view via push

馋奶兔 提交于 2019-12-21 04:12:08
问题 I have a jsf view which shows some data from a managed-bean (viewscope) in a table, that is retrieved remotely. Currently the data is updated via polling from the client-view using primefaces poll component. This is not sufficient enough, since to much traffic is sent to client and now that primefaces supports server-push I only want to reload the data and push it to the client-view if data has been changed. This should be realized via polling from the web-tier to application tier calling a

REST web service versioning in practice

末鹿安然 提交于 2019-12-21 04:11:17
问题 I am creating a new web service and I have read some of the ebooks from APIgee where versioning the web service is a recommended. I understand there is some "battle" between keeping versioning info in the URL vs. the header. From what I have read and understand I want to use versioning in the header. My question is; how does this looks like in practice? I am using Spring MVC 3.2. Do you just create a methods like this in the same controller which responds to different versions? Version 1: