Partage
  • Partager sur Facebook
  • Partager sur Twitter

CHARGEMENT DRIVER

MICROSOFT ANALYSIS SERVICE

Sujet résolu
    25 novembre 2014 à 17:03:54

    Salut aux développeurs(es) du site. depuis deux jours , j'essaie de me connecter a un cube sur SQL SERVER 2008. après chaque tentative, je suis confronté au problème ci-dessous :

    run:
    LOAD FILE
    LOAD FILE OK
    "jdbc:xmla:Server=http://WINSERVER/xmla/msxisapi.dll"
    "org.jdbc4olap.jdbc.OlapDriver"
    sa
    bezalel
    Exception in thread "main" com.sobi.Exception.SobiConfigurationException: Le driver est introuvable dans le classpath.
    	at com.sobi.test.Test.getInstance(Test.java:74)
    	at com.sobi.test.Test.main(Test.java:39)
    Caused by: java.lang.ClassNotFoundException: "org.jdbc4olap.jdbc.OlapDriver"
    	at java.net.URLClassLoader$1.run(URLClassLoader.java:372)	at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
    	at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
    	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    	at java.lang.Class.forName0(Native Method)
    	at java.lang.Class.forName(Class.java:260)
    	at com.sobi.test.Test.getInstance(Test.java:71)
    	... 1 more
    Java Result: 1
    BUILD SUCCESSFUL (total time: 2 seconds)
    

    voici pour le moment le script de connexion a ma base de donnée multidimensionnelle

    /*
     * To change this license header, choose License Headers in Project Properties.
     * To change this template file, choose Tools | Templates
     * and open the template in the editor.
     */
    package com.sobi.test;
    
    import com.sobi.Exception.SobiConfigurationException;
    import com.sobi.database.SobiFactory;
    import java.io.IOException;
    import java.io.InputStream;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.SQLException;
    import java.util.Properties;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import org.olap4j.OlapConnection;
    import org.olap4j.OlapWrapper;
    
    /**
     *
     * @author Bezalel
     */
    public class Test {
     private static final String FICHIER_PROPERTIES = "com/sobi/dao/Sobi.properties";
        private static final String PROPERTY_URL = "url";
        private static final String PROPERTY_DRIVER = "driver";
        private static final String PROPERTY_NOM_UTILISATEUR = "nomutilisateur";
        private static final String PROPERTY_MOT_DE_PASSE = "motdepasse";
        private String url;
        private String username;
        private String password;
        /**
         * @param args the command line arguments
         * @throws java.sql.SQLException
         */
        public static void main(String[] args) throws SQLException {
          getInstance() ;
        }
     
        
      public static void getInstance() throws SobiConfigurationException {
            Properties properties = new Properties();
            String url;
            String driver;
            String nomUtilisateur;
            String motDePasse;
            ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
            InputStream fichierProperties = classLoader.getResourceAsStream(FICHIER_PROPERTIES);
            if (fichierProperties == null) {
                throw new SobiConfigurationException("Le fichier properties " + FICHIER_PROPERTIES + " est introuvable.");
            }
            try {
                System.out.println("LOAD FILE");
                properties.load(fichierProperties);
                System.out.println("LOAD FILE OK");
                url = properties.getProperty(PROPERTY_URL);
                driver = properties.getProperty(PROPERTY_DRIVER);
                nomUtilisateur = properties.getProperty(PROPERTY_NOM_UTILISATEUR);
                motDePasse = properties.getProperty(PROPERTY_MOT_DE_PASSE);
                
                System.out.println(url);
                System.out.println(driver);
                System.out.println(nomUtilisateur);
                System.out.println(motDePasse);
            } catch (IOException e) {
                throw new SobiConfigurationException("Impossible de charger le fichier properties " + FICHIER_PROPERTIES, e);
            }
            try {
                Class.forName(driver);
                System.out.println("SUCCESS LOAD DRIVER");
            } catch (ClassNotFoundException e) {
                throw new SobiConfigurationException("Le driver est introuvable dans le classpath.", e);
            }
    
        }   
        
        
        
        
        
          }
    
            
            
        
    
    
    url = "jdbc:xmla:Server=http://WINSERVER/xmla/msxisapi.dll"
    driver = "org.jdbc4olap.jdbc.OlapDriver"
    nomutilisateur = sa
    motdepasse = bezalel



    je tiens a signaler que j'ai ajouté toutes les bibliothèques nécessaires a ma librairie 

    Que faire pour y remédier ?

    -
    Edité par beza88 25 novembre 2014 à 17:05:29

    • Partager sur Facebook
    • Partager sur Twitter
    A Vaincre sans péril on finit par triompher sans gloire  ->  le Cid de corneille
      26 novembre 2014 à 6:03:44

      Le driver est bien dans dans ton classpath?

      Sinon regarde ou est situé ton main.(eclipse->window->show/view navigator)

      • Partager sur Facebook
      • Partager sur Twitter
        26 novembre 2014 à 10:07:45

        salut a vous. dans mon fichier porperties, je chargeais le driver comme ceci "org.jdbc4olap.jdbc.OlapDriver" au lieu de org.jdbc4olap.jdbc.OlapDriver. en tout cas , c'est ainsi que j'ai résolu mon problème
        • Partager sur Facebook
        • Partager sur Twitter
        A Vaincre sans péril on finit par triompher sans gloire  ->  le Cid de corneille

        CHARGEMENT DRIVER

        × Après avoir cliqué sur "Répondre" vous serez invité à vous connecter pour que votre message soit publié.
        × Attention, ce sujet est très ancien. Le déterrer n'est pas forcément approprié. Nous te conseillons de créer un nouveau sujet pour poser ta question.
        • Editeur
        • Markdown