java-ee

Is it possible to inject a list of beans implementing an interface using JEE

I wonder, if I can inject a list of (stateless) beans, that all implementing a special interface. For example I've a module contract public interface ResetService { void reset(MyContext context); } Than I've two modules, that are implementing this interface. And one module, that should call all implementations: @EJBs private List<...

Eclipse Java EE Plugin to edit the Deployment Descriptor

Okay, so I have been using Java EE with glassfish for a little while now. And have started to realize that my deployment descriptor is getting really cluttered up and hard to find things in it anymore. So I was wondering if anyone knows of a plugin for Eclipse that makes managing the descriptor easier, perhaps something visual? I know th...

Running Jetty 7 server in eclipse?

I'm trying to set up Eclipse to run and deploy my projects to a Jetty 7 server (the oldest version available from http://download.eclipse.org/jetty/). I've downloaded Jetty 7 and unpacked it, and I've installed the Jetty plugin from the available server adapters list, but when I try to configure a new Jetty server, the server type list ...

How do i access EJB implementing remote interface in separate web application?

Hello, I am using Netbeans 6.8 and Glassfish v3.0. I created an ejb module and created entity classes from database and then created stateless session bean with remote interface. Say eg. @Remote public interface customerRemote{ public void add(String name, String address); public Customer find(Integer id); } @Stateless pub...

Delivery of JMS message before the transaction is committed

Hi, I have a very simple scenario involving a database and a JMS in an application server (Glassfish). The scenario is dead simple: 1. an EJB inserts a row in the database and sends a message. 2. when the message is delivered with an MDB, the row is read and updated. The problem is that sometimes the message is delivered before the...

How to manage transaction for database and file system in jee environment?

I store file’s attributes (size, update time…) in database. So the problem is how to manage transaction for database and file. In jee environment, JTA is just able to manage database transaction. In case, updating database is successful but file operation fails, should I write file-rollback method for this? Moreover, file operation in ...

XSLT transfer fails because Weblogic cannot find a class located in rt.jar

We have encountered a very strange class not found problem in our web app running on Weblogic 10.3. In our code we do a pretty standard XSLT transformation. UtilRequestManagerBean.java: TransformerFactory tFactory = TransformerFactory.newInstance(); Transformer transformer = tFactory.newTransformer(new StreamSource(new StringReader(xsl...

Problem updating collection using JPA

I have an entity class Foo foo that contains Collection<Bar> bars. I've tried a variety of ways, but I'm unable to successfully update my collection. One attempt: foo = em.find(key); foo.getBars().clear(); foo.setBars(bars); em.flush; \\ commit, etc. This appends the new collection to the old one. Another attempt: foo = em.find...

A concise, clear list of what is new in JPA2?

Does anybody know of a good list of what is new in JPA 2? Not what is new with Hibernate/TopLink in the version that supports JPA 2 but what is new in the actual spec. ...

Conceptually how does load-balancing on the EJB tier work in Glassfish/any ejb container

I am wondering conceptually how load-balancing works on the EJB-level (not web session replication) with Java EE containers like Glassfish. From what I have gleaned your remote interface is a proxy that delegates your call to one of many servers you may have in an environment. If things fail are they supposed to be able to "finish" o...

JBoss - does app have to be compiled under same jdk as JBOSS is running under?

I'm a little confused about JBOSS and running it under different JDKs. For example, let's say I'm running JBOSS 5.1, and before starting it I set my JAVA_HOME to point to JDK5. Let's also assume that my JEE application is compiled under JDK6. If I deploy the JEE app (compiled under JDK6) to JBOSS, when I try to look up my EJBs I get e...

File upload and Download in a web app using struts2

Hi In struts2 upload methods, can I choose where the uploaded file must be saved. I mean, all the examples in web ask me to store in WEB-INF which surely is not a good idea. I want to be able to store the uploaded file in any place in my disk. How should i do it? Can i do it with help of ServletContextAware interceptor ? When I use ...

JBoss EJB Bean not bound

Hi, I have the following error Exception in thread "main" javax.naming.NameNotFoundException: CounterBean not bound trying to access an EJB JAR CounterBean.jar deployed on JBoss5 from a client application outside the Application Server. From the Jboss log, it looks like it does not have a global JNDI name? Is this ok? What have I ...

Get reference to the EJB3 local business interface inside the JCA adapter

Hi there, I'd like to know whether it is possible to get a reference to the ejb3 local business interfaces inside the jca adapter? Resource adapter and ejb .jar are packed into the same .ear. Application is running under WebSphere AS 6.1 with ejb3 featurepack. I have tried to use ejblocal:<full_class_name_of_local_interface> as JNDI ...

Using implementation specific classes with standard JAX-RS

I want to use classes from a specific JAX-RS implementation together with the classes defined by Java EE, which are available on an application server. More specifically I want to use Viewable from Jersey but want to use the default Java EE deployment without wrapper servlet. Is it possible? How? Is it a good idea? Or would it be better...

Difference between Java Bean and Enterprise Java Beans?

Are they different or they are used interchangeably? If they are Different, then what made them different from each other? ...

Deploy multiple instances of an EAR (representing versions) to Glassfish

I basically want to be able to deploy multiple versions of the same EAR file to the same server (Glassfish instance?) , and have a unique path to each version separating them. From my reading on this it appears that multiple EARs deploy to the root of the web server namespace so that they can coexist if they do not have colliding contex...

EJB3 Remote vs Webservices, performances?

Hello I'm planning to a webapp where every guy using it would have a client that would run computations on its computer (because these computations can't be done on the server, too much load...), and then send results to the server. I guess there will be lot of people interested in my application and that's why i'm wonder if my archite...

What's the best Communication Pattern for EJB3-based applications?

I'm starting a JEE project that needs to be strongly scalable. So far, the concept was: several Message Driven Beans, responsible for different parts of the architecture each MDB has a Session Bean injected, handling the business logic a couple of Entity Beans, providing access to the persistence layer communication between the differe...

Make graph of perf4j on the basis of request and maintain every day request performance

Hello, I want to make graph of perf4j on the basis of request and not on the basis of timeslice as shown when graph drawn for perf4j. How can the graph be drawn and maintained for current and past requests without using timeslice? Thank You ...