j2ee

Compass Autocomplete to only return index words

I am currently trying to configure a compass query for autocomplete. I have it working so that the compass query will return an object. I would like to modify it so that it will return matching words in the index, not matching results. Thanks. ...

java.rmi.MarshalException: Failed to communicate

I'm using jbossIDE Eclipse 1.6. when deploying my .ear app, I get a java.rmi.MarshalException. what's surprising is that just a few min ago, everything was OK. I feel like this jbossIDE Eclipse thing is really useless. it's crashing all the time. java.rmi.MarshalException: Failed to communicate. Problem during marsh...

java.rmi.ServerException: RuntimeException

When trying to access an ejb from a client , I get this exception : java.rmi.ServerException: RuntimeException; nested exception is: java.lang.NullPointerException at org.jboss.ejb.plugins.LogInterceptor.handleException(LogInterceptor.java:421) at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:209) I can't figure f...

LazyInitialization Exception

I have 2 Hibernate objects : Dero and Motif. a Dero has a set of Motif. I load a Dero object from the DB fine. but when I try to access its set of Motif : assertEquals(dero.getMotifRefus(),deroFromDB.getMotifRefus()); I get an exception : org.hibernate.LazyInitializationException: failed to lazily initialize a collection of rol...

java.rmi.MarshalException

whenever I try to call my ejb from a client, I get this error : java.rmi.MarshalException: Failed to communicate. Problem during marshalling/unmarshalling; nested exception is: java.io.InvalidClassException: com.afrikbrain.util.message.MessageInfo; local class incompatible: stream classdesc serialVersionUI...

Quartz Scheduled Job in Error State

Hi, I have two jobs scheduled with Quartz. One runs once per week. The second runs one per day, for three consecutive dates in the week. I've noticed the following behaviour, but can't figure out what is going wrong. The first job sometimes just doesn't start at all. Before the scheduled start time, the TRIGGER STATE column is set...

What's the deal with web service generation and JavaBeans?

I recently wrote some data access methods (plain old Java) that use immutable objects for both the request objects and the resulting data objects. I like the immutable objects because they prevent a good deal of confusion from appearing in the client code which I've seen in the past when people attempt to mutate and reuse objects. Anyw...

Still Need To Write a Connection Pool Class in J2EE 6 with MySQL 5?

I'm looking around trying to see if anybody has asked this before. I don't think so. Some of the other questions I've looked at seem to talk about this a bit and indicate that using a JNDI datasource setup in Tomcat is the best way to do database stuff in your J2EE app now. It's been three or four years since I did any serious J2EE dev...

how to obtain the relative path of a resource in a j2ee project

I have a Dynamic Web Project having a flat file (or say text file). I have created a servlet in which I need to use this file. My code is as following: protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // String resource = request.getParameter ("json") ; ...

Why throwing an EJBException is a "recommended" practice?

I keep getting this "suggestion" from many fellow developers over and over again. In my experience I've found that EJBExceptions are well-suited for "end of the world" from the bean instance perspective (like when something is so wrong that the bean instance cannot recover by itself). If an instance can recover, I think it's better to th...

Lookup Local EJB from Glassfish LifeCycle module

I can look up the remote interface of an EJB3 from a Glassfish 2.1 using the global jndi name. However, as I understand, if this were not a LC module but an EJB (Servlet), I would have an ejb-local-ref entry in its ejb-jar.xml (web.xml). Is there a place to define Local references for an LC module? Thanks! ...

Clustering a J2EE Webapp - Options?

I have a webapp deployed to three servers running Apache, Tomcat and a load balancer in front of them. Now I am thinking of clustering them. Here are the options usual options and my constraints that I am aware of: Serialization based Session clustering: In my case, the application uses a lot of objects in session. So I would prefer n...

Glassfish and Ant

Hi. I'm just in search how to deploy my project to the remote Glassfish v.2 server. It's easily could be done by installing Glassfish server on local computer and using as-admin tool but it's just a waste of space, time and recourses... The better way is to use jar files with defined Ant tasks(like you do with Tomcat or GAE), but as i fo...

.war vs .ear file

What is the difference between a .war and .ear file? ...

Java / J2EE development on Windows 7

I want to buy a new laptop and I am wondering whether Windows 7 64 bits is the right OS for me. I need to work with the following software: MySQL, PostgreSQL Tomcat, Jetty ActiveMQ, JBossMQ Eclipse, Netbeans, Aptana, Tortoise SVN If it’s not the right choice, what else would you recommend? ...

Securing webservice , valid SSL key error !

Hi ! I want to secure a webservice using Netbeans with mechansim : "Message Authentication over SSL" and I do everything that Netbeans documentation and Sun WSIT tutorial told to do. I also import the generated SSL key in client jre but when I run the client code, I still got this error : Failed to access the WSDL at: https://loca...

Using entity id as a reference in Hibernate

I would like to hold a ref of some other entity using its identifier. The object model which I am working on is huge and related entities hold lot of data. Also few pieces are cyclic in nature and I suspect that holding objects directly will be a problem. So consider following as an example say there are two entities A & B: Class A {...

Strange Spring behavior on Jetty when spring.jar is in WEB-INF/lib/ instead of classpath

I'm running Eclipse with the run-jetty-run plugin to launch my J2EE web apps. My project uses Spring, and the spring configuration uses things like HttpInvokerProxy and properties placeholder. When the spring jars are on the classpath (I mean configured in the "classpath" tab of the "run configuration") and external (not in WEB-INF/lib...

Do not understand passing parameters in seam

As I debug my seam application, it dawns on me that I don't really understand how parameter passing works. The following terminology really has me confused. So I am asking this very general question in the hopes of getting a good explanation of what works with what and what certain things are for. First of all, to get from one page to...

How does container injection of annotated private class attributes work in java?

I've started reading the Enterprise Java Beans 3.0 book by Bill Burke and Richard Monson-Haefel and in chapter 4 it has this code @PersistenceContext(unitName="titan") private EntityManager manager; The class then has methods that access this field (which is never set in the constructor and has no setter method). So how does the conta...