java-ee

Standard conventions or good practices when naming local/remote interfaces of EJBs?

拟墨画扇 提交于 2019-12-23 10:56:46
问题 Are there any conventions or good practices when naming interfaces for EJBs? I am trying to apply some DDD principles in my application as well so I am using the "service" sterotype on the classes that is the interface for the world outside. If I have a QuestionService EJB that provides business logic operations to clients, what would the @Local/@Remote Interface be named? All the books I read so far only names them QuestionServiceLocal/QuestionServiceRemote. Is this suffcient (I am not

FileNotFoundException (File too large)

百般思念 提交于 2019-12-23 10:30:11
问题 I am getting this exception when trying to download a file Caused by: java.io.FileNotFoundException: /repository/PWWVFSYWDW0STLHYVEEKHMYBXZTTETGROCQ4FGdsadadaXR1407709207964905350810526.jpg (File too large) at java.io.FileOutputStream.open(Native Method) It is clear that file the exists. In addition to that, the same program works properly on my PC, but there is a problem with the server, which is Unix Any ideas what might be causing this? 回答1: I think that this is an obscure error that is

@Inject and @PostConstruct not working in singleton pattern

你离开我真会死。 提交于 2019-12-23 10:18:13
问题 I have a class as below: public class UserAuthenticator { private static UserAuthenticator authenticator = @Inject private UserRepository userRepository; @PostConstruct public void init() { List<User> allUsers = userRepository.findAll(); for (User user : allUsers) { users.put(user.getEmail(), user.getPassword()); serviceKeys.put(user.getServiceKey(), user.getEmail()); } } public static UserAuthenticator getInstance() { if (authenticator == null) { authenticator = new UserAuthenticator(); }

Executables in a war file

这一生的挚爱 提交于 2019-12-23 09:47:34
问题 We'd like to ship some helper scripts (shell scripts) as part of an application war. Unfortunately it appears like our build system (maven) discard the permissions on all files and the scripts end up without the executable bit set. Is it even possible to do that? Does the .war format support executable files? If yes: how could tell maven to keep the permissions/fix them somewhere in the process? 回答1: The problem is more likely that these bits are not supported in the underlying zip-format.

Annotation @Basic to transient variables

橙三吉。 提交于 2019-12-23 09:40:42
问题 I am having a POJO class which consists of: - persistent properties, - transient properties. While writing HQL I considered both: persistent and transient properties. I.e. HQL like select persistent_properties,transient_prop from Pojo_classname is it correct? Can I write @Basic annotation to transient variables? 回答1: No, it's not correct. A HQL query translates to SQL. An @Transient property is not in the database, so the SQL query won't be able to query over this property. @Basic and

Is jSessionId really unique?

霸气de小男生 提交于 2019-12-23 09:34:38
问题 To put some context, i'm developing an API to track user actions on the site (anon users too). So far, we use jsessionId to identify each user and his actions. That API, now runs on Tomcat and JBoss. The really matter question is, since we analize all data one a day, is in any way the uniqueness of this jsessionId guaranteed all along the day? Or, not concurrently, can other user get the same jsessionId used previously by other one? Thanks in advance. 回答1: Sorry, it's not specified. It's only

Spring form without commandName [duplicate]

无人久伴 提交于 2019-12-23 09:29:50
问题 This question already has answers here : What causes “java.lang.IllegalStateException: Neither BindingResult nor plain target object for bean name 'command' available as request attribute”? (6 answers) Closed 2 years ago . I'm new to Spring, and I have a problem. I have a form which is used to send information to the controller. I don't need or want to have a bean backing up the form so I left the commandName attribute in the form blank like this: <form:form action="getReportFile.html" method

Configure logback in Wildfly

余生长醉 提交于 2019-12-23 09:25:22
问题 I have terrible problems to figure out how to configure logging via logback in my Java EE application on Wildfly 10. I tried to put slf4j-api-1.7.21.jar , logback-classic-1.1.7.jar and logback-core-1.1.7.jar in my ear in /lib/ , add logback.xml to resources in my ejb module and add jboss-deployment-structure.xml into my ear META-INF . It almost works... Logback creates my log files and correctly log into them. Unfortunately logging to console works strange. It looks like wildfly concatenated

How to deploy Apache CXF webservice to Glassfish

爷,独闯天下 提交于 2019-12-23 09:05:41
问题 I have a web service client generated and built with Apache CXF. Next I have JAX-RS Jersey application in which I want to call methods from that webservice. When I try to deploy this simple project to Glassfish 4.0 server I get this exception: Exception while deploying the app [pelijee] : The lifecycle method [finalizeConfig] must not throw a checked exception. Related annotation information: annotation [@javax.annotation.PostConstruct()] on annotated element [public void org.apache.cxf

Java EE FirebaseApp name [DEFAULT] already exists

我是研究僧i 提交于 2019-12-23 08:47:12
问题 I got a problem related to Firebase and Java EE. I'm currently writing some Java servlets for my project and I'm using Firebase the first time because I wanted to try something new. My actual problem is the following: I got a servlet which is responsible for exchanging an iOS device token in an user database. This is necessary for sending Remote Push Notifications to a device. I've done this like in the google tutorials, but I'm getting the following exception: java.lang.IllegalStateException