Vinod Vijay

Ranch Hand
+ Follow
since Sep 13, 2011
Vinod likes ...
Tomcat Server Java Ubuntu
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
2
Received in last 30 days
0
Total given
4
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Vinod Vijay

I want to understand if there is anyway I can mask certain string variables of a class like password, etc which will prevent during logging. Like overriding .toString() method in such way it does not print in logs.

For instance:-

We have a class Employee with following fields:-



During logging like

Here in logging, I'm trying to print the whole object, Employee here and my requirement is it should not print out masked field, password at all and whereas logging of rest of the fields are fine.

Thank you,
6 years ago
Hi, I'm using Apache CXF 2.7.11 client to generate the stub classes from WSDL file.

In WSDL, I have few elements like :-


When JAXB is generated then in class I'm getting the attributes like


I have written a client to consume this web service and when I try to trigger the request, I'm getting following SOAP envelope request :-


In my client I have not mapped these attributes so it is always going to be empty in SOAP request. I do not want to modify the WSDL (means removing these elements from WSDL file) to exclude these nillable elements from SOAP envelope request. My requirement is I do not want these nillable elements in my SOAP envelope request at all. These elements can appear in SOAP envelope request if there is a data otherwise not (assume I have done the mapping in client side).

I understand that if I remove these annotations completely (@XmlElement(nillable = true)) or make the annotations like @XmlElement in JAXB classes then it will not appear in SOAP envelope request but modifying so many JAXB classes manually is a difficult task for me.

Is there any way I can configure it in POM.xml file so that at the time of generating the JAXB classes using wsdl2java the annotations does not appear in JAXB classes or some other optimum way to prevent it.

Chunk of POM.xml:-


Thank you
6 years ago
Hi, I'm working on a SOAP based web service (JAX-WS, Apache CXF). In my SOAP request, there is backslash ("\") in every element which starts with http. For instance :-



I tried a lot to figured out this issue. As per my understanding, my Java code is not putting this character ("\") anywhere in the entire SOAP envelope request. But from where this character is coming?

Q1) Even if SOAP envelope request has this backslash ("\"), then does it mean it is an invalid request or still a valid SOAP based web service request.

Q2) Any idea how it is getting generated, is it at client side (Java Stub) or at the host side? Is it because of any specific logging pattern? I'm running behind IBM DataPower, is it because of that?

Q3) How to get rid of it? Any change at client-side or at web service host (SOA) side?

Please assist to clear my queries.

Thank you
6 years ago
Hi,

I'm new to AWS CodeDeploy. I have EC2(Windows) instance up and running fine. My app is also on it and I can access it through public IP. I'm trying to build and deploy my code (available at CodeCommit) through CodePipeline. But everytime build fails with following error:-
https://forums.aws.amazon.com/ 2016/12/27 16:08:55 Waiting for agent
https://forums.aws.amazon.com/ 2016/12/27 16:09:10 Phase is DOWNLOAD_SOURCE
https://forums.aws.amazon.com/ 2016/12/27 16:09:10 Source is located at /tmp/src839527513/src
https://forums.aws.amazon.com/ 2016/12/27 16:09:10 YAML location is /tmp/src518781290/src/buildspec.yml
https://forums.aws.amazon.com/ 2016/12/27 16:09:10 Phase complete: DOWNLOAD_SOURCE Success: false
https://forums.aws.amazon.com/ 2016/12/27 16:09:10 Phase context status code: YAML_FILE_ERROR Message: Wrong number of container tags, expected 1
https://forums.aws.amazon.com/ 2016/12/27 16:09:10 Runtime error (Wrong number of container tags, expected 1)

I tried googling this error (Wrong number of container tags, expected 1) on Internet but not much resolution found.

My buildspec.yml:-
version: 0.0
os: windows
files:
- source: \index.html
destination: C:\inetpub\wwwroot
hooks:
BeforeInstall:
- location: \before-install.bat
timeout: 900
Secondly, the YML file should be named as buildspec.yml or appspec.yml because on AWS docs, it is given as appspec.yml but CodeDeploy looks for buildspec.yml.

Thank you
7 years ago
Hi,

I want to put a regular expression in the struts validation xml to validate email address which as .com and .asia enter by user. For example, to allow email address such as vinod@test.com and vinod@test.asia only. I tried a lot with following regular expression but still .asia is not working at all (.com is working) :-

Struts validator xml:-
<var><var-name>mask</var-name><var-value>^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{2,4}~]+@[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{2,4}~]+\.[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{2}|com|asia~]*$</var-value></var>

I changed the regular expressiont o following as well:-
^([a-z0-9][-a-z0-9_\+\.]*[a-z0-9])@([a-z0-9][-a-z0-9\.]*[a-z0-9]\.(com|asia)|([0-9]{1,3}\.{3}[0-9]{1,3}))*$

But still it is not allowing email address with .asia?

Kindly advise.

Thank you
7 years ago
I'm new Angular2 and learning it using TypeScript. I understood that everything is component in Angular2 and we do not render whole HTML page but by just specific component. I have 2 basic queries here:-

1) In my sample, Angular 2 app, I have service component class which brings static data to my component class using Dependency Injection. Instead of static, I want to bring data from my database (MongoDB). Between service layer and database, I'm quite confused. May I know what are industry best approaches to integrate service layer and database layer in a regular Angular 2 app? Do we have tightly coupled architecture like normal JAVA J2EE MVC architecture from controller to service to dao to hibernate/JDBC/ibatis or do we integrate using web services (RESTful APIs'), loose-coupled fashion?

