java-ee

Offset is not set for few time zone in java

爷,独闯天下 提交于 2019-12-24 06:33:11
问题 I would want to take the time and time zone from user and create an entry. Used below calendar API to do this, it is working for few time zone and not working few time zones calendar.setTime(eventFormEntryBean.getStartDate()); TimeZone timeZone = TimeZone.getTimeZone("Europe/Amsterdam"); calendar.setTimeZone(timeZone); Working timezone(at the end +xx:xx) Pacific/Palau 2019-11-27T20:51:09.000+09:00 IST - 2019-11-20T22:00:00.000+05:30 Europe/Amsterdam - 2019-11-28T12:49:24.000+01:00 America/Los

Arquillian - running tests not working

泄露秘密 提交于 2019-12-24 06:01:53
问题 I am trying to add an test based on arquillian . When I do mvn test I get this error: Test: @RunWith(Arquillian.class) public class SomeEntityServiceTest extends ApiTestCase { @Inject CartStatusService service; @Test public void testCreate() throws Exception { SomeEntity someEntity = new SomeEntity(); someEntity.setActive(1); service.create(someEntity); } } ApiTestCase: public class ApiTestCase { @PersistenceContext(unitName = "myDataSource") protected EntityManager em; @Deployment public

Store files in Cloud using Java EE

橙三吉。 提交于 2019-12-24 05:39:13
问题 Am using CloudBees to deploy my Java EE application. In that I need to write and read files and I wont find any cloud file system from CloudBees. Please suggest me any free cloud file system storage and java code to access that file system. 回答1: Using jclouds you can store stuff in several different clouds while using a consistent API. http://www.jclouds.org/ 回答2: You can store files - however they will be ephemeral and not shared in the cluster. To achieve that, you would need to store in a

Does ejb stateless class has to be public?

拜拜、爱过 提交于 2019-12-24 05:30:04
问题 Can @Stateless class have different modifiers than public? In documentation I have only found constraints of constructor/methods visibility, but nothing interesting about class level access. 回答1: According to ejb3-1 specification: 4.9.2 Session Bean Class The following are the requirements for the session bean class: • The class must be defined as public, must not be final, and must not be abstract. The class must be a top level class 来源: https://stackoverflow.com/questions/25867608/does-ejb

Does ejb stateless class has to be public?

半城伤御伤魂 提交于 2019-12-24 05:29:06
问题 Can @Stateless class have different modifiers than public? In documentation I have only found constraints of constructor/methods visibility, but nothing interesting about class level access. 回答1: According to ejb3-1 specification: 4.9.2 Session Bean Class The following are the requirements for the session bean class: • The class must be defined as public, must not be final, and must not be abstract. The class must be a top level class 来源: https://stackoverflow.com/questions/25867608/does-ejb

How to use bean validation 1.1 in JBoss EAP 6.4.0?

ぃ、小莉子 提交于 2019-12-24 05:23:14
问题 I have a simple restful web service that uses Bean Validation 1.1 (and Hibernate Validator 5.1.3 as the implementation) and I'm deploying it on JBoss EAP 6.4.0. Since JBoss 6.4 comes bundled with Bean Validation 1.0 and its implementation library (Hibernate Validator 4.3.2), there is a conflict and none of service calls work. Below is the error that I get: java.lang.NoSuchMethodError: javax.validation.Validator.forExecutables()Ljavax/validation/executable/ExecutableValidator; org.apache.cxf

entityManager.persist not saving anything to database

ⅰ亾dé卋堺 提交于 2019-12-24 05:17:06
问题 I use Spring 4.2.5 and org.hibernate 5.1.0 . When I use entityManager.persist(user) to save user ,it can't save to the database,and no error throw. But if I add entityManager.getTransaction().begin(); and entityManager.getTransaction().commit(); it worked. code below @Service @Transactional public class UserTestService { @PersistenceUnit private EntityManagerFactory entityManagerFactory; public void addUser(User user){ EntityManager entityManager = entityManagerFactory.createEntityManager();

Why web.xml does not work when I do not use a global namespace?

浪尽此生 提交于 2019-12-24 05:15:46
问题 I have this very simple web.xml file: <?xml version="1.0" encoding="UTF-8" ?> <web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" version="3.1"> <welcome-file-list> <welcome-file>testx.jsp</welcome-file> </welcome-file-list> </web-app> When I deploy the application and visit the context root, I will be taken to testx.jsp which is fine

Does Java EE 6 framework only for Web Application Or can I use it for Client Application as well

二次信任 提交于 2019-12-24 04:47:06
问题 I always use Jave EE 6 framework for web application. So I am not sure what I about to do is correct. I need to create an native client command-line application that has database access. So simple java Project with JDBC would do that job. But the requirements for db access include connection pool, concurrency handle, and transaction ..., Now the requirement of the projects does eventually build a web interface, but first it will build a command line application first. And this is when i am

Max file size with resteasy and multipart/form-data request

隐身守侯 提交于 2019-12-24 04:23:45
问题 How can I control the max file size and/or the max request size when using resteasy to handle a multipart/form-data request ? My code looks like this: @POST @Path("/somerestresource") @Consumes(MediaType.MULTIPART_FORM_DATA) public Response handleForm(@MultipartForm MyForm form) { ... } With a Servlet I can control stuff with the @MultipartConfig annotation. So I'm thinking about bypassing resteasy and using @Context to inject a HttpServletRequest and having my servlet configured inside the