ankur trapasiya

Ranch Hand
+ Follow
since Sep 24, 2010
ankur likes ...
Netbeans IDE 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
3
Received in last 30 days
0
Total given
19
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by ankur trapasiya

But anyhow if i have to implement it then what do i have to use? if JMF is dead then which framework to use? And i want video steganography to implement.
12 years ago
Hello, I want to implement video steganography in java. Can anyone please tell me which actions to follow? I mean do i have to use any algorithm for that or not ? One thing i came to know is that i have to use Java Media Framework for that.
Please tell me which steps should i follow for it ?

Thanks in advance.
12 years ago
Firstly , Thank you for reply and secondly sorry for making you feel bad....

Here condition is always met and each time it goes into the code. so there is no effect like post back
12 years ago
JSF
Hello...

I am using JSF and i have some code which should be run only once when the page is loaded first time so is there any mechanism like isPostBack() in jsf like asp.net ???

please reply as fast as possible because my work is stopped due to that..


Thanks in adv...
12 years ago
JSF
Hello i am using FORM based JAAS security and when i run my application it shows me the login form perfectly but when i click login button it shows me SessionHasExpired Exception...

detailed stack trace is written here...any expert please comment on this ....

org.icefaces.application.SessionExpiredException: Session has expired
at org.icefaces.impl.application.ExtendedExceptionHandler.handle(ExtendedExceptionHandler.java:103)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:119)
at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:110)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:312)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1523)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97)
at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:325)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:226)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:165)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
at java.lang.Thread.run(Thread.java:662)



please provide the solution of this error...i am using ice faces with jsf 2.1.1 RI and netbeans 6.9.1
12 years ago
JSF
hello i am having two applications one "admin" and another being "client" app..

Now i am having two different interfaces for Client and admin. so that both are having individual login pages...
I am using JAAS in which i have created my own Realm for my application.

The problem i am facing is ....

how to configure two different login pages with <login-config> in web.xml so that my resources are protected?

any expert please comment on this....

Thank you in advance....
12 years ago





There is one table in database UserGroupMaster(UserId,GroupName,Username) in which foreign keys of User(UserId) and Group(GroupName) table resides...Now here there is the entity which is generated from that table .. I have included only important methods only.

Now i am using web services so that whenever i try to run my web application which used web service created from this entity it gives error something like this...

// error
SEVERE: Cannot initialize endpoint : error is :
javax.xml.ws.WebServiceException: Unable to create JAXBContext
at com.sun.xml.ws.model.AbstractSEIModelImpl.createJAXBContext(AbstractSEIModelImpl.java:166)
at com.sun.xml.ws.model.AbstractSEIModelImpl.postProcess(AbstractSEIModelImpl.java:94)
at com.sun.xml.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:258)
at com.sun.xml.ws.server.EndpointFactory.createSEIModel(EndpointFactory.java:338)
at com.sun.xml.ws.server.EndpointFactory.createEndpoint(EndpointFactory.java:201)
at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:505)
at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:560)
at org.glassfish.webservices.EjbRuntimeEndpointInfo.prepareInvocation(EjbRuntimeEndpointInfo.java:278)
at org.glassfish.webservices.Ejb3MessageDispatcher.handlePost(Ejb3MessageDispatcher.java:112)
at org.glassfish.webservices.Ejb3MessageDispatcher.invoke(Ejb3MessageDispatcher.java:87)
at org.glassfish.webservices.EjbWebServiceServlet.dispatchToEjbEndpoint(EjbWebServiceServlet.java:196)
at org.glassfish.webservices.EjbWebServiceServlet.service(EjbWebServiceServlet.java:127)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
at com.sun.grizzly.http.servlet.FilterChainImpl.doFilter(FilterChainImpl.java:195)
at com.sun.grizzly.http.servlet.FilterChainImpl.invokeFilterChain(FilterChainImpl.java:139)
at com.sun.grizzly.http.servlet.ServletAdapter.doService(ServletAdapter.java:376)
at com.sun.grizzly.http.servlet.ServletAdapter.service(ServletAdapter.java:329)
at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:166)
at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:100)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:245)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.security.PrivilegedActionException: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 2 counts of IllegalAnnotationExceptions
XmlIDREF property is referencing a type "entities.UserGroupMaster" that doesn't have an XmlID property.
this problem is related to the following location:
at public java.util.List entities.LoginMaster.getUserGroupMasterList()
at entities.LoginMaster
at public entities.LoginMaster entities.CitizenMaster.getLoginMaster()
at entities.CitizenMaster
at public entities.CitizenMaster service.jaxws.GetCitizenResponse._return
at service.jaxws.GetCitizenResponse
XmlIDREF property is referencing a type "entities.UserGroupMaster" that doesn't have an XmlID property.
this problem is related to the following location:
at public java.util.List entities.GroupMaster.getUserGroupMasterList()
at entities.GroupMaster
at public entities.GroupMaster entities.UserGroupMaster.getGroupMaster()
at entities.UserGroupMaster
at public java.util.List entities.LoginMaster.getUserGroupMasterList()
at entities.LoginMaster
at public entities.LoginMaster entities.CitizenMaster.getLoginMaster()
at entities.CitizenMaster
at public entities.CitizenMaster service.jaxws.GetCitizenResponse._return
at service.jaxws.GetCitizenResponse
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.xml.ws.model.AbstractSEIModelImpl.createJAXBContext(AbstractSEIModelImpl.java:153)
... 33 more
Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 2 counts of IllegalAnnotationExceptions
XmlIDREF property is referencing a type "entities.UserGroupMaster" that doesn't have an XmlID property.
this problem is related to the following location:
at public java.util.List entities.LoginMaster.getUserGroupMasterList()
at entities.LoginMaster
at public entities.LoginMaster entities.CitizenMaster.getLoginMaster()
at entities.CitizenMaster
at public entities.CitizenMaster service.jaxws.GetCitizenResponse._return
at service.jaxws.GetCitizenResponse
XmlIDREF property is referencing a type "entities.UserGroupMaster" that doesn't have an XmlID property.
this problem is related to the following location:
at public java.util.List entities.GroupMaster.getUserGroupMasterList()
at entities.GroupMaster
at public entities.GroupMaster entities.UserGroupMaster.getGroupMaster()
at entities.UserGroupMaster
at public java.util.List entities.LoginMaster.getUserGroupMasterList()
at entities.LoginMaster
at public entities.LoginMaster entities.CitizenMaster.getLoginMaster()
at entities.CitizenMaster
at public entities.CitizenMaster service.jaxws.GetCitizenResponse._return
at service.jaxws.GetCitizenResponse
at com.sun.xml.bind.v2.runtime.IllegalAnnotationsException$Builder.check(IllegalAnnotationsException.java:102)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:472)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:302)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1140)
at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:154)
at com.sun.xml.bind.api.JAXBRIContext.newInstance(JAXBRIContext.java:106)
at com.sun.xml.ws.developer.JAXBContextFactory$1.createJAXBContext(JAXBContextFactory.java:109)
at com.sun.xml.ws.model.AbstractSEIModelImpl$1.run(AbstractSEIModelImpl.java:161)
at com.sun.xml.ws.model.AbstractSEIModelImpl$1.run(AbstractSEIModelImpl.java:154)
... 35 more

