IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Tomcat et TomEE Java Discussion :

Embadded tomcat 8


Sujet :

Tomcat et TomEE Java

  1. #1
    Membre du Club
    Inscrit en
    Août 2008
    Messages
    184
    Détails du profil
    Informations forums :
    Inscription : Août 2008
    Messages : 184
    Points : 49
    Points
    49
    Par défaut Embadded tomcat 8
    Bonjour,
    Essaie d'integrer tomcat 8 dans mon application en mode embadded.
    Quand je déclare un Context , je n'arrive pas à y accéder depuis mon navigateur :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
     
    public void initialize(IFMessage init) throws IFException {
    		config = init;
    		if (init.containsKey("Host")) {
    			hostname = init.getString("Host");
    		}
    		System.setProperty("catalina.host", hostname);
    		if (init.containsKey("Port")) {
    			port = init.getInt("Port");
    		}
    		System.setProperty("catalina.port", "" + port);
    		if (init.containsKey("SSLPort")) {
    			SSLport = init.getInt("SSLPort");
    			System.setProperty("catalina.sslport", "" + SSLport);
    		}
    		if (init.containsKey("keypass")) {
    			keypass = init.getString("keypass");
    		    }
    		 if (init.containsKey("keystore")) {
    		    keystore = init.getString("keystore");
    		    }
    		if (init.containsKey("Webapps")) {
    			webapps = init.getString("Webapps");
    		}
    		// set the home of tomcat
    		String projectHome = IF.getIFProject();
    		File home = new File(projectHome, "etc/Tomcat");
    		trace.println(3, "catalina.home: ", home);
    		System.setProperty("catalina.home", home.getAbsolutePath());
    		// instanciate tomcat
    		tomcat = new org.apache.catalina.startup.Tomcat();
    		tomcat.setPort(port);
    		tomcat.setHostname(hostname);
    		tomcat.setBaseDir(home.getAbsolutePath());
    		host = tomcat.getHost();
    		Engine engine = tomcat.getEngine();
    		engine.setDefaultHost(hostname);
    		engine.setName(IF.getRole() + "-Tomcat");
     
    		// create a default virtual host
    		webDir = new File(webapps); // Try this dir first
    		if (!webDir.isDirectory()) {
    			webDir = new File(projectHome, webapps); // Try relative dir
    		}
     
    		// create the ROOT context
    		File root = new File(webDir, "ROOT");
    		if (init.containsKey("RootContext")) {
    			String r = init.getString("RootContext");
    			root = new File(webDir, r);
    		}
     
    		Context rootContext;
    		try {
    			rootContext = tomcat.addWebapp("", root.getAbsolutePath());
     
    		} catch (Throwable error) {
    			trace.println(-1, "Unable to add ROOT context:", error);
    		}
     
    		// create the Project context
    		File project = new File(IF.getIFProject());
    		Context projectContext;
    		try {
    			projectContext = tomcat.addWebapp("/IFProject", project.getAbsolutePath());
     
     
    			//projectContext.getResources().setAllowLinking(true);
    			System.out.println("**********************************************IFProject context: "+ projectContext.toString());
    		} catch (Exception error) {
    			System.out.println("**********************************************");
    			error.printStackTrace();
    			System.out.println("**********************************************");
    		}
    	}
    J'arrive à ouvrir le root context en http://localhost:8080
    Mais quand j'accède à http://localhost:8080/IFProject, j'ai : The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.

  2. #2
    Membre du Club
    Inscrit en
    Août 2008
    Messages
    184
    Détails du profil
    Informations forums :
    Inscription : Août 2008
    Messages : 184
    Points : 49
    Points
    49
    Par défaut
    Aucun retour ?!

Discussions similaires

  1. Docs, Tutoriels et astuces Tomcat et JBoss (US)
    Par Ricky81 dans le forum Tomcat et TomEE
    Réponses: 4
    Dernier message: 13/03/2009, 21h00
  2. [configuration] lancer plusieurs serveurs Tomcat
    Par polo54 dans le forum JBuilder
    Réponses: 4
    Dernier message: 13/06/2003, 15h52
  3. Debuggage d'une application WEB-TOMCAT
    Par oziller dans le forum JBuilder
    Réponses: 3
    Dernier message: 07/02/2003, 23h10
  4. Context sous Tomcat
    Par EL MANSOURI dans le forum JBuilder
    Réponses: 5
    Dernier message: 28/01/2003, 11h26
  5. Tomcat + Apache-SOAP
    Par lucho31 dans le forum Services Web
    Réponses: 3
    Dernier message: 17/10/2002, 09h55

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo