problème d'authentification

cancel
Showing results for 
Search instead for 
Did you mean: 
imadovic18
Member II

problème d'authentification

bonjour
je suis entrain de développer une page jsp et j'ai créé un bouton qui va me permettre d'ajouter des des fichiers dans alfresco pour cela le bouton appelle une classe (testecriture) qui va devoir s'identifier pour alfresco et ajouter du text
pour pour tester la synchronisation entre les deux  (alfresco et mon tomcat 5.5.27) j'ai voulu tester en s'authentifiant c'est tout
voila classe java qui me permet de s'authentifier
package org.alfresco.sample.webservice;

import org.alfresco.webservice.util.AuthenticationUtils;

public class testecriture
{
   public static void createImp() throws Exception {
System.out.println("slt");
    AuthenticationUtils.startSession("admin", "admin");
       try{
       
   } catch(Throwable e) {
      System.out.println(e.toString());
   } finally{
      // End the session
      AuthenticationUtils.endSession();
      System.exit(0);
   }
}
}
et là voilà l'erreur qui me donne mon tomcat
slt
04 juin 2009 11:44:57.625 [ERROR] [http-8084-Processor24] [org.apache.axis.configuration.EngineConfigurationFactoryFinder] - Unable to locate a valid EngineConfigurationFactory
java.lang.NullPointerException
   at org.apache.axis.client.Service.getEngineConfiguration(Service.java:813)
   at org.apache.axis.client.Service.getAxisClient(Service.java:104)
   at org.apache.axis.client.Service.<init>(Service.java:113)
   at org.alfresco.webservice.authentication.AuthenticationServiceLocator.<init>(AuthenticationServiceLocator.java:16)
   at org.alfresco.webservice.util.WebServiceFactory.getAuthenticationService(WebServiceFactory.java:159)
   at org.alfresco.webservice.util.AuthenticationUtils.startSession(AuthenticationUtils.java:79)
   at org.alfresco.sample.webservice.testecriture.createImp(testecriture.java:18)
   at org.apache.jsp.stage.content.front.essai_jsp._jspService(essai_jsp.java:813)
   at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
   at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
   at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
   at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
   at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:738)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:875)
   at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
   at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
   at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
   at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
   at java.lang.Thread.run(Unknown Source)
04 juin 2009 11:44:57.656 [ERROR] [http-8084-Processor24] [org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/xulapps].[jsp]] - "Servlet.service()" pour la servlet jsp a généré une exception
java.lang.IllegalStateException
   at org.apache.catalina.connector.ResponseFacade.sendRedirect(ResponseFacade.java:433)
   at javax.servlet.http.HttpServletResponseWrapper.sendRedirect(HttpServletResponseWrapper.java:126)
   at org.apache.jsp.stage.content.front.essai_jsp._jspService(essai_jsp.java:842)
   at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
   at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
   at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
   at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
   at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:738)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:875)
   at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
   at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
   at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
   at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
   at java.lang.Thread.run(Unknown Source)
6 Replies
landry_2530
Member II

Re: problème d'authentification

Bonsoir

Si je comprends bien, tu veux réaliser un client qui consomme les services
du Noyau Alfresco. Si oui tu t'y prends mal je crois.

Pour voir comment faire l'authentification, regarde le projet FirstFoundationClient du SDK Alfresco
c'est un excellent exemple de client qui montre comment s'authentifier  et consommer un service
Alfresco.

Tu veras des choses du genre :

        AuthenticationService authenticationService = serviceRegistry.getAuthenticationService();
        authenticationService.authenticate("admin", "admin".toCharArray());

Du courage
imadovic18
Member II

Re: problème d'authentification

merci landry voila ce que j'ai fait dans ma classe qui me permet de s'authentifier:
public class testecriture
{
   
   public static void createImp() throws Exception {
    System.out.println("/////////////////////////////////////////////////////////////////////////////////////////222222222");
   
    ApplicationContext ctx = ApplicationContextHelper.getApplicationContext();
    final ServiceRegistry serviceRegistry = (ServiceRegistry) ctx.getBean(ServiceRegistry.SERVICE_REGISTRY);
    AuthenticationService authenticationService = serviceRegistry.getAuthenticationService();
    authenticationService.authenticate("admin", "admin".toCharArray());
       try{
          System.out.println("sll");
   
      
   } catch(Throwable e) {
      System.out.println(e.toString());
   } finally{
      // End the session
et là ca me donne cette errreur, une erreur de bean, dans l'application-context, sachant bien qu'il arrive à l'ouvrir
/////////////////////////////////////////////////////////////////////////////////////////222222222
05 juin 2009 13:23:05.343 [INFO] [http-8084-Processor24] [org.alfresco.deployment.impl.server.DeploymentReceiverServiceImpl] - Initialising Implementation
05 juin 2009 13:23:05.343 [INFO] [FSR Keep Alive] [org.alfresco.deployment.impl.server.DeploymentReceiverServiceImpl] - Alfresco File System Receiver Started
05 juin 2009 13:23:05.343 [INFO] [FSR Keep Alive] [org.alfresco.deployment.impl.server.DeploymentReceiverServiceImpl] - Validation starting for target:default
05 juin 2009 13:23:05.343 [INFO] [FSR Keep Alive] [org.alfresco.deployment.impl.server.DeploymentReceiverServiceImpl] - Validation finished
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'deploymentReceiverTransportRMI' defined in class path resource [alfresco/application-context.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type [java.lang.String] to required type [int] for property 'registryPort'; nested exception is java.lang.NumberFormatException: For input string: "${dep.rmi.port}"
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:480)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
   at java.security.AccessController.doPrivileged(Native Method)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
   at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
   at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
   at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
   at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
   at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
   at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
   at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
   at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93)
   at org.alfresco.util.ApplicationContextHelper.getApplicationContext(ApplicationContextHelper.java:55)
   at org.alff.test.webservice.testecriture.createImp(testecriture.java:16)
   at org.apache.jsp.stage.content.front.essai_jsp._jspService(essai_jsp.java:814)
   at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
   at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
   at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
   at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
   at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:738)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:875)
   at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
   at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
   at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
   at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
   at java.lang.Thread.run(Unknown Source)
Caused by: org.springframework.beans.TypeMismatchException: Failed to convert property value of type [java.lang.String] to required type [int] for property 'registryPort'; nested exception is java.lang.NumberFormatException: For input string: "${dep.rmi.port}"
   at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:391)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1289)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1250)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)
   … 39 more
Caused by: java.lang.NumberFormatException: For input string: "${dep.rmi.port}"
   at java.lang.NumberFormatException.forInputString(Unknown Source)
   at java.lang.Integer.parseInt(Unknown Source)
   at java.lang.Integer.valueOf(Unknown Source)
   at org.springframework.util.NumberUtils.parseNumber(NumberUtils.java:157)
   at org.springframework.beans.propertyeditors.CustomNumberEditor.setAsText(CustomNumberEditor.java:114)
   at org.springframework.beans.TypeConverterDelegate.doConvertTextValue(TypeConverterDelegate.java:382)
   at org.springframework.beans.TypeConverterDelegate.doConvertValue(TypeConverterDelegate.java:358)
   at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:173)
   at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:138)
   at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:386)
   … 43 more

merci de ton aide encore une fois
cordialement
landry_2530
Member II

Re: problème d'authentification

Bonjour

Rassure toi, cette erreur ne vient pas de ton code. Elle provient du serveur.
Essaye de redéployer l'application serveur, donne suffisament de mémoire à ta JVM.

ça pourrait marcher.
imadovic18
Member II

Re: problème d'authentification

merci ca marche maintenat
merci pour ton aide Landry
cordialement
landry_2530
Member II

Re: problème d'authentification

Super

Heureux que tu aies pu trouver ton chemin.
imadovic18
Member II

Re: problème d'authentification

merci beaucoup
et merci pour votre aide, là je cherche comment uploader des fichiers sur alfresco en programme
cordialement