SEVERE: Unable to find adpater for endpoint



Now i know that this error is occuring due to @XmlID that i have specified. Can anyone please tell that in this case to specify the primary key which annotation i have to use ?
hello Ranchers...!!!

I am planning to prepare for OCPJBCD(JAVA EE 6).. I dont know from which book i start preparing, i surfed internet but there is no guide for this exam. Can anyone please tell me which book is perfect to prepare for this exam ? and from where i can find mock exams for the same ?

Your guidance will be very helpful to me....


Thanks in advance...
Hello ...!!

Can anyone please tell me that when to use UserTransaction and when not to use it. Because i am getting errors sometimes when i have not used UserTransactions (in case of adding record to database through JPA in JSF managed bean) and sometimes when i don't even put UserTransaction in my code then also it works perfectly.( in case of Remote EJB bean inserting record into database)..

Therefore i am little confused regarding this. Can anyone please tell me when to use it and when to not... I read EJB 3.0 and JPA specification but still i am not clear with it..

Thanks in advance....
Hello all..

I am assigned a task to develop a custom annotation for database connectivity



Now at a very basic level i have created one annotation but it is not fulfilling my this requirement..can anyone guide me how to develop this type of annotation? I surfed and come to know that to inject an entity like in built annotations we have to use reflections. is it so ?

and there is no tutorial available for this kind of annotation also..
some expert please guide me regarding this ..


Thanks in advance............
12 years ago
Thanks debraj....!!!

Got understood....
Hello Ranchers.....!!!

I have some confusion in my mind regarding this code..

[code]
function getState(obj)
{
var stateId=obj.value;
var request=createRequestObject();
request.open('GET','getComboData.jsp?countryId='+countryId,true);
request.onreadystatechange=function()
{
if(request.readyState==4)
{
if(request.status==200)
{
var response=request.responseText;
document.getElementById('stateDiv').innerHTML=response;
}
}
}
request.send(null); //*** 1
}
[code]


here when i remove line 1 at that time Ajax is not working but when i uncomment that line at that time it works fine.
Now i am not getting what this method is doing exactly. Can any one please tell me what this method exactly do ?

Thanks in advance....
so is it our responsibility to make a bean stateless ?... Do we have to make all the member variables stateless explicitly or container manages their state ?
hello ..!!!

I just passed my OCPJP on 26th February last week. I want to know that approximately how much time does it takes to certificate to reach me. I am living in india.
Thanks in advance...
13 years ago
hello everyone.....!!!

regarding stateless and stateful beans i have 2 questions...

1) do we have to make the beans stateless explicitly ? i mean to say k if i have one variable i in my stateless bean, to make it stateless i have to write code manually ?

and for 2nd question i am posting my code here


NOW USING SERVLETS


output :

this is stateful local bean:-30
this is stateless local bean:-30
this is stateful remote bean:-30
this is stateless remote bean:-46

// here the state of all the beans is maintained and as i refresh the page output will be

this is stateful local bean:-31
this is stateless local bean:-31
this is stateful remote bean:-31
this is stateless remote bean:-47

USING JSP


output first time ...
Stateless local bean :- 1
Stateful local bean :- 1
Stateless remote bean :- 1
Stateful remote bean :- 1

output when page is refreshed...

Stateless local bean :- 1
Stateful local bean :- 1
Stateless remote bean :- 2
Stateful remote bean :- 1


NOW I AM NOT GETTING THIS BEHAVIOUR....WHY IN JSP THE STATE FOR ONLY STATELESS REMOTE BEAN IS MAINTAINED ?
IS IT BUG OF EJB 3.1 ? SOME EXPERT PLEASE COMMENT ON THIS..

Thanks in advance....