java-ee

Long Polling with Java and JBoss

I'm looking for an example, how to implement a longpoling mechanism in java. I would love to use a stateless EJB. I know that something like that would work: @WebService(serviceName="mywebservice") @Stateless public class MyWebService { @WebMethod public String longPoll() { short ct = 0; while(someCondition ==...

How to direct AudioData from Red5 to Sphinx4?

I'm starting to learn about Red5 and java servlets. I have some background in java but most of my web development is in .Net. What I aim to do is use red5 to stream microphone input to a speech recognition engine, Sphinx4 in this case. Sphinx4 recognizer uses a StreamDataSource to get an InputStream with audio features such as sample ...

Client identification over SSL

Which of the following is more appropriate to use as an identification field in a database to represent a client, when two-way SSL authentication is used? The client's X500Principal OR The thumbprint of the client's certificate ...

What is the best enterprise shopping cart available in Java?

I need something that is competitive to Volusion/Magento in terms of features. Cost is not an issue. Thanks ...

Special URL formatting for Java Web Apps

Its best to just show what I'm trying to achieve. This isn't meant to be functional, just describe the problem. Here's what my tomcat web app currently accepts... /.../mywebapp/doSomething.jsp?id=somenumber. I want it to look like /.../mywebapp/somenumber What is this concept called, and does anyone have a good resource on it ...

How to acccess an EJB ?

Hi, I am trying to develop a Basic EJB3 application on JBOSS 4.2 in Eclipse I have created an EJB project in eclipse. The following are my remote and local interfaces. package com.test; import javax.ejb.Local; @Local public interface HelloWorldLocal { public String getGreeting(); } package com.test; import javax.ejb.Remote; @R...

NetBeans Ant: display browser on run only if certain file missing

How can I make netbeans to only display the browser on run if a certain file is missing. I want to keep it from re-launching the browser every time I hit run. I can ensure that the file is only created after the first run. ...

jboss5 class loader problem with spring and hibernate trying to parse applicationContext.xml

I am using Jboss5 and I'm trying to utilize Hibernate and Spring to load in a spring dao. I'm getting an exception which seems to point to an incompatibility in jars but I'm not quite sure what is going on. I've done quite a bit of searching and I can't seem to find something specific to this besides change JBOSS versions. I am wanting t...

Intercept write action and generate user log

I want to log every user action that change domain in my web application. when user try to create, update, delete some data the action must be save in to the user log. but when user action is list, generate report. it doesn't need to log. I my current program, I write service log. and call that service log to each action method (perform...

Architecture: MVC based web-apps around a REST interface

I'm not sure how to phrase my question.... From different sources I pick up the idea that it makes sense to build web applications around a REST interface. A REST service could execute some controller logic (validations, database-access, etc) and then return a (static) *.xhtml resource. Combined with a decent javascript framework, thi...

Default EJB transaction mode for asynchronous methods?

When I have an @Asynchronous method in an EJB, and I don't specify the @TransactionAttribute, then how exactly does the container handle the transaction boundaries? Obviously, it can't use the calling thread's transaction, so what does it do? Same question, but regarding methods that are triggered by the TimerService. EDIT: I think...

GWT + EJB 3.0 + Eclipse + Java EE + Weblogic 10g

I'm pretty new with EJB's and GWT but I've been using Java for a little while. My question is: How do I get GWT and EJB's running all together on eclipse? I keep getting pretty severe memory issues with it all together. It consumes 600mb of VM and 200mb of mem and every other operation I do (i.e. open a .java file or build), it crashes ...

JPA: Entity X has a OneToMany relationship to itself. How?

I have one Entity call Comment Comment + id (PK) + fromUserId + targetId + replyId : This is the foreign key to id The idea is a comment can have many replies, but a reply is also a comment. To distinguish between the two, a comment will have replyId equal -1, meanwhile a reply will have a non -1 value for replyId. Ultimately, what I...

Prefered way to handle Java exceptions in ServletContextListener

Hi, For servlet lifecycle stuff, what do you guys recommend doing in response to an exception... For example, public class Foo implements ServletContextListener { @Override public void contextInitialized(ServletContextEvent event) { try { // something nasty } catch (Exception e) { throw ...

Good Book for J2EE design Pattern

Hi All, Looking for some suggestion about a good refrence book for J2EE design pattern.I do have knowledge about some patterns but not that much so looking for a good Refrence material. any help in this regard will be much helpfull Thanks Umesh ...

Seam Faces causes a deploy-time error.

I'm running a Java EE 6 application out of an EAR (bundling an EJB-JAR and a WAR) on GlassFish 3.0.1, using ICEfaces 2.0 Beta 1 and a Seam Faces 3.0.0 Alpha 3 Snapshot. When I deploy the EAR, I get an error. This error doesn't happen when I remove Seam Faces. Here's the error from my GlassFish log (I redacted the first bit, where it jus...

Using non-persistence related methods and fields in persistence entity

I have a persistence related java-ee code which I need to rewrite to make the app work on the Google App Engine and its data storage. When I use java-ee persistence providers, I generate persistence entities with my IDE and I keep them the way they are in case I need to regenerate them. However autogenerating entity classes for app-engin...

defining custom UI logic in JSF for <script> tags

I know about creating my own taglibs in JSF eg. but is there a way to use JSF to parse differently native HTML elements? I am thinking of adding my own parameters for forms, divs, that would be then parsed differently on the server before rendering the final markup. ...

What is the best way to send XML data to webservices jaxws

What is the best way to send XML data to web services jax-ws? One of the way I could make out is to convert xml into String from client side and send it as a String to WebService. I don't think this is the best way / best practice . ...

Why is inet:/0.0.0.0 interpreted as inet:/0:0:0:0:0:0:0:0 by com.sun.net.httpserver.HttpServer?

We found this issue while implementing a reconnect logic for a WS endpoint using JAX-WS stack deployed on Glassfishv2.1 server. We deploy the web service on a cluster environment. To simplify the deployment, we use 0.0.0.0 as the IP on which the endpoint needs to be published, so that it can be accessed from all available IPs pertaining ...