java-ee

Exception inside CORBA when accessing a remote bean

对着背影说爱祢 提交于 2019-12-19 10:12:45
问题 On Windows Server with Glassfish 4.0 and JDK 1.7_55 I getting NoClassDefFoundError and ClassNotFoundException then invoking remote bean methods. StandardWrapperValve[action]: Servlet.service() for servlet action threw exception java.lang.ClassNotFoundException: com.sun.corba.ee.impl.orb.ORBSingleton at java.net.URLClassLoader$1.run(URLClassLoader.java:366) ... at com.sun.corba.ee.impl.presentation.rmi.codegen.CodegenStubBase.invoke(CodegenStubBase.java:226) at dudge.ifaces.__SolutionRemote

How to change default JSP/template location with Struts2

风流意气都作罢 提交于 2019-12-19 09:44:48
问题 I'm working on a new Java EE application that uses Struts2 in Eclipse. I want to keep the JSP files in the source folder ( src/main/jsp ) and not in WebContent . When deployed, the all source files get copied over to WebContent/WEB-INF/classes . This also has the bonus effect of making the jsp files inaccessible directly (I want everything to require action intervention). This means that to make results display, I have to do this: <result name="SUCCESS">WEB-INF/classes/index.jsp</result> Is

CDI call interceptor annotated method within same instance

梦想的初衷 提交于 2019-12-19 09:39:24
问题 here is my DAO implementation, i will load the whole table and cached in memory for a certain period of time @ApplicationScoped public class DataAccessFacade { @Inject private EntityManager em; @CacheOutput public Map<String, String> loadAllTranslation() { List<Translation> list = em.createQuery("select t from Translation t").getResultList(); Map<String, String> result = new HashMap<String, String>(); // do more processing here, omitted for clarity return result; } public String

maven cyclic dependencies

主宰稳场 提交于 2019-12-19 09:28:22
问题 I have a modular maven project, in which two modules, "BIZ" and "EJB" contain somthing like this: //PART OF "BIZ" Module: public interface MyInterface{ public void foo(); } ............................................ public class ImplFactory{ public static MyInterface getInterfaceImplementation(){ MyInterface ret=null; Class<? extends MyInterface> cl = null; try { cl= (Class<? extends MyInterface>) Class.forName("InterfaceImpl"); ret= cl.newInstance(); } .... ret ret; } .....................

Java EE 6 Programmatic security, glassfish and JDBC realm

北战南征 提交于 2019-12-19 09:23:38
问题 I'm exploring pure Java EE ways of doing programmatic security, especially login users, based on the jdbc realm from my glassfish server. So basically, in my login servlet I'm doing String username = request.getParameter("username"); String password = request.getParameter("password"); try { request.login(username, password); .... Without doing anything in my web.xml, the default realm (file) is used. I don't want that, I want to use my jdbcRealm named jdbcsecurerealm. So I'm adding the

How to configure Maven pom for Tomcat 7 with JSF 2.0 and EL 2.2?

百般思念 提交于 2019-12-19 09:17:26
问题 i want to use EL 2.2 for JSF 2 application and tomcat 7 is provided with EL 2.2 and i am confused about the following: 1- Should i provide the servlet-api , jsp-api and the EL in my pom file (using maven) as provided or don't include them at all in the pom file, since they are provided by container, what's the difference ? <dependency> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> <version>3.0</version> <scope>provided</scope> </dependency> <dependency> <groupId>javax

why we can't initialize a servlet using constructor itself?

江枫思渺然 提交于 2019-12-19 09:07:03
问题 Why do we have to override init() method in Servlets while we can do the initialization in the constructor and have web container call the constructor passing ServletConfig reference to servlet while calling constructor? Ofcourse container has to use reflection for this but container has to use reflection anyway to call a simple no-arg constructor 回答1: Since a constructor can not be part of an interface, it can not be "formally" specified within the Servlet API, unlike normal methods.

Using Servlet 3.0 with Weblogic 10.3

ⅰ亾dé卋堺 提交于 2019-12-19 08:58:52
问题 I am working on a form-based authentication and using following statements. I have realized on the way of implementation that HttpServletRequest->login method comes with servlet 3.0.(with help of stackoverflow users) HttpServletRequest request = getHttpServletRequest(); request.login() So I am using weblogic as an AppServer, I have prepared a war file without any compilation error and it works at glassfish 3.1 appserver. But since weblogic 10.3 has implicit support 2.5 it overwrites Servlet 3

Java mail how to send automatically an email on condition

青春壹個敷衍的年華 提交于 2019-12-19 08:20:11
问题 Never used Java mail before. In my JSF web app, I have an entity (followUp) with a property private Date checkDate; that corresponds to an Animal entity. (An Animal has many followup records). Otherwise: The user must each 3 months create a new record in {followUp} and mark it as checked and supply the date of his action which is "checkDate". But since the user is so lazy, he does that for only few Animals. So he actually wants to be alerted by email for Animals that have not been checked for

Install log formatter in glassfish

拥有回忆 提交于 2019-12-19 08:20:08
问题 I don´t like the output of the com.sun.enterprise.server.logging.UniformLogFormatter which might be uniform but not very helpful. So in a first step I just replaced it with the java.util.logging.SimpleFormatter . This actually works fine but for a java.lang.ClassCastException exception: java.lang.ClassCastException: java.util.logging.SimpleFormatter cannot be cast to com.sun.enterprise.server.logging.UniformLogFormatter Being a perfectionist I want to get rid of this exception and I wonder if