2) Secondly, how do we package this Angular 2 web app? Do we simply zip it or export as WAR file? Currently, I'm running it on my local system using my Node.js (npm start, etc on command prompt) and using Visual Studio Code for coding? How to create WAR file and does Tomcat App server supports Angular 2 apps?

Thank you
Hi, I'm new to Amazon Web Services and trying to understand its services on cloud than with our local data centres. I have a small query about AWS S3 storage services. Can we say that AWS S3 storage is like any content management server like Documentum or EDMI or Sharepoint server that we use in our web application to store files? AWS S3 is something like storing files (objects) on server(in directory structure)  and saving its path (object URL) in AWS databases like DynomoDB or RDS that we used to do in non-cloud, regular web application development practice?
7 years ago

Tushar Goel wrote:got it. You have issue while adding object to the model.


you have used



but it should be:




Thanks, really appreciated for your help. I overlooked this error. It worked now.
7 years ago

Tushar Goel wrote:it may possible your dispatcher_servlet.xml have error? What is your login.html and dispatcher xml?



Hi, following are my configuration files:-
Web.xml:-


TaskManagement-servlet.xml:-


There is an index.jsp but im not using this default page. I'm trying to access my login JSP by appending /login in URL which is hitting the login controller class (LoginPageController.java) :-
http://localhost:8081/TaskManagamentApp/login
7 years ago

Tushar Goel wrote:I am not sure bt i think you are mssing @ModelAttribute in the controller method.. so your method should be like this:



Hi, I appreciate your help however my problem is my login screen itself is not populating means looks like following method has some problem:-
@RequestMapping(method = RequestMethod.GET)
public String showLoginPage(@ModelAttribute("userForm") UserForm userForm, BindingResult bindingResult, ModelMap modelMap){
logger.info("**************");
userForm = (UserForm) modelMap.get(userForm);
modelMap.addAttribute("userForm", "userForm");
return "login";
}

I added @ModelAttribute also but somehow I feel like my form bean i.e. UserForm is not being recognized with this login JSP as a result im still getting following error during loading it:-
org.springframework.beans.NotReadablePropertyException: Invalid property 'username' of bean class [java.lang.String]: Bean property 'username' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?
7 years ago

Tushar Goel wrote:I am not sure bt i think you are mssing @ModelAttribute in the controller method.. so your method should be like this:



Hi, I appreciate your help however my problem is my login screen itself is not populating means look like following method has some problem:-
@RequestMapping(method = RequestMethod.GET)
public String showLoginPage(@ModelAttribute("userForm") UserForm userForm, BindingResult bindingResult, ModelMap modelMap){
logger.info("**************");
userForm = (UserForm) modelMap.get(userForm);
modelMap.addAttribute("userForm", "userForm");
return "login";
}

I added @ModelAttribute also but somehow I feel like my form bean i.e. UserForm is not being recognized with this login JSP as a result im still getting following error during loading it:-
org.springframework.beans.NotReadablePropertyException: Invalid property 'username' of bean class [java.lang.String]: Bean property 'username' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?
7 years ago
Hi, I'm getting following error while running my Spring MVC web application:-

org.springframework.beans.NotReadablePropertyException: Invalid property 'username' of bean class [java.lang.String]: Bean property 'username' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?

Why error is pointing to a String class like java.lang.String? It should take from my UserForm object.

UserForm:-


Controller Class (LoginPageController):-


JSP:-


Can you please advise on this where I'm making the mistake? I tried refactor the class name of UserForm to just 'User.java' and also rename username to user accordingly on JSP as well but still showing same error.
Thank you,
7 years ago
Hi,

I'm learning Mongodb by integrating it with my Java application. Till now I have configured my MongoDB as a Windows service that runs when my windows starts and also I'm successfully able to connect, insert and finding data from MongoDB which is integrated with my Java application. I understand that each data is stored as a Key : Document pair in MongoDb and scaled horizontally without any predefined schema definition. However I'm still not clear with my following doubts:-

1) When we say each data is stored as key:document pair then what does the term 'key' here means? Is it a primary key value which I'm entering in the data or does this 'key' means some unique record id (containing random numbers like in RDBMS). For instance:-



 

Here, if I'm not wrong then EmpId is not the key here, right? Key will be unique id of this data in MongoDB table called 'employee' like '57cd9d404a85c209a42ed747'. Please confirm.


2) When we say each data is stored as a document then what exactly it means? How it looks like, in a structured form or unstructured? Can't we see the stored documents using some client like SQLDeveloper or Toad for RDBMS?

3) Finally which is faster to store as well to retrieve with huge data
7 years ago
Hi,

I'm developing a web application using Java. I would like to integrate SMS service in my application. For this, I would like to test SMS notification on mobile numbers globally. May I know if there is any free service or open source frameworks available for SMS alerts testing purpose.

Thank you
7 years ago
Hi,

My email address validation written in regexp is working fine when it comes to .com. However client side validation fails when it comes to .asia. For instance, the email address as test@abc.asia fails even though it is validate email address in my application whereas test@abc.com gets passed.

Can you please suggest me some standard javascript/jquery validation to allow domain such as .asia also apart from .com.

Thank you,
Regards,
Vinod
7 years ago