java-ee

How do I delay JMS Message sending?

不问归期 提交于 2019-12-23 16:07:37
问题 How do I delay JMS Message sending or proceed uncertain time? I am using Weblogic, as you know, after JMS sending, the receiver will process the message asynchronously, but, at this time or sometimes the external resource are not ready for the receiver, therefore, I want to have some check logic to delay send or process the message. I guess for example: I put the message into pending queue then frequently check the resource availability, once it is then send or proceed the message? Do

Using struts2 to redirect with dynamic parameters not working

懵懂的女人 提交于 2019-12-23 16:05:55
问题 I'm having an issue while trying to redirect mapping with dynamic parameters. The way I'm mapping in Struts2: <action name="Delete" class="templateLalaAction" method="remove"> <result name="success" type="redirect-action"> <param name="actionName">LalaTemplatesDisplay</param> <param name="buId">${buId}</param> </result> <result name="failure" type="redirect-action"> LalaTemplatesDisplay </result> </action> The method "remove" in the action: remove() { putRequestAttribute("buId",Long.valueOf(

Why is @DiscriminatorColumn ignored when using @JoinTable?

半城伤御伤魂 提交于 2019-12-23 15:36:26
问题 Suppose I have the following tables: ______________________ | LAWSUIT | |______________________| | ID | | TITLE | |______________________| \ \ \ ______________________ | PERSONS_IN_THE_CASE | |______________________| | ID_LAWSUIT | | ID_PERSON | |______________________| / / / ______________________ | PERSON | |______________________| | ID | | NAME | | TYPE | TYPE values = "Plantiff, Defendant, Lawyer, Judge, ..." |______________________| (I know that normalizing the database I could have a

What is the size limit of a SOAP message's input parameter

拥有回忆 提交于 2019-12-23 15:18:18
问题 Is there a size limit on a SOAP message's input parameters? I currently need to get a potentially large-ish string with the request, so I'm trying to decide if I will have to use SOAP attachments or not. I am using Java Web Services. Thanks, Alex 回答1: There is no theoretical limit: I don't think there is anything in the specifications about maximum lengths, so this will be heavily dependent on your server. Have a look at the documentation for the server. Obviously it depends upon what you're

Glassfish error while deploying ear web application

风流意气都作罢 提交于 2019-12-23 15:17:31
问题 I'm walking with this error several weeks, i've never work with java web applications so i'm really lost on this. My setup is: Glassfish 5.0 Netbeans IDE 8.2 Java 8 Update 181 (64-bit) Java 10.0.2 (64-bit) Java SE Development Kit 8 Update 181 (64-bit) Java(TM) SE Development Kit 10.0.2 (64-bit) The error is the following: Grave: Exception while deploying the app [ociumfinal-ear] : Cannot resolve reference [Local ejb-ref name=chat.ChatUsers/usuarioEjb,Local 3.x interface =com.eventos

Does Websphere respect Daemon threads?

廉价感情. 提交于 2019-12-23 13:22:43
问题 I've got an app that creates a load of Daemon threads, I'd like each one to shut down when the app is shut down. I'm a little worried thought that Websphere 7 might not be shutting them all down. Does anyone know if Websphere 7 treats Daemons threads differently? (I know it should do) Note: I know what shouldn't create threads manually, and that I should probably use WebSphere WorkManager or something, but this app has to run in Tomcat and WebSphere. I know that I should tie in all threads to

Could not open JPA EntityManager for transaction in spring

淺唱寂寞╮ 提交于 2019-12-23 13:09:27
问题 I am building a testing application with JPA Hibernate 4.1.7 and Spring 3.1.3 on top. I am getting a NPE at jta causing JPA EntityManager to fail, here is the stack trace DEBUG TestContext - Retrieved ApplicationContext for test class [class cvut.dp.foodtables.service.FoodServiceImplTest] from cache with key [[MergedContextConfiguration@61cc1457 testClass = FoodServiceImplTest, locations = '{classpath:/WEB-INF/context/applicationContext.xml}', classes = '{}', activeProfiles = '{}',

Can I use inheritance in remote/local interfaces? (EJB3)

橙三吉。 提交于 2019-12-23 13:08:14
问题 An example: @Remote public interface SomeComponentRemote{ public Something processStuff(); } //-- @Local public interface SomeComponentLocal extends SomeComponentRemote{ } Is that allowed? Can i do this regularly? 回答1: Your way is not allowed as you can not mark your interface with both @Local and @Remote annotations according to specification. And it is not a good idea from point of code reading. Recommended solution is public interface SomeComponent { public Something processStuff(); }

Java session variables

帅比萌擦擦* 提交于 2019-12-23 12:49:23
问题 I'm hearing that some people believe storing info on the server in a session is a bad idea, that its not secure. As a result, in a multi-page business process function, the application is writing data to a db, then retrieving the info when its needed. Is there something necessarily unsafe about storing private info in a session? 回答1: There's not a security risk in storing attributes in a Session, as long as the session itself is safe from hijacking. There are some serious issues involving

How do you test if cookies are enabled in Java/J2EE

梦想与她 提交于 2019-12-23 12:38:29
问题 Testing: return request.getCookies() == null; is not an appropriate way test. Is there another way? 回答1: You generally want to use JavaScript to determine if the client's browser has cookies enabled: <script type="text/javascript"> var cookieEnabled=(navigator.cookieEnabled)? true : false //if not IE4+ nor NS6+ if (typeof navigator.cookieEnabled=="undefined" && !cookieEnabled){ document.cookie="testcookie" cookieEnabled=(document.cookie.indexOf("testcookie")!=-1)? true : false } //if