j2ee

Single sign-on in J2EE

I am trying to implement single sign-on between 2 J2EE applications. Both these applications share the same registry - LDAP. I would like to navigate from one application to another with only one authentication. I use WAS 6/RAD 7 and i have configured my server to enable SSO. What changes do i have to do in my application(s)? How do i t...

Space-based architecture?

One chapter in Pragmatic Programmer recommends looking at a blackboard/space-based architecture + a rules engine as a more flexible alternative to a traditional workflow system. The project I'm working on currently uses a workflow engine, but I'd like to evaluate alternatives. I really feel like a SBA would be a better solution to our b...

How do you manage embedded configuration files and libraries in java webapps?

I'm currently working on a j2ee project that's been in beta for a while now. Right now we're just hammering out some of the issues with the deployment process. Specifically, there are a number of files embedded in the war (some xml-files and .properties) that need different versions deploying depending on whether you are in a dev, testin...

How To Configure Query Cacheing in EclipseLink

I have a collection of states, that I want to cache for the life of the application, preferably after it is called for the first time. I'm using EclipseLink as my persistence provider. In my EJB3 entity I have the following code: @Cache @NamedQueries({ @NamedQuery( name = "State.findAll", query = "SELECT s FROM State...

Webservice problem with base64 data when upgrading to JBoss 4.2.3

Hi, This is a long one du to config files... I'm running a upgrade from JBoss 4.0.5 to 4.2.3 The system I work with have a legacy webservice. It is based on J2EE webservices 1.1. It has a SLSB (EJB2) as endpoint. The WSDL file points out a schema (XSD-file) file for the definition of the parameters to the webservice. And there is a mappi...

HTTP Connection Pooling in GlassFish

In my webservice, I need to place some HTTP calls. Is it possible to do some connection pooling, like I do JDBC connection pooling? In the Admin Console of GlassFish I see the configuration items Connector Connection Pool and Connector Resources. Can I use these? ...

JPA reserverd keywords to postgres

I'm using JPA with a postgres DBMS and I'm trying to create a new entity that maps to the table "User". This is a very common problem as User is a reserved word in Postgres. My question is, how can i "escape" the reserved keyword or set JPA to escape it? I tried @Table(name = "\"user\"") with no luck: 2009-02-25 15:43:14,218 ERROR...

What tag libraries you know for J2EE JSP, something like displaytag, tinyMCE, and other useful stuff for new J2EE Developer ?

What tag libraries you know for J2EE JSP, something like displaytag, tinyMCE, and other useful stuff for new J2EE Developer. ...

Java EE security - application clients

Hi. I'm writing on a Java EE project which will have everything from 3-6 different clients. The project is open source, and I wonder what security mechanisms one could/should use. The problem is: Because it is open source, I would believe that it is possible for anyone with a user to write their own client (maybe not realistic, but trul...

How to execute a function immediately after authentication

My question is this: With a web application, after performing a login authentication for a protected resource, how can I run some sort of function (in this case, I want to run a function to initialize some user-dependent session-scope variables) BEFORE the web-app redirects to the protected resource. I am programming a web application ...

How to find creator of JmSession closed by CachedConnectionManager in JBoss

Hi I am getting the following error in my logs on JBoss 5.0.1 with JBPM. I can't for the life of me work out where this session is getting opened and not closed (wherever we use JMS we cleanup the collection inside a finally block). 2009-03-05 13:11:12,595 INFO [org.jboss.resource.connectionmanager.CachedConnectionManager] (WorkerThre...

Correct: Java "enterprise" edition = Java "internet" edition?

I am reading books on middleware, Spring, Hibernate, etc., and am wondering myself why the developer invented a new name, i.e. "enterprise edition" for Java "web" or "internet" libraries? As I have a quite individual mindset, "enterprise" edition sounds almost like "socialist" edition... what do I need to know to differentiate better? ...

Writing on a separate thread for a web app.

For one of the URLs that my clients will be calling, I want it to return as soon as possible with minimal disruption, so even if the database is down or slow, the request still returns pretty fast. I still need to do some processing of the data sent, so I am thinking about having a separate "queue" that holds the data and then process ...

Spring vs Jboss

What are the advantages and disadvantages for Spring vs. Jboss for an enterprise web application. ...

Spring Controller destroy method?

Does Spring's Controller have any sort of destroy/cleanup method? I couldn't find anything in the JavaDocs for Controller and AbstractController. I'm looking for the equivalent of javax.servlet.Servlet's destroy() method. The reason for this is that I'm starting a thread in my Spring controller. I want the thread to terminate whenever t...

How can I select the local interface for an EJB?

Say I have the following EJB (using ejb3): @Stateless(name="Queries") @Remote(Queries.class) @Local(Queries.class) public final class QueriesEJB implements Queries { ... } The class is available through both a local and a remote interface. How can I inject the local interface for this EJB in another part of the app? Specifically...

How can I make a custom resource also be lookuped in glassfish by the java:com/env-scheme?

I've created some JDBC resources and Custom resources in GlassFish. I named JDBC resource jdbc/mydb and the Custom resource service/test. The JDBC connection is lookedup with the call ic.lookup("java:comp/env/jdbc/mydb"). It can also be found with ic.lookup("jdbc/mydb"), which has some disadvantages, see answer of Robin below. But my ...

Quickly output Session ID within a .JSP?

I would like to quickly output the current session id on a .jsp page for debugging purposes. Is this possible? Does anyone have a JSP snippet that does this? Thanks very much! Edit: I found what I was looking for: <c:out value="${pageContext.session.id}"/> ...

How to create a URL in a servlet?

Hi, i want to know how to generate a url in a servlet. I have a login servlet, and every time that add a user i want to gen. a url for each user profile. Can anyone help me please? ...

Scalability of J2EE Application. How would you approach it?

I've been working on the solution for financial industry. The main functionality of the application is the ability to load massive input files, digest them, update state in persistent store and generate extracts from persistent store on request. Pretty straightforward. The input files are industry standard formatted XML large (more that...