Ashok Pradhan

Ranch Hand
+ Follow
since Dec 17, 2007
Ashok likes ...
Netbeans IDE Eclipse IDE Firefox Browser
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Ashok Pradhan

I want to encrypt some text using AES with 256bit key but unable to achieve, at runtime it raises an Exception
Exception in thread "main" java.security.InvalidKeyException: Illegal key size or default parameters

When I change to 128 bit key size it works .I have JDK 7 and UnlimitedJCEPolicy is in JDK and JRE as part of JDK 7

my class



Please help

Thanks Ashok
10 years ago
I have created Java Project which contains several directories including src,test etc.But while I am importing from eclipse it only imports src directory .

File ->New-> Project->Java->Java Project from Existing Ant Buildfile


Please Help !!


Thank you Kathleen at last it is just worked !!

11 years ago
When I execute these two queries in Oracle it returns the correct result



Without double quote int true results error



ORA-00904: "TRUE": invalid identifier


Thanks !!
11 years ago
Tested with this still not working...




I have also tried with TRUE but does not help ...
11 years ago
Again thanks Kathleen !!

Changed the code as you have suggested..



After changed to this when I login using correct username and password in login page it shows me invalid username or password !!

My mappings are


and



And I have 1 row in USERS table
username|password
--------------------------
ashok |admin

and 1 row in USER_ROLES table
username|rolename
--------------------------
ashok |ADMIN


About error Log
After a fresh deploy when I login using correct username/password it shows this


19:37:31,398 INFO [stdout] (http-localhost-127.0.0.1-8080-2) You are trying to access /login.html

19:37:40,999 INFO [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] (http-localhost-127.0.0.1-8080-2) Loading XML bean definitions from class path resource [org/springframework/jdbc/support/sql-error-codes.xml]
19:37:41,097 INFO [org.springframework.jdbc.support.SQLErrorCodesFactory] (http-localhost-127.0.0.1-8080-2) SQLErrorCodes loaded: [DB2, Derby, H2, HSQL, Informix, MS-SQL, MySQL, Oracle, PostgreSQL, Sybase]
19:37:41,218 INFO [stdout] (http-localhost-127.0.0.1-8080-2) You are trying to access /login.html

19:37:41,219 INFO [stdout] (http-localhost-127.0.0.1-8080-2) You have entered invalid username or password



and subsequent login attempt with correct username/password shows this in log with invalid username/password in login page

19:40:14,873 INFO [stdout] (http-localhost-127.0.0.1-8080-2) You are trying to access /login.html
19:40:20,832 INFO [stdout] (http-localhost-127.0.0.1-8080-2) You are trying to access /login.html
19:40:20,834 INFO [stdout] (http-localhost-127.0.0.1-8080-2) You have entered invalid username or password



For login attempt with incorrect username/password whether it is a fresh request after deployment or subsequent login attempt
it shows invalid username or password in login page and this log message

19:41:25,877 INFO [stdout] (http-localhost-127.0.0.1-8080-2) You are trying to access /login.html
19:41:33,321 INFO [stdout] (http-localhost-127.0.0.1-8080-2) You are trying to access /login.html
19:41:33,322 INFO [stdout] (http-localhost-127.0.0.1-8080-2) You have entered invalid username or password



Again thanks for your kind help !!
11 years ago
Thanks Kathleen Angeles !!

I have changed the line



Still not working ,I have also tested using


and



and



Nothing works !!

I am using Oracle 11g XE as my database !!
11 years ago
I have created a simple Spring Security application which stores username and password in database table .
The app is not working even if I gave correct username and password .

my spring-security.xml file is as follows :


I have configured dataSource bean in application context and it is working fine as other components using jdbc works fine.

If I use in-memory authentication then it works fine .

Actually when I gave correct username and password to login page in server console it show this message

01:10:16,357 INFO [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] (http-localhost-127.0.0.1-8080-6) Loading XML bean definitions from class path resource [org/springframework/jdbc/support/sql-error-codes.xml]
01:10:16,472 INFO [org.springframework.jdbc.support.SQLErrorCodesFactory] (http-localhost-127.0.0.1-8080-6) SQLErrorCodes loaded: [DB2, Derby, H2, HSQL, Informix, MS-SQL, MySQL, Oracle, PostgreSQL, Sybase]


I have created two table for storing username,password and roles as USERS and USER_ROLES as follows :

CREATE TABLE "USERS"
( "USERNAME" VARCHAR2(40) NOT NULL ENABLE,
"PASSWORD" VARCHAR2(40) NOT NULL ENABLE,
CONSTRAINT "USERS_PK" PRIMARY KEY ("USERNAME") ENABLE
) ;
CREATE TABLE "USER_ROLES"
( "USERNAME" VARCHAR2(40) NOT NULL ENABLE,
"ROLENAME" VARCHAR2(10) NOT NULL ENABLE,
CONSTRAINT "USER_ROLES_PK" PRIMARY KEY ("USERNAME", "ROLENAME") ENABLE
) ;ALTER TABLE "USER_ROLES" ADD CONSTRAINT "USER_ROLES_FK" FOREIGN KEY ("USERNAME")
REFERENCES "USERS" ("USERNAME") ENABLE;


Please help !!

11 years ago
My entity Classes

Teacher


Section



Main Class


Everything works well if I include



before I call


Otherwise the generated JoinTable and Section table does not include section2 data
But my question is - As I have annotated in Teacher class the above things (saving section objects before teacher object) are not necessary.

Please show me some light ...
Hi
I have cleared OCEJWCD6 and now I want to learn Web Services please suggest some good book(like HF Servlet & JSP) or website link .

Thanks in advance .
11 years ago
My app throws error when I call ejb from JSF managed bean and the error is


My EJB code


JSF Managed bean code

JSF Page


The app works fine when I change the session bean to stateless to statefull
Thanks to all !!

@Rachit Pant :The first version of the book contains lots of errata so refer to the book's errata page and correct it accordingly !!


So I just downloaded all the material you listed.
Will that be enough ??


Yes ,It will be enough,just write some code without using IDE .For Servlet 3.0 things just refer Servlet 3.0 spec that is enough .
11 years ago
Dear friends today I have cleared OCEWCD 6 with score 91%

Preparation

I started preparation from the HSFJ from Sierra, Bates and Basham book which I have covered 3 times.Thanks to the Authors for the nice book
I write lots of small program on each chapter mostly without using any IDE I used Textpad to write programs.I also read some parts of Servlet 3 Specification(Annotations,Pluggability,Security,Asynchronous Servlet),JSP2.2 spec,Frederic Esnault notes(must recommended),PeabodyOnScwcdPatterns notes which covers most of the Pattern questions,ScwcdHints by Jothi Shankar Kumar and read some parts of JEE6 API.

Mock Exams
HSFJ final mock exam I score 57% because I have the 1st edition of the book and it had lots of errata.
Nikos' Java blog Custom Tags Exam(91%)
Nikos' Java blog EL Exam(92%)
Nikos' Java blog JSP (91%)
Nikos' Java blog Servlets (84%)
Java EE 6 SCWCD Mock Exam by Piotr Nowicki' (72%)
Did all 10 the enthuware mock exams and I found it really good and learned a lot.(It gives some important explanations).
My Enthuware scores are 68 , 68 , 74 , 68 , 77 , 81 , 84 ,91 , 86 , 84 .

Real Exam

The exam was not tough as compared to SCJP exam. The real exam toughness level matches with enthuware mock exam.
I missed 5 question on the exam and I took 1hr and 20min to complete the exam.There are 12-15 question which are based on Servlet 3.0.In my exam there are to custom tag questions.

Wish you all the best !!

11 years ago
This API Specifies "A return value of zero or less indicates that the session will never timeout. "
HttpSession

http://docs.oracle.com/javaee/6/api/