Why does it say null URL and gives a empty ‘ ‘ class in the exception when I have provided the database URL? I am trying to connect to a derby database via a servlet while using Tomcat. When the servlet gets run, I get the following exceptions: Servlet : What exception is this? Why do I get this exception?
Tag: jakarta-ee
EJB 3.0 test client working without maven but not with
here is my problem, I made an EJB with maven and 2 test clients, a test client without maven, only added jnp-client and the EJB to it’s class path, work like a charm a test client using MAVEN, added the EJB through the POM and jnp-client, does not work this is my EJB : it’s POM : this is my
Problems with making a query when using Enum in entity
I have the following in a Question entity: and I am getting this exception: Exception Description: Error compiling the query [Question.countApproved: SELECT COUNT(q) FROM Question q WHERE q.status = ‘APPROVED’], line 1, column 47: invalid enum equal expression, cannot compare enum value of type [myCompnay.application.Status] with a non enum value of type [java.lang.String]. at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:501) How do I fix this?
Glassfish V2.1.1 Heap size never decrease after server batch job
I’ve set up a glassfish cluster with 1 DAS and 2 Node Agents. The system has TimedObjects which are batched once a day. As glassfish architecture, there is only 1 cluster instance allowed to trigger timeout event of each Timer created by TimerService. My problems is about Heap size of a cluster instance which triggers batch job. The VisualVM shows
JaxbRepresentation gives error “doesnt contain ObjectFactory.class or jaxb.index”
I am trying to create a sample test application which converts an object to JaxbRepresentation. But when I try to run this, it gives me an error. Main.java file TestResource.java file SampleResponse.java file When I run this on the server, it throws the following error: Please someone help!!! Answer To get rid of additional jaxb.index files you may use Java
What is the difference between Servlet response methods addHeader and setHeader?
Can I use setHeader to set an new header? Or Do I need to addHeader first, then use setHeader method? Answer The documentation says that you can add multiple values to a particular header using the addHeader method, whereas an initial value would be overwritten if you use the setHeader method. In both cases a non-existent header would be created.
How to handle exceptions in Java Web Applications?
i would like to handle my exceptions in a way to warning the user about the errors that occured . What i know is something like: This is the best approach ? If not, what would you suggest ? Best regards, Valter Henrique. Answer An exception can be handled in different ways. In this case, it seems that the exception
Sharing Cookies Between Sub Domains in java?
I have some cookies stored in http://sub1.myserver.com and I want to be able to see them in http://myserver.com Answer I was able to do it using the following code:
How can I create Java web service (jax-ws) with array or List as a parameter
I’ve got a problem with a web service which has an array or List as parameter. Here is example: When I call printList from web service client the result is always “list is empty” The same is when I use array of String. Should I use some additional annotations or something? Answer Your code is perfect, it seems you are
Mapping array with Hibernate
Can you please help me to map this class using Hibernate? I’m using PostgreSQL and the column type in the table is integer[] How my array should be mapped? Answer I have never mapped arrays to hibernate. I always use collections. So, I have slightly changed you class: