Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updating password through API does not work? #120

Open
simplexify opened this issue May 17, 2016 · 0 comments
Open

updating password through API does not work? #120

simplexify opened this issue May 17, 2016 · 0 comments

Comments

@simplexify
Copy link

We are successfully using the API to add passwords, and search for passwords. We now wanted to extend that functionality to also updating passwords, but this fails:

curl -k -X PUT -H 'Content-Type: application/json' -H 'X-WPS-Username: wps.api.user' -H 'X-WPS-Password: xxxxxx' -d '{"id":"714","title":"someserver","username":"root","password":"somepassword","notes":"","tags":"root linux","active":"Y"}' https://my.wps.server/WebPasswordSafe/rest/passwords

Response:

{"message":"failed to lazily initialize a collection of role: net.webpasswordsafe.common.model.Tag.passwords, no session or session was closed","passwordId":"714","success":false}

The webpasswordsafe-audit.log shows this:

2016-05-17 22:58:02,256 || 2016-05-17 22:58:02.234 || wps.api.user || x.x.x.x || login ||  || success ||  || 
2016-05-17 22:58:02,283 || 2016-05-17 22:58:02.272 || wps.api.user || x.x.x.x || get password || someserver (passwordId=714) || success ||  || 

The webpasswordsafe.log file shows this:

2016-05-17 22:58:02,296 ERROR [ajp-bio-8009-exec-32]: failed to lazily initialize a collection of role: net.webpasswordsafe.common.model.Tag.passwords, no session or session was closed
org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: net.webpasswordsafe.common.model.Tag.passwords, no session or session was closed
    at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:383)
    at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:375)
    at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:368)
    at org.hibernate.collection.PersistentSet.remove(PersistentSet.java:236)
    at net.webpasswordsafe.common.model.Password.removeTags(Password.java:336)
    at net.webpasswordsafe.common.model.Password.addTagsAsString(Password.java:313)
    at net.webpasswordsafe.server.webservice.rest.PasswordController.updatePassword(PasswordController.java:290)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:219)
    at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132)
    at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:100)
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:604)
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:565)
    at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80)
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923)
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
    at org.springframework.web.servlet.FrameworkServlet.doPut(FrameworkServlet.java:800)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:649)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at net.webpasswordsafe.server.filter.ContentSecurityPolicyFilter.doFilter(ContentSecurityPolicyFilter.java:64)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
    at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:193)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:313)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant