java-ee

Getting a Web Accessible Directory in Spring-MVC/Java

Simple problem, I need to write a sitemap to my web root directory so that it is accessible as so: http://mysite.com/sitemap.xml I want the code to look like: File f = new File( someMethodToGetWebRootDirectory() ); But I don't know what should be in that method ...

Java EE 6 and Certutil

Hi, I have installed Java EE 6 with GlassfishV3. I want to use NSS tools to manage the security of the server, i.e generating certificates using certutil. However I can't find the NSS library and tools in Glassfish. On the other hand, I read the documentations of Java EE 6 and it says that it still supports NSS! Does anybody know about...

How to know the File path in servlet.

If i upload any file in the JSP then how i know the full path of the location where the file is save on servlet. ...

@Intertceptors does not work for web bean for JSF page.

@Named @ConversationScoped @Interceptors(MyInterceptor.class) public class BeanWeb implements Serializable { public String methodThrowException throws Exception() { throws new Exception(); } } public class MyInterceptor { @AroundInvoke public Object intercept(InvocationContext ic) throws Exception { try {...

eclipse for sun one server for debugging and running application

Is there a way to add sun one application server 7 to eclipse IDE. Its for maintaining an enterprise application project. The jdk is also 1.4 used for the application. ...

Can't get JPA2 running with Hibernate and Maven

Have been trying the whole day long and googled the ** out of the web ... in vain. You are my last hope: Here's my code: The Entity: package sas.test.model; import javax.persistence.Entity; import javax.persistence.Id; @Entity public class Employee { @Id private int id; private String name; private long salary; publi...

Convert JSON query parameters to objects with JAX-RS

I have a JAX-RS resource, which gets its paramaters as a JSON string like this: http://some.test/aresource?query={"paramA":"value1", "paramB":"value2"} The reason to use JSON here, is that the query object can be quite complex in real use cases. I'd like to convert the JSON string to a Java object, dto in the example: @GET @Produce...

Java EE 6: JSF vs Servlet + JSP. Should I bother learning JSF?

I am trying to get familiar with Java EE 6 by reading http://java.sun.com/javaee/6/docs/tutorial/doc/gexaf.html. I am a bit confused about the use of JSF. Usually, the way I develop my Web App would be, Servlet would act like a controller and JSP would act like a View in an MVC model. So Does JSF try to replace this structure? Below are ...

Is JavaEE really portable?

I'm just implementing a JavaEE assignment I was given on an interview. I have some prior experience with EJB, but nothing related to JMS and MDBs. So here's what I find through the numerous examples: application servers bind their topics and queues to different JNDI names - for example topic/queue, jms the activationConfig property is...

How to auto create a JMS topic/queue on JBoss in a portable and per-application way?

It's simple: I have an MDB and an EJB that sends messages to a topic (or queue). JBoss complains that the topic is not bound to the JNDI context. I want to have the topic/queue to be automatically created at best, or at least to have a standard way to define it, per application (say, in ejb-jar/META-INF) this question and this blogpost...

How do I import javax.validation into my Java SE project?

I'm trying to add constraints checking, as described here http://stackoverflow.com/questions/2705759/how-to-specify-the-cardinality-of-a-onetomany-in-eclipselink-jpa ...

Eager / auto loading of EJB / load EJB on startup (on JBoss)

EJBs seem to be loaded lazily - whenever accessed. However, I want to initialize them eagerly - i.e. whenever the container starts-up. How is this achieved (in JBoss in particular) This topic gives some hints, but isn't quite satisfactory. ...

Why do I get error "prefix [..] is not defined" when I try to use my jsf custom tag?

I created a jsf custom tag (I'm not sure that it's correct, I could miss something easily, so I attached code below). Now I'm trying to use this tag but I get an error: error on line 28 at column 49: Namespace prefix gc on ganttchart is not defined So, here is the xhtml-page: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 T...

EJB Local/Remote interface within separate applications in a single application server instance

Assume a single application server instance that has two EARs deployed. The first EAR invokes EJBs from the second EAR using remote EJB interfaces. It is rumored that even if the invokation is implemented using remote interfaces, the application server knows that everything is within the same JVM and internally uses the remote interface...

Richfaces a4j:include loading two pages!?

I have this seemingly-innocent code on my main JSF page: <a4j:outputPanel id="sidebarContainer"> <a4j:include viewId="#{UserSession.currentSidebar}"/> </a4j:outputPanel> Here is how the sidebar changes: A jsFunction calls a backing-bean method which sets the page (like "sidebar2.jsp") in UserSession The jsFunction has "rerender...

Which are the differences/similarities between hibernate and other frameworks or specifications?

I want to know the differences/similarities between Hibernate and simple persistence in Java EE 5? I'm not clear if Hibernate implements Java EE 5 persistence implementation or if it is a totally different approach to data representation over back-end systems. I'm confused about Hibernate and its relation with the concepts about java p...

Interface design pattern / Java / Seam

Hi all, Is this possible somehow? @Name("geolocationService") public interface GeolocationService { @Query("SELECT g FROM Geolocation geolocation INNER JOIN geolocation.deployment deployment WHERE geolocation.ipStart <= INET_ATON(:ipAddress) AND deployment.active = TRUE") Geolocation findByIpAddress(@NamedParameter("ipAddress")fi...

Could you please suggest any good books for Java EE

Hi people, I am comfortable with Java SE 6 and I wanted to go deeper into Java by learning Java EE 6. However, I am confused and I don't know which book(s) should I read to master Java EE 6 (I have never learned Java EE previously). Could you please suggest any appropriate book(s) to help me master Java EE completely? Thank you for rea...

Wired component null in seam EntityHome action

I have a custom EntityHome class. I wire the dependent entity in the wire method, but when I call the action (persist) the wired component is always null. What could be the reason, similar code generated by seam gen is apparently working. Here is the entity class. The round.teeSet component is always null when persist is called, alth...

EJB3 JNDI Lookup Failure in JEE application client

I'm trying to access an EJB3 from a JEE client-application, but keep getting nothing but lookup failures. The client application is running within the JEE Application Client Container. My JEE Application 'CoreServer' is exposing a number of beans with remote interfaces. I have no problem accessing them from a Web Application deployed on...