I have three columns in my cassandra table (A,B,C). A -- PARTITIONED key, B -- CLUSTERED key I want to query on A in "list I will pass" and B -- one value. I don't want to use @query (want to use something like findAll()) Any suggestion ?You hav
I am writing integration tests for a Java EE Servlet using Arquillian + JUnit. I need to be able to execute code before the server launches. So is it possible to execute code before @Deployment? I tried @BeforeClass with no luck. The reason I need to
In my Java EE application I implemented autentication/autorization via a JDBC Realm (first time I apply this solution). Following code does not have any problem on successful login, the problem is when I type wrong credentials: it logs in anyway and
Relative newbie here. I am trying to count occurrences of objects in a J2EE web application. Very simple. I have an Oracle database, with a table called Warnings. Each warning can have one of three statuses: ACTIVE AUTOCLEARED CLEARED I have a WARNIN
I have an instance of a JBoss EAP 6.1 where i deployed 2 EJB applications. The server starts without errors! Now I have created a javaSE application to call these EJBs. And here is the problem... If I make lookup of EJB from applicationA/EJBBean!br.c
I have converted my java web project to maven project using m2e plugin in eclipse. Now i need to convert it back to java web project. So now how it is possible to change it back to java web project.Please try the following: Open context menu on the m
RequestDispatcher rd = getServletConfig().getServletContext().getRequestDispatcher("Admin/DeleteSuccess.jsp"); rd.forward(request, response); I want to dispatch the request to specified folder but it is not dispatching. It is still into the serv
I have wriiten this code which should execute a command on shell to search pattern ">" in a text file , when i try same command on shell it works fine but when i try execute same command using java , it does't work for me as buffered reader r
I want to load some information from database, and share it in Application Scope But I don't know where to write this method, can I initialize data in Application Scope when I start the server?You want a ServletContextListener, whose contextInitializ
Which of the two methods are faster especially for over 1 million rows in database? And what is best practice, to use JPQL or Criteria? CheersThe best practice is to log the SQL statements created by Hibernate and analyse their execution plans for bo
I have the impression that CDI is not working with classes that have a @javax.faces.component.FacesComponent. Is this true? Here's my example, that doesn't work. The MyInjectableClass is used at other points in the code where injection is not a probl
I'm reading about the Java API for Json Processing, specified in ths site. However, when I try to test such code like: JsonReader reader = Json.createReader(new FileInputStream(...)); I can't, cause neither JsonReader class or Json class can't be imp
I have a list of Items... public class Item implements Serializable { private Double subTotalCash; private Double subTotalCredit; private Double totalShipping; private Double grandTotal; private Integer countSubItems; private Integer countSomethingEl
I have a directory in aix which will receive files from a external application. My java program should pick only those files which are completely written by the application.It should not pick the incomplete files which are being still written by the
I use SOAPMessage.writeTo(OutputStream) to log web service messages. A problem is that it also writes attachments. It is space consuming and the binary attachments are not readable . Is there any way how to log the message without attachments, e.g. a
This is a singleton class. I wanted to know the ways to we break the singleton logic in this code class Employee{ // class starts private Employee(){} // private constructor private static Employee emp; /*static block*/ static { if (emp==null) { emp=
I mean a user ID can't be auth in two different machines at the same time. How can I control this? I'm using the Java EE platform.Every time a user logs in you give him some token (Session ID, for example). Later, when user performs some operations y
I have an Interface with Component annotation and some classes that implemented it as follows: @Component public interface A { } public class B implements A { } public class C implements A { } Also, I have a class with an Autowired variable like this
I have specified a custom annotation for use in Java bean-validation. I use the same annotation class for all of my fields and pass a string parameter with the name of the field, like this: @CustomConstraint(value="name") private String name; @C
I know the question is subjective but I need to know what is the most appropriate api/tools for charts/graphs etc in the java web application. We are working on the spring MVC application. We will need to show our data in charts, graphs etc. e.g. Wha
In my web.xml page I have the 404 error mapped to a jsp page as: <error-page> <error-code>404</error-code> <location>/WEB-INF/jsp/errorPages/error404.jsp</location> </error-page> The redirect on 404 works fine. I get to
I have one requirement to fulfill. Actually when ever user Login into my application , i will save the logged in user name in session attribute like . session.setAttribute("LOGIN_USER", userName); So that, if user tries to access my method links
I'm developing a JavaEE system (distributed on Weblogic App Server), but I don't have the sources for the JavaEE packages (javax.ejb.*, for instance). Where can I find the sources (not javadoc) for these packages?Java EE is an abstract API. It exist
I'm using Hibernate and have a problem with LazyInitializationException in my app. This problem can be simply solved by Spring framework(some annotations,config or something) but I just dont know this framework and dont want to learn it now(I'm just
I am trying to implement the "profile page" for the user of the web application. I want the user to be able to upload the image for their profile. My question is that how should this be implemented? Should I upload the image in the database as a
this far i've been working on projects without using any build manager, i've used Maven just once before and found it pretty useful, so i'd like to start implementing it on my new projects. I'm starting a Web application that uses Hibernate, JPA, Str
WebSphere comes with parent last and parent first. Is this Java EE compliant? Is this supported by all application servers that are Java EE 5 compliant?I did my own research (going through the specs and few blogs) and below is what I've figured EAR T
I am the guy who writes java controllers (mvc), who does tests with junit, who writes jdbc, who uses maven ... basically, how do I know when is this Java EE and when is not? I don't write servlets or jsps (which are part of Java EE) but I do use API
we need run one function periodically in Java web application . How to call function of some class periodically ? Is there any way that call function when some event occured like high load in server and so on . what is crontab ? Is that work periodic
Are Session Beans (stateless session beans, stateful session beans) Synchronized?Only one thread at a time will be accessing your beans. It is up to the application server to manage this. So you should not be using synchronized from within your beans