java-ee

Why doesn't UriInfo.getQueryParameters() decode '+'?

怎甘沉沦 提交于 2019-12-24 04:06:13
问题 I know I can work around this, but it seems very strange that the behaviour is different if you use an annotated query parameter, compared with pulling the parameter out of the parameter map (which should be decoded according to the javadoc). Is this a bug, or just a quirk? @GET @Path("/") @Produces(MediaType.APPLICATION_JSON) public Response getAssets(@Context UriInfo info, @QueryParam("q") String searchQuery) { // The request URI is http://myhost.com/appRoot?q=foo+bar%20baz // At this point

GAE : java.lang.NoClassDefFoundError: com/google/appengine/api/blobstore/BlobstoreServiceFactory

做~自己de王妃 提交于 2019-12-24 03:54:13
问题 Kindly help me with this. I am using blob store for saving images and it is working perfectly fine on my local environment. But when I deploy the same code the cloud it is throwing me the exception : java.lang.NoClassDefFoundError: com/google/appengine/api/blobstore/BlobstoreServiceFactory I am using GAE 1.8.4 回答1: Most likely, appengine-api.jar is missing from your war/WEB-INF/lib/ folder. If you use Eclipse, click on the Problems tab. You may see a warning saying that this jar is not

How to check if new JSON file is available?

寵の児 提交于 2019-12-24 03:39:24
问题 I am building a mobile application that get all the information from a Java backend. The data is available through REST in JSON format. How would you manage to discover on the mobile device if the JSON is new or not? I was thinking of having one really simple JSON format file with only a timestamp that the mobile device checked each time to compare to what already stored...but it doesn't seems to be a good solution, at least I think. So are there other ways to do this? I am developing both

Hibernate: Is it possible to save a transient field in second level cache?

99封情书 提交于 2019-12-24 03:34:34
问题 I have the requirement to keep track of a field of a persistent entity, which will be changed very often and is not really a feature of that entity, rather some kind of caculation. Sometimes, a user wants to see that calculation, but this case is very rare (once month or so). So the result of this calculation has to be saved somehow, but i want to avoid to save it in the database every time it changes, because this would trigger an update event of the parent entity each time (which would

EJB 3.0 JNDI lookup (Weblogic 10.x)

青春壹個敷衍的年華 提交于 2019-12-24 03:23:38
问题 I use weblogic 10.3.6 and so EJB 3.0. I have EJB and local interface. Both packaged in ejb-jar inside ear. @Local public interface TestLocal { ... } @Stateless public class TestEJB implements TestLocal { ... } To access this EJB from war I have in my web.xml <ejb-local-ref> <ejb-ref-name>ejb/TestLocal</ejb-ref-name> <ejb-ref-type>Session</ejb-ref-type> <local>testpackage.TestLocal</local> </ejb-local-ref> And lookup looks like test = (TestLocal) new InitialContext().lookup("java:comp/env/ejb

EJB 3.0 JNDI lookup (Weblogic 10.x)

三世轮回 提交于 2019-12-24 03:23:06
问题 I use weblogic 10.3.6 and so EJB 3.0. I have EJB and local interface. Both packaged in ejb-jar inside ear. @Local public interface TestLocal { ... } @Stateless public class TestEJB implements TestLocal { ... } To access this EJB from war I have in my web.xml <ejb-local-ref> <ejb-ref-name>ejb/TestLocal</ejb-ref-name> <ejb-ref-type>Session</ejb-ref-type> <local>testpackage.TestLocal</local> </ejb-local-ref> And lookup looks like test = (TestLocal) new InitialContext().lookup("java:comp/env/ejb

@Embeddable and @EmbeddedId consists only of complex classes

狂风中的少年 提交于 2019-12-24 03:13:01
问题 I have the following problem: One of my entities has to use a complex class as ID. (To solve this I use @EmbeddedId) The complex class has a combined primary key of 2 other complex classes [I got the following error: Caused by: org.hibernate.AnnotationException: model.IElementKey has no persistent id property: model.impl.Element.id]. The problem is how to solve this without adding a non complex type to the ID-class. Edit: I have to user JPA only [javax.persistence.*] Edit2: Small Code Example

How to distribute an event to all nodes in a (Wildfly) cluster?

岁酱吖の 提交于 2019-12-24 03:08:25
问题 I would like to notify all nodes in a cluster when the state of a longer running process in my JavaEE 7 WebApp changes, so that every node can in turn notify their clients via WebSocket about that change. I am working with Wildfly 10 in a clustered environment. What JavaEE 7 API / Programming model or Wildfly Service would be todays best practice to achieve that ? 回答1: If you want to stay within JavaEE ecosystem, then JMS topic is the way to go. Topics are like broadcast channels - every

Rest back-end, Angular.js front-end lots of questions

非 Y 不嫁゛ 提交于 2019-12-24 02:56:10
问题 Okey, so time to build an webapplication using Jboss, restEasy as backend and i wanted to go for some MVC front-end framework like Angular.js. Never done this before so here is a million questions: Should i be using security roles in java or have my own security authentication and declare my own roles? J_security_check is wierd, it only prompts you to log in if you try to access a forbidden resource. Then it reroutes you to the login page. How can i use this with Angular? seems to me this can

jsf/glassfish hosting static files

二次信任 提交于 2019-12-24 02:52:49
问题 I'm using Glassfish/JSF. Is it possible to host static files from disk? I need to generate xml file and save it somewhere on disk so it could be available as http://domain.com/file.xml I need similar functionality to apache/php where I can save file to /public_html and it is automatically available. 回答1: I think you should try out Virtual directory. Basically, you only need to create a Virtual directory which is mapped to a folder on your hard-disk. After that, you can access all files in