subuhi nigar

Ranch Hand
+ Follow
since Aug 28, 2012
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by subuhi nigar

Hi Guys ,

NEed some help in removing unwanted  root element  from the XML that is being generated through JAXB

What i need is

< name >emplOne</name><age>24</age><deptt>store</deptt>
< name >empltwo</name><age>24</age><deptt>store</deptt>
< name >emplthree</name><age>24</age><deptt>store</deptt>
< name >emplfour</name><age>24</age><deptt>store</deptt>

but what i am getting is

below is the code for Pojo classes :

Is there a way where i can remove the  Emp  root element that is appearing from Employee class .

I tried using XMLRootElement (name ="") in Employee class but  it didnt help me in removing  Emp tag .

Please help.

Thanks in advance  .

Best Regards
Subuhi nigar
11 months ago
Thanks MZ and Frits .
After giving exam what i feel is that i have  passed basic eligibility criteria to vent into WS.
Lot more stuff needs to  go through like  oAuth / Dig Sig  etc. for which i haven't made  any programs yet .
Hi Guys  ,

I have cleared OCEJWSD 6 ( 1z0-897) exam today with 90% score .  
Even though i was  not too confident  because on  few topics  i was  not very confident  .
Topics like  EJB as RS Web Services ,  use of @context invocation  though annotations i didnt not  try hands on . I have prepared in unconventional way .
I read  Java Web services Up and running book , then downloaded  MZ's Guide ( sorry i just downloaded  not read it  even once  because  i was getting bored )
Then i bought EpractizeLabs Mock Exams and performed one round of test with a range of  60%-70% .
Then i started reading about the weak topics  directly though Oracle Docs  , IBM docs  , W3C schools and every possible easy to understand blog .
Just couple of weeks before  i found where i read this exam's material .
then while doing mocks which ever the questions i was failing to answer i did an extensive search on google to understand it  .
Like WS-Addressing , conformance claims, J2EE annotations , wrapper and non wrapper style  are few stuff that i read from random sources .

not least  >> created few webservices / clients  in Eclipse .

I haven't got Certificate yet but  got  score card . (See attached )

Before going for actual tests i gave  Enthuware mock trial test and got  80% .

Thanks Frits, MZ and  all the Ranchers .

Thanks MZ,

I have purchased an online testing material by EPractizeLabs . I found that many questions on their mock exams are either repeated  or very easy. Only few questions good enough to test the eligibility . And those were already  publicized on their free trial . I am not very much confident  on the preparation . Anyway , thanks much .
Hello Guys ,

I am preparing for  giving  Web Services exam from past 2 months . I had  to reschedule this exam from 16th Oct to a later date due to lack of preparation.
In fact i am not getting what is the exact syllabus of the exam . As per Oracle Web site it is written that SOAP ( JAX-WS ) and REST  ( JAX-RS )  web services are covered in topic .
J2SE and J2EE platforms will be covered . I had gone through OReilly's Java WebServices Up and Running  PDF twice ( because  reading once is n't enough for me  )
Also i have gone through Oracle Docs for J2EE web services for detailed understanding of few  topics . W3C school for WSDL 1.1 spec .
Now when i am doing  mock tests i see there are questions on UDDI API , JAXR registry APIs ( that i didnt read because it is not listed in syllabus )
So i want to know is UDDI API also needs to be covered  ? Also i find questions on JAX-RPC which again is not  included in WSD syllabus .

I am not confident  on  EJB conversions to Web services because I have never worked on EJB stuff .
Can some one please throw some light on where could i  find necessary and sufficient material on EJB . I know that EJB is wide topic in itself ,
but now i am apprehensive about going through EJB in detail , because it may wash away the  web service  stuff . Since my brain works like FIFO .

Please reply to above queries if any one has some idea .

Thanks much in advance .
Hi ,

My problem seems to be resolved as soon as i set @scope("session") on LoginController .

Spring 4.1 behaves differently ! in spring 2.5 i hadn't set scope=session in <bean ...configuration in app-servlet.xml . There too LoginController is default singleton scope . Here too it is singleton .But if i remove @scope("session") and modify

It prints session null .

Anyway , I need to understand spring mvc 4.1 flow . it seems to be different than 2.5 a lot .
2 years ago
Hi ,

I am migrating an already build application from spring MVC 2.5 to Spring MVC 4.1 .
Facing problems during the process.

1) when i configure SessionFilter in web.xml the formatting of the JSP pages goes off . It totally ignores style.css under /css/ folder .

2) Filter always redirects to Login.jsp page printing in SessionFilter as ( session == null = true ).

Beow is the Filter's doFilter ()

Here is web.xml

This is very weird because same Filter with same configuration works fine in springMVC 2.5 app.

Also in login.jsp <%page session=false%> is not set .. So there is no point that session is not getting created in it.

Below is the LoginController method

Please help ... What i think is when first time logon page arrives it shows login.jsp page .. but when user submits it , form submits action="Welcome" that checks by filter
here it sees session == null
i am not getting why session is null when user clieck on submit button .

I am sorry for poorly writing my problem .
if more clarification is required , please let me know .

Thanks in advance.

Any help is much appreciated.

2 years ago
Hi ,

I resolved my problem by doing below steps ....

1) Adding configuration class in app-servlet.xml explicitly to AnnotationConfiguration

<bean id="mySessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource"><ref bean="dataSource"/></property>
<property name="packagesToScan" value="com.Blueclouds.form" />
<property name="configurationClass" value="org.hibernate.cfg.AnnotationConfiguration" />
<property name="configLocation" value="classpath:hibernate.cfg.xml" />

2) After adding this class i got another exception
java.lang.NoClassDefFoundError: org/apache/lucene/analysis/standard/StandardAnalyzer

that i solved by explicitly downloading lucene.2.9.1.jar from apache's website.

Now i am able to insert records in DB.

However, this whole case has generated few doubts in my mind.

1) Why one has to use JPA annotation? isn't hibernate annotation jar sufficient enough to do the same work what JPA annotations do ?

2) Why at all one use annotations ? because every thing that can be done in annotation can be done easily by mapping hbm.xml files .

3) Why in my case there is dependency on lucene.jar ? while i haven't seen on any of tutorial on web using this jar in hibernate .
i am using hibernate-core-3.3.2.GA.jar and hibernate-annotations.3.3.1.jar and hibernate - common-annotation.3.3.1.jar and hibernate-jpa.2.0.api.jar

Thanks in advance.

2 years ago
2 years ago
Hi ,

I am facing some problem in mapping entity POJO using annotation in hibenrate 3.0 + spring 4.1 . ( i m using java .persistence.* annotation package )

in my app-servlet.xml below is the mapping done .

in hibernate.cfg.xml below mapping are available

when i call of subscriber ) it gives run time exception of " Unknown Entity : com.BlueClouds.form.Subscriber "

but if i uncomment <mapping class="com.BlueClouds.form.Subscriber"/> line in hibernate.cfg.xml the app gives exception while loading

org.hibernate.MappingException: An AnnotationConfiguration instance is required to use <mapping class="com.BlueClouds.form.Subscriber"/>

The thing is ShUsers table having POJO without annotation works fine .
Only subscriber table that is having annotation based POJO and no .hbm.xml file gives error.

I have few doubts
1) is it due to "packagesToScan" property being ignored in app-servlet.xml ?
2) is it mandatory to add <mapping class=""/> in hibernate.hbm.xml ?

Please help in rectifying this problem .

2 years ago
Hi , My problem got resolved . I am able to get back the jsp pages by returning string.
It is working fine with both the View Resolver classes.

Thanks for answering .
2 years ago
Is it InternalResourceViewResolver or org.springframework.web.servlet.view.UrlBasedViewResolver ?
In old spring 2.5 the former is used and i am using MVC there , but in 4.1 i changed to latter one to resolve string returns. But it is not working .
2 years ago
The reason to migrate to 4.1 is there are few more modules that have to be developed in this app. For those modules i want to leverage Multipart file Upload , Caching enhancements , Java Mail API that comes in handy in 4.1 . Also i see many things have become easier by use of annotations and thus reducing app-servlet.xml . 4.1 supports multiple URL mapping with same controller . In 2.5 i need to extends MultiViewController in order to do so , also need to map action in app-servlet.xml .

2 years ago
Hi ,

I am able to bring home page by replacing SpringMVC libs from 2.5 to 4.1 . It comes up well.

The thing is i want to use spring mvc 4.1 features . Like it supports the return of string instead of MVC . That i am unable to do till now .
In my controller it still returns MVC Object only . then only home page comes .

But i when i return "logon" it doesn't load home page .

Then my motive to migrate it to spring 4.1 is getting defeated .. Any suggestions ?

Thanks for the help .

2 years ago