java-ee

Exception when undeploying JBoss Drools app

Hi, I am writing a JEE app with Java 6 and Glassfish. I use Drools rules engine in it and it works fine until I undeploy the application. When I do that I get this Exception over and over again. Restarting the app server is the only way to stop it. Of course that is unacceptable in productive environment... Any Ideas? Is the META-INF/se...

Generated primary keys start form 9951 instead of the 10000

Hello, I make use of: NetBeans IDE 6.7.1, GlassFish v2.1, Oracle 10g XE, JAVA 6 SE, JAVA 5 EE, From inside a stateless EJB I persist entities of type customer I have the annotation: @SequenceGenerator(name="seq", sequenceName="cust_id_seq") in the class customer so the primary keys are autogenerated in the database from the seque...

EJB or Servlet - how to add a 'kill switch' to force a process/thread to stop

Hey all, Kind of an open question that I run into once in a while -- if you have an EJB stateful or stateless bean, or possibly a direct servlet process, that may with the wrong parameters start running long on a production system, how could you effectively add in a manual 'kill switch' for an administrator/person to specifically kill th...

Getting Entitymanager/EJB inside a @FacesConverter/Validator of a WAR-packaged app

I have a JavaEE6-application running on Glassfish v3.0.1 with EJB 3.1 (app is packaged as WAR), and all my EJBs are @LocalBeans. Currently, i'm writing a FacesConverter for use in JSF2, in which i need the EntityManager to get an Entity back from an id. Now i wonder, which is the best and cleanest way to get the Entitymanager inside th...

how to resolve these exceptions in netbeans?

http://blogs.czapski.id.au/wp-content/uploads/2010/03/02_PatientSvc_MakeHL7v2DelimDataFromCustomDelimRecords_data2.zip i have to deploy the project on given location it is build successfully but when i deploy this project it gives following exceptions and errors ERROR: Failed execution of Start: HL7Feeder_CA * Component: sun-bpel-e...

Is @EJB not supprted in JBoss 5.1.0 GA?

I've been struggling for this for a while now. I'm trying to gear up for EJB 3.0. I'm using JBoss 5.1.0 GA as my application server. I started with very simple stateless session bean with local interface and a simple jsp-servlet client which invokes session bean method. All this while I've been trying to use @EJB annotation to inject s...

Understanding Java Web development and separating logical tiers

When developing Java EE applications how do I separate Business Logic so it can be reused? I inherited an application that is mostly Model 1. Business logic is located in JSPs, Servlets and DAO code. I want to separate the business logic but I am confused by all of the frameworks etc. that exist. I am looking into Hibernate with JPA ...

JAX-RS using exception mappers

Hello, I have read that I can create an implementation of javax.ws.rs.ext.ExceptionMapper that will map a thrown application exception to a Response object. I've created a simple example which throws an exception if the phone length is greater than 20 characters when persisting the object. I am expecting the exception to be mapped to...

Could you recommend a good quick introductory Java EE 6 tutorial?

Can you point to a good quick short (not something 714 pages like the official one) introductory Java EE 6 / EJB 3.1 tutorial for one who can code general Java and SQL but has no idea of what an EJB really is? ...

How to load multiple jax-ws web services inside a single spring container

We are working on a SOA Project consisting of multiple web services. Each web service is based on Metro JAX-WS Framework and internally uses spring and hibernate.Each web service loads as a web-application inside a separate spring container. This means that our deployment architecture consists of multiple web-applications each running ...

Java EE 6 Security Model: How to add or delete user

I read most of the documentation, I only see the use of @RolesAllowed or @DeclareRoles, how can I add user or delete user. I have a table of users with username and password in my database, how can I make my web app to authenticate those user? How can I map these user (principal) to a particular roles. Samples code would be greatly appre...

JBoss Custom lib directory

I have this third party framework which comes with a huge set of dependent libraries, which by the way, have not yet been indexed in any Maven repository. I want to use this framework with some Web Apps, but for obvious reasons I don't want to put all those libraries under WEB-INF/lib, neither do I want just to place them all under serve...

JAX-WS vs. JAX-RPC

I wrote 2 webservices, one with Jax-WS and one with Jax-RPC. They just return a String. I stress-tested both with jMeter and, strangely, thereby Jax-RPC was a bit faster. When do I really profit of Jax-WS in aspects of performance (response time, CPU-time, heap)? How can I proof it? thanks for your time! =) ...

How to stop threads when undeploying a JEE application?

I undeploy my JEE app that uses an asynchronous logger that logs in its own thread from the Drools rules engine. I use it to log decisions the rules engine makes but I cannot let it have impact on the throughput, therefore it must run in its own thread. I get pages of Exceptions when I undeploy it indicating that it was not closed prope...

How do I know when a JEE app is undeployed?

I need to close some streams when my jee app is undeployed to avoid pages of exceptions in the server.log every time I undeploy. The Exceptions say: "Input stream has been finalized or forced closed without being explicitly closed". I know how to close (with the close() method), but I dont know when. finallize() comes too late, @PreDes...

What versions of related technologies apply to J2EE 1.4, 5, and 6?

So I've had some hairpulling experiences lately because of coming onto projects being developed using one technology (say Tomcat 6) but having to deploy to another (say Oracle 10g R3). Differing application servers aside, multiple times I've had to downgrade J2EE specs say from J2EE 5 to J2EE 1.4 and in doing, had to scour the web to fi...

JPA Entity Validation

Ok, I'm trying to setup an application in a Java EE Container. I use JPA for persistence and I also use the javax.validation.constraints.* constraints. By default the container validate the entities during the @PrePersist and @PreUpdate lifecycle events and it's good for me, but how do I handle the ConstraintViolationException? I can't...

best server in java in terms of load handing

Can any body say which one is the best server in terms of handling the load. Can any body give the matrix which comprises different servers and their capacities. ...

What is the default classpath for EJBs?

Please forgive my pitiful knowledge of Java EJBs but, when an EJB is deployed to an application server as a .jar file, where do things like Hibernate and log4j first look for their configuration files (hibernate.cfg.xml and log4j.properties) in the .jar file? ...

How can I trigger a Java servlet function when mail is received?

I am aware that Google App Engine can capture email and fire a function, but I would like this functionality in a Tomcat, Glassfish, or any other Java server. I would like to avoid setting up a mailbox and running a cron job every few seconds or minutes. A Java class and some server configuration would be ideal, but I have no idea where...