j2ee

How to have a @OneToMany relationship with its own entity?

I have items that can contain further items, therefore I need a @OneToMany relationship with the same Entity. I have configured my field like this: @ManyToOne(targetEntity=PersistentItem.class, fetch=FetchType.EAGER) @JoinColumn(name="ID_CHILDREN", nullable=false) HashSet<PersistentItem> children=new HashSet<PersistentItem>(); However...

Welcome file chosen based on assigned roles (Java web app)?

I have a Java web application running on JBoss using JAAS for authentication. I would like to dynamically select the page a user logging in is shown based upon their roles as I have disjoint sets of users that shouldn't have access to the same pages. I've tried using a Filter, but Tomcat denies access (correctly) to the requested URL be...

Which J2EE server should I use?

OK, this is a little unusual, because ANY J2EE container can do the simple things I want to do (XML processing, JPA, Hibernate, SOAP/REST web services, etc). This is for personal use, more to gain skills than to accomplish essential functionality. I have my own Linux server (Ubuntu Jaunty x86_64) with business class internet, so I can ...

How to visualize sent XML stream with a CXF generated client

Hi ! I would like to be able to see the XML Stream generated by my CXF generated from WSDL client. Is there a way to do this ? For example, I'm building my request with Java objects, and I would like to see the XML stream built by CXF before it sends it to the server. Thank you for your answer ! ...

Junk from vendor libraries flooding log4j

How can I best prevent these libraries from flooding my own apps log4j bus? I do not want to set everything to ERROR, but at this rate the vendor library is flooding up the log file at a rate of about a gig/day. I do not want it to log anything to this file... ...

How / when to delete a file in java?

The problem is, user clicks a button in JSP, which will export the displayed data. So what i am doing is, creating a temp. file and writing the contents in it [ resultSet >> xml >> csv ], and then writing the contents to ServletResponse. After closing the respons output stream, i try to delete the file, but every time it returns false. ...

Using external properties files in weblogic

I am working on deploying a J2ee application that I have previously been deploying in JBOSS into Weblogic 10.3.1.0. I am running into an issue with external properties files. In Jboss I can just put the properties files into $JBOSS_HOME/server/default/conf, and they are loaded onto the system classpath and I can access them without any...

hibernate collection mapping with list and super entity class

hello good fellas! here i am again in my self learning hibernate and personal experiment project to gain more understanding. Here is the description of my environment: i have a super model entity that all my model inherit from.it has only id property i use the genericDAO pattern found on hibernate web site. Now my problem is that i use ...

How to Implement Custom tags

How do I create custom tags or implement a tag-handler class? Can you provide an explanation with a simple example? ...

J2EE Application using local disc - How bad is this?

Ok, so we have this application we've been forced to install on our servers. It's a single war-file and when you first log into this application it creates a folder on the local disc. And for some reason the application stores data here. Some kind of statistics and data. This application also uses a database. God knows why they can't s...

Please suggest me a J2EE book

Hello everyone, I'm a developer pretty much experienced in web development (HTML, JavaScript, PHP, Django, Ruby on Rails). I have just recently taken on Java (read "Core Java" and the SCJP 6 book) and I now want to start with J2EE. I need a book that will go through the most important aspects (EJB/JSF/etc., I know the buzzwords :) ) of ...

Java: A good introduction to J2EE platform for noobs

The question says it all; what are some good introductory resources for getting a good overview of J2EE framework(preferably ones with examples)? ...

Advantages and Disadvantages of J2EE vs. Servlets

What are the primary reasons for using the J2EE (EJB's) over just a simple servlet implementation? I am working on developing a new project that will primarily be a web service that must be very fast and scalable. Sorry for any confusion, Although I am experienced in Java, I am very new to the Java Web world, and may not be asking thi...

How to start an EJB Timer on deployment?

I need to create an interval Timer that is set to run once a week automatically. I don't want it to start based on user input, but I want it to be created when the application is deployed to the server. Every example that I have seen has another class starting the timer. I don't want to use a message driven bean to create the timer becau...

How to change the path of displaytag.properties?

Currently i have placed the Displaytag.properties in 'src' directory, and it is working fine. Is it posssible to have this file on some different location like src/comp/bre/sub/config ? ...

Catching every exception in j2ee webapps

First, I am throwing run time exceptions for all unrecoverable exceptions, this causes these exceptions to travel up to the conainter, where I currently use an error page (defined in web.xml). In this error page is a scriptlet that invokes the logger. The issue I am having with this is that the exception is no longer on the stack at thi...

How do I create an EAR file with an ant build including certain files?

I'm using eclipse to build an ear file using ant. I'm using oc4j, and I want to make sure that orion-application.xml is included in the build. What I'm currently using but does not work is: <target name="ear" depends=""> <echo>Building the ear file</echo> <copy todir="${build.dir}/META-INF"> <fileset dir="${conf.dir}"...

Java Web Services Container

I have just started learning Java Web Services ( JAX-WS ) and have one question. The reference documentation always talks about Web Services container. My question is : What is a Web Services container and why do we need it. I saw a simple example of JAX-WS in book "java web services up and running" where the web service is published usi...

Invoking Java code across Application Server cluster nodes

Let's say I have a Java webapp deployed on some Application Server with clustering across a few nodes. In the webapp, we maintain a cache of some values retrieved from the database, stored in-memory as static variables. Whenever a user performs an update in a particular screen, we clear the cache so that the cached values will be retrie...

How do I configure tomcat to handle bad HTTP clients?

We're running jBoss 5.1, which in turn uses the Tomcat servlet container. We've been seeing some cases where bad HTTP clients will open a socket, make an HTTP request, fail to read all data and fail to close the connection. The outcome is that the tomcat threads block indefinitely trying to write to the output stream: SocketOutputStre...