Servlets :: Blocking Users After Failed Logins

Jan 21, 2014

Question : What would you do block a user if he fails to login in 3 consecutive attempts ?

My Answer : I will make use of Session object, so that server could identify that all 3 requests came from the same system.

Dont know if i am right .

View Replies


ADVERTISEMENT

Servlets :: Module For Multiple Users

Nov 3, 2014

I have to design/develop a module in java eg. Login. This module can be accessed by multiple concurrent users say 200, 500, 800 etc.

How such type of modules can be designed in such a way that it can perform successfully.

What are the main concepts at code level / Infrastructure level which we should take care while designing such modules.

View Replies View Related

Servlets :: How To Handle Request Independently For All Users

Oct 11, 2014

How is this possible? Here is the servlet page.

/**
* Servlet implementation class InvoicingDeptServlet
*/
@WebServlet("/InvoicingDeptServlet")
public class InvoicingDeptServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
//Make arraylist global object
ArrayList<InvoiceData> invoiceList = new ArrayList<InvoiceData>();

[Code] ....

View Replies View Related

Servlets :: Count Number Of Users Accessing Web Application

Aug 30, 2010

In our web application we are using servlets,jsp and spring technologies.Here we are also maintaining session mechanism in our application.But now i need to count number of users accessing our web application at a time. How can i implement this mechanism...

View Replies View Related

Servlets :: Capture Audit History Reports Of All Activities Of Users Within Application

Oct 11, 2014

For one of my project, required to capture the audit history reports of all the activities of the users within the application.
We are using Servlet/JSP in J2EE environment.

For Ex: Whenever user updates some fields, we need to capture the Old value, new value, user id and time stamp. We have single form with more than 200 fields.

Just want to know the best way to do this..any frameworks available for it...or doing at the database side like using triggers..

View Replies View Related

EJB / EE :: Preventing Multiple Logins Into Web Application Simultaneously

Mar 31, 2014

It sounds simple enough, but I'm trying to implement a mechanism to prevent the same user logging into our distributed web application simultaneously.

So, given the scenario...
- user A logs in with username A
- user B logs in with username A

I want the logging in of username A by user B to invalidate the session for username A held by user A. So if people are sharing login credentials, the last person to log in kicks everyone else out who's logged in as that user.

The big problem I have is the application is deployed in a cluster across JVMs, so sessions are shared across nodes. My thought it to introduce a session listener to then inspect a table in the database which determines whether that user logged on - the part of identifying that is pretty simple as far as I can tell. The difficult part is kicking out the first user who logged in.

So, I guess my question is - can I invalidate an http session from with an MDB? If so my logic is to implement an MDB which listens on a topic and whenever a session is created that MDB checks for sessions belonging to the same user within that JVM to invalidate them (obviously skipping the JVM the login request came in on!).

Is that even possible? Is there a simpler way to do this?

View Replies View Related

Synchronized Is Blocking

May 12, 2014

I'm just starting up with Java Mulithreading.Below is the repo I set up, and I am having trouble with this test I am doing playing around with Executor threadpools. I am trying to setup a managed system where I first add some lines to be printed, then add the work to the work pool, and then finally launch n number of threads to handle the work (or in this case, print out the strings I added to WorkManager instance fields). I watched this series of videos starting with this one: URL...., and I planned on playing with the concept of multithreading, but it doesn't seem to work and gets stuck at Thread1:27. I thought that by synchronizing access to the ListIterator return, that it would not block. URL....

View Replies View Related

JDK 1.7 - Java Application Blocking

Apr 6, 2014

I use JDK 1.7.

My java application is blocking from time to time. I have added some log lines and now I know exactly where is blocking, but I have no solution to fix it.
 
This code runs in a parallel thread, distinct from the main application thread and updates a big JTextArea swing:

try {
....
    JTextArea element = (JTextArea)add_containers[objColIndex];
    System.out.println("setEditValue start seting text ");
    element.setText(VAL);
    System.out.println("setEditValue text is set ");

[Code] ....

The code reaches "setEditValue start seting tex" but never reaches "setEditValue text is set". No exception is triggered. The whole application is blocked - main thread and this paralel thread. This section of code is called many times, but in rare cases is blocking without any apparent reason. Sometimes I run the exact same instructions and is blocking and sometimes is working.

View Replies View Related

Array Blocking Queue And Inundation Of Data

Jul 24, 2014

I set the limit to 2 so the producer blocks after two insertions until an item is consumed. Because we are dealing with a basic counter that increments, we do not lose any data. Since after queue is freed up we simply increment by 1, so we are able to store all numbers. However, in real world situation, you might be storing data coming from redis server into the queue. And redis server may be publishing a plethora of data. So when the queue blocks, and new data comes in, what happens? Is the currently blocked data lost forever and the new data that came in is now blocked, or is the new data that came in ignored and the old data remains being blocked until queue is freed up?

Java Code:

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;
public class BlockingQueueBlocking {
private BlockingQueue<Integer> sQueue = new ArrayBlockingQueue<Integer>(2);
int counter=0;
private void test() throws InterruptedException{

[code]...

View Replies View Related

Client-Server Mini Program Is Not Communicating Right - Blocking Read Line Does Not Block?

Feb 3, 2014

Me and my brother decided to make a relatively simple client/server program where clients get into a simple chat lobby and can invite others to play small games(like pong). The basic server code has been written, and we have made a special client that is used for debugging.

We use a self-defined protocol of Strings where a message looks like "4-|user,pass". The number before the delimiter "-|" is the operation code, that tells the server what kind of message this client sends. Based on that number, the server dispatches the message to the appropriate handler method. 4 is authentication for example, and the handler looks the user and pass up in a file and if found, returns true, otherwise, false. Then the server responds to the clinet with 2-|"any message" where the client will recognize opcode 2 as a "authentication accepted" and proceed with the next part of client code. In a similar way, we plan to write all message types(both in the game, in the lobby and in a game setup room).

While testing we ran into a problem where the BufferedReader .readLine() does not seem to be a blocking call like it should be, so the client keeps spamming 'null' in the output field that we made to see the server response to the message we send. When we try to debug the server code and set breakpoints at the suspicious locations, it strangely skips both while(true) loops without activating either breakpoint and executes the finally{} code, even though the client did not close the connection and the second while loop was never entered. The first while loop IS entered though, because the test client gets a "0" on its output, which is the server message indicating "please authenticate yourself".

We decided to use messages in a string format and decode it at both sides as it seemed easier than transmitting java objects and making sure they are of the same type, also for reducing overhead as much of possible.URL....

package Chatroom;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.HashSet;

[code]....

View Replies View Related

JVM Failed To Initialize

Apr 29, 2014

What's up with this. Just trying to test my hands on java packages, and had this error(by java) after successful compilation:

Error occurred during initialization of VM
java.lang.Error: Properties init: Could not determine current working directory.
at java.lang.System.initProperties(Native Method)
at java.lang.System.initializeSystemClass(System.java :1119)

Main.java

package com.aceix.simplecalc;
import com.aceix.simplecalc.inputhandler.InputHandler;
import com.aceix.simplecalc.mathoperation.MathOperation;
 public class Main {
 public static void main(String[] args) {

[Code] ....

Any suitable way to accept input from console.

View Replies View Related

JavaMail - OAuth Connection Failed

Aug 5, 2014

I tried to connect oAuth2 with gmail. In command line, no problem. But with Javamail it failed.

The source of the exemple are here : [URL] ....

Last modified is in 2012 then, maybe, this code is obsolete.

In command line it works fine :

Java Code:

openssl s_client -crlf -connect imap.gmail.com:993
A002 AUTHENTICATE XOAUTH2
+
my_token_who_end_with__
Response : A002 OK myaddress@gmail.com ForName Name authenticated (Success) mh_sh_highlight_all('java');

For information :

- it failed with token and refresh token

- here are the logs :

Java Code:

DEBUG: getProvider() returning javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Oracle]
DEBUG IMAPS: mail.imap.fetchsize: 16384
DEBUG IMAPS: mail.imap.ignorebodystructuresize: false
DEBUG IMAPS: mail.imap.statuscachetimeout: 1000
DEBUG IMAPS: mail.imap.appendbuffersize: -1
DEBUG IMAPS: mail.imap.minidletime: 10

[Code] ...........

View Replies View Related

Getting Build Failed When Running Program In Netbeans?

May 28, 2014

I am trying to run my program through netbeans and I get a message:

...build-impl.xml:1048 the module has not been deployed.
see the server log for details.

The corresponding line in the xml document is:

<nbdeploy clientUrlPart="${client.urlPart}" debugmode="false" forceRedeploy="${forceRedeploy}"/>

And in the server log there is a long list of comments, the first which looks to be of significance to this issue is:

WARNING [http-apr-8080-exec-57] org.apache.catalina.deploy.NamingResourcesImpl.cle anUp Failed to retrieve JNDI naming context for container [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/transBoard]] so no cleanup was performed for that container
javax.naming.NameNotFoundException: Name [comp/env] is not bound in this Context. Unable to find [comp].

There are others further down the list which might also be significant such as:

SEVERE [http-apr-8080-exec-59] org.apache.catalina.core.ContainerBase.addChildInt ernal ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/transBoard]]

The corresponding line of code for the first warning that I listed is for the DataSource object and I wrote it as follows:

dataSource = (DataSource)
ic.lookup("java:/comp/env/jdbc/trans_board");

I'm pretty sure the issue has something to do with connecting to the database since it ran fine before I added the database related code.

View Replies View Related

JSP :: Failed To Load Or Instantiate TagLibraryValidator Class

Apr 2, 2010

Currently my application is on Tomcat5.0.16.I use struts1.2, jstl 1.1 , jsp-api 2.0.I tried to migrate my application from tomcat5.0 to tomcat 6.0.26.I didn't see any issue in deployment but when i tried to access jsp pages i got this exception.

HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: /pbuilder/login/legacyLogin.jsp(6,4) Failed to load or instantiate TagLibraryValidator class: org.apache.taglibs.standard.tlv.JstlCoreTLV
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:88)
org.apache.jasper.compiler.Parser.processIncludeDirective(Parser.java:297)

[code]....

i found that jstl1.1 jar didn't have the above mentioned class.I replaced jstl1.1 with jstl1.2 jar.i verified that jstl1.2 jar had JstlCoreTLV calss.but even after this replacement of jar i am facing the same issue.

View Replies View Related

Failed To Compile - Main Method Not Found

Aug 17, 2014

class DrumKit {
boolean topHat = true;
boolean snare = true;
void playTopHat() {
System.out.println("ding ding da-ding");

[Code] ....

View Replies View Related

Failed Conversion Error In Print Line

Jan 10, 2015

I don't get an in code error but when I run this one it crashes at the print line "failed conversion error". I've used this style format in another program and format worked ok, what doesn't it like

public class Commission { 
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// Calculate Commission and payment due
double subtotal;
double granuity;
double paymentDue;
 
[Code] ....

View Replies View Related

Why To Get Build Failed When Running Program On Netbeans

May 29, 2014

I am trying to run my program through netbeans and I get a message: build-impl.xml:1048 the module has not been deployed. see the server log for details.The corresponding line in the xml document is:

<nbdeploy clientUrlPart="${client.urlPart}" debugmode="false" forceRedeploy="${forceRedeploy}"/>

And in the server log there is a long list of comments, the first which looks to be of significance to this issue is:

WARNING [http-apr-8080-exec-57] org.apache.catalina.deploy.NamingResourcesImpl.cleanUp Failed to retrieve JNDI naming context for container [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/transBoard]] so no cleanup was performed for that container
javax.naming.NameNotFoundException: Name [comp/env] is not bound in this Context. Unable to find [comp].

There are others further down the list which might also be significant such as:

SEVERE [http-apr-8080-exec-59] org.apache.catalina.core.ContainerBase.addChildInternal ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/transBoard]]

The corresponding line of code for the first warning that I listed is for the DataSource object and I wrote it as follows:

dataSource = (DataSource)
ic.lookup("java:/comp/env/jdbc/trans_board");

the issue has something to do with connecting to the database since it ran fine before I added the database related code.

update: my server.xml file is as follows:

<?xml version='1.0' encoding='utf-8'?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership.The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

[code]....

View Replies View Related

Process Failed To Respond - Forcing Abrupt Termination

Feb 15, 2015

My code compiles successfully, but when executing I never get an output, and then the message: ">Process failed to respond; forcing abrupt termination...". Is there an infinite loop in my ab method, is that why?

public class Test{
boolean ab(String s){
boolean seenAnA=false;
while(true){
if(s.charAt(0)=='a'){
seenAnA=true;
s=s.substring(1);

[Code] ....

View Replies View Related

Analyzing And Fixing Failed Cases In Stress Testing

Apr 29, 2014

There are few modules in our application whose performance degrade with time when 50-100 simultaneous users are working on them at a given instance.The memory allocations are taken care of to allow maximum data.My issue to where to start finding the root cause.

I am currenlty using JvisualVM for profiling and finding memory leaks..Do i need to Simualte 50-100 virtual users and start finding the memory leaks with JvisualVM or working with a single user would do ?

View Replies View Related

Java Program That Tells Whether A Student Hass Passed Or Failed

Oct 21, 2014

A University offers a course that prepares students for the county licensing exam for real estate brokers. Last year, twenty students who completed this course took the exam. The university wants to know how well its students did an exam. You have been asked to write a program to summarize the results. You have been given a list of these 20 students. Next to each is written a1 if the student passed the exam or a2 if the student failed the exam.Your program should analyze the results as follows:

i.Input each test result (i.e., a1 or a2). Display the message Enter result on the screen each time the program requests another test result.
ii.Count the number of test results of each type.
iii.Display a summary of the test results, indicating the number of students who passed and the number who failed.
iv.If more than 15 students passed the exam, output message, Bonus to the instructor

View Replies View Related

Pop Up To All Active Users

May 14, 2015

How can a pop up trigger from java web application to all active users to broadcast something?

View Replies View Related

Session Creation For Users

Apr 3, 2014

I am making a Java project using Eclipse,oracle 10g and Apache tomcat.

Now my problem is that I cant create a session for the users. I have coded on jsp pages mostly.

Session creation using HttpSession through servlets or jsp

View Replies View Related

Day Of Year With Users Input

Apr 8, 2014

I'm doing a problem where I convert users input for the date (MM/DD/YY) into a written out date and year. That part is fine. The part I'm struggling with is then indicating what day that is in that year. how to use the user inputted MONTH, DAY, and YEAR to then get the day of year.

import java.util.Calendar;
import java.util.Scanner;
import java.util.regex.MatchResult;
import javax.swing.JOptionPane;
public class ConvertDate {

[code]...

View Replies View Related

How To Create JSP Page That Can Be Seen By Some Specific Users

Jun 6, 2014

What should i do to create a JSP page that can be visible to some specific user's.

View Replies View Related

Can Method Variables Be Shared Between Users?

Aug 27, 2014

Can method variables be shared between users?

I was asked this on an interview and I didn't know what to make of it.

View Replies View Related

Storing New Users Into Arraylist - Saving Data In Txt

Dec 4, 2014

I have created this project and want to be able to add new members to my members arraylist, store the input in a .txt file and load the new members after closing and opening the program.

[URL] .....

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved