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

Weblogic Java Discussion :

weblogic test url de déploiement


Sujet :

Weblogic Java

  1. #1
    Membre à l'essai
    Inscrit en
    Avril 2007
    Messages
    25
    Détails du profil
    Informations forums :
    Inscription : Avril 2007
    Messages : 25
    Points : 17
    Points
    17
    Par défaut weblogic test url de déploiement
    Bonjour,

    Je travaille avec weblo v9.2, j'ai installé et démarré mon ear via la console d'administration de weblogic sans problème.

    Lorsque je veux tester l'URL via la console d'administration une fenêtre apparaît et puis plus rien.

    Dans les logs de mon serveur rattaché à mon déploiement j'ai les informations suivantes:

    ####<Nov 17, 2008 1:53:01 PM GMT+00:00> <Error> <HTTP> <dfbqre04> <20xsrvapp_tst> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1226929981774> <BEA-101020> <[weblogic.servlet.internal.WebAppServletContext@1dd21dd2 - appName: 'Intranet', name: '/', context-path: ''] Servlet failed with Exception
    java.lang.NullPointerException
    at java.io.File.<init>(File.java:220)
    at jsp_servlet.__login._jspService(__login.java:159)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:34)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:223)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:283)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3245)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2003)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1909)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1359)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
    >
    ####<Nov 17, 2008 1:53:01 PM GMT+00:00> <Error> <Kernel> <dfbqre04> <20xsrvapp_tst> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1226929981802> <BEA-000802> <ExecuteRequest failed
    java.lang.NullPointerException.
    java.lang.NullPointerException
    at java.io.File.<init>(File.java:220)
    at jsp_servlet.__login._jspService(__login.java:159)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:34)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:223)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:283)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
    at weblogic.servlet.internal.RequestDispatcherImpl.invokeServlet(RequestDispatcherImpl.java:503)
    at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:245)
    at weblogic.servlet.jsp.PageContextImpl.forward(PageContextImpl.java:148)
    at jsp_servlet._commun.__security._jspService(__security.java:119)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:34)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:223)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:283)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
    at weblogic.servlet.internal.RequestDispatcherImpl.invokeServlet(RequestDispatcherImpl.java:503)
    at weblogic.servlet.internal.RequestDispatcherImpl.include(RequestDispatcherImpl.java:431)
    at weblogic.servlet.jsp.PageContextImpl.include(PageContextImpl.java:152)
    at jsp_servlet._commun.__globalexception._jspService(__globalexception.java:111)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:34)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:223)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:283)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
    at weblogic.servlet.internal.RequestDispatcherImpl.invokeServlet(RequestDispatcherImpl.java:503)
    at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:245)
    at weblogic.servlet.internal.ServletResponseImpl.sendError(ServletResponseImpl.java:706)
    at weblogic.servlet.internal.ErrorManager.handleException(ErrorManager.java:198)
    at weblogic.servlet.internal.WebAppServletContext.handleThrowableFromInvocation(WebAppServletContext.java:2063)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1916)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1359)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
    Auriez-vous une suggestion pour régler mon problème?

  2. #2
    Membre régulier
    Profil pro
    Inscrit en
    Décembre 2002
    Messages
    172
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Décembre 2002
    Messages : 172
    Points : 100
    Points
    100
    Par défaut
    Tu as visiblement un problème avec un objet de type File que tu utilises dans ta page login.jsp.
    On pourrait peut-être t'en dire plus avec ton code.

  3. #3
    Membre à l'essai
    Inscrit en
    Avril 2007
    Messages
    25
    Détails du profil
    Informations forums :
    Inscription : Avril 2007
    Messages : 25
    Points : 17
    Points
    17
    Par défaut
    J'ai joint le code de ma JSP.

    Je récupère des infos dans un fichier accueil.txt. J'ai regardé dans l'arborescence weblo et le fichier est présent au même niveau que login.jsp avec les droits qu'il faut.

    Si vous avez une idée, c'est pas de refus

  4. #4
    Membre à l'essai
    Inscrit en
    Avril 2007
    Messages
    25
    Détails du profil
    Informations forums :
    Inscription : Avril 2007
    Messages : 25
    Points : 17
    Points
    17
    Par défaut
    Avec le code c'est mieux (j'ai pas trouvé pour joindre mon fichier):

    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
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    <%@ taglib uri="/WEB-INF/tld/struts-bean.tld" prefix="bean" %>
    <%@ taglib uri="/WEB-INF/tld/struts-html.tld" prefix="html" %>
    <%@ taglib uri="/WEB-INF/tld/struts-logic.tld" prefix="logic" %>
    <%@ taglib uri="/WEB-INF/tld/struts-tiles.tld" prefix="tiles" %>
    <%@ page import="java.io.*"%>
    <%
    	response.setHeader("Pragma","No-cache");
    	response.setHeader("Expires","0");
    
    	// Ouvrir le fichier d'information
    	File file = new File(this.getServletConfig().getServletContext().getRealPath("accueil.txt"));
    	
    	if (file.exists())
    	{
    		// Résultat
    		StringBuffer resultat = new StringBuffer();
    		
    		// buffer 
    		char buffer[] = new char[2048];
    		
    		// Définir le reader pour le fichier 
    		FileReader reader = new FileReader(file);
    		
    		// Lecture du fichier 
    		while( reader.read(buffer) > 0)
    		{
    			resultat.append(new String(buffer));
    		}
    		
    		// Placer le contenu du fichier  
    		request.setAttribute("homeMessage",resultat.toString());
    		
    		// fermer le flux de lecture 
    		reader.close();
    	}
    %>
    <html>
    <head>
    	<meta http_equiv="Expires" content="0">
    	<meta http_equiv="Pragma" content="No-cache">
    	<meta http_equiv="Cache-control" content="private">
    	<title>ELODI - Connexion</title>
    	<style type="text/css" media="all">
    		@import url(/css/elodi.css);
    		
    		body{margin-left: 25%;margin-top:5%}
    		ul.form{width:500px;background:none;}
    		ul.form li{margin:0px;padding:0px}
    		ul.form li.info{background:#CCCCFF;margin-top:50px;
    						border:1px solid #FFF;color:#000080;font-size:10pt;font-style:italic;
    						text-align: left;padding-left:10px}
    		ul.form table{border:1px solid #FFF;}
    		ul.form table td{color:#FFF;font-weight: bold;font-size: 10pt}
    		
    	 </style>
    	 <script language="javascript">
    	 	function doLoad()
    	 	{
    	 		if (document.forms["connectionForm"].elements[0].type != "hidden")
    	 			document.forms["connectionForm"].elements[0].focus();
    	 	}
    	 </script>
    </head>
    
    <body onLoad="doLoad()">
    <html:form action="login">
    	<ul class="form">
    		<logic:notPresent name="SESSION_UTILISATEUR">
    			<li>
    				<table width="100%">
    					<logic:messagesPresent property="error.global">
    					<tr>
    						<td align="center" colspan="2"><html:errors property="error.global"/></td>
    					</tr>
    					</logic:messagesPresent>
    					<tr>
    						<td style="width:40%" align="right"><label for="identifiant">Identifiant <span style="color:#C03">*</span> : </label> </td>
    						<td style="width:60%">
    							<html:text property="utilisateur.identifiant" size="10" maxlength="8" styleId="identifiant"/>
    							&nbsp;<html:errors property="LOGIN_REQUIRED"/>
    						</td>
    					</tr>
    					<tr>
    						<td align="right"><label for="authentifiant">Authentifiant <span style="color:#C03">*</span> : </label> </td>
    						<td>
    							<html:password property="utilisateur.authentifiant" size="10" maxlength="6" styleId="authentifiant"/>
    							&nbsp;<html:errors property="PASSWORD_REQUIRED"/>
    						</td>
    					</tr>
    					<tr>
    						<td align="right"></td>
    						<td><html:submit styleClass="button">Connecter</html:submit> </td>
    					</tr>
    				</table>
    			</li>
    			<logic:present name="homeMessage">
    				<li class="info"><%= ((String)request.getAttribute("homeMessage")).toString().replaceAll("\n","<br />") %></li>
    			</logic:present>
    		</logic:notPresent>
    		<logic:present name="SESSION_UTILISATEUR">
    			<li>
    				<table width=320 border="0" cellspacing=0 cellpadding=5 bgcolor="#EEEEEE">
    				<tr>
    					<td bgcolor="#000080" align="center">
    						<font face="Arial" size=2 color="#FFFFFF"><b>ATTENTION</b></font><br>
    					</td>
    				</tr>				
    				<tr>
    					<td>
    							<font face="Arial" size=2 color="#000000">							L'utilisateur <bean:write name="SESSION_UTILISATEUR" property="identifiant"/> a une session encore active sur ce poste.<br>
    								Soit il s'est mal déconnecté, soit un navigateur est encore ouvert.<br>
    								Si vous continuez la connexion, l'utilisateur précédent sera déconnecté	et sa session fermée.
    							</font><br><br>
    					</td>
    				</tr>
    				<tr>
    					<td align=center bgcolor="#EEEEEE">
    						<bean:define name="SESSION_UTILISATEUR" property="identifiant" id="identifiant"/>
    						<bean:define name="SESSION_UTILISATEUR" property="authentifiant" id="authentifiant"/>
    						<html:hidden property="utilisateur.identifiant" value="<%=identifiant.toString()%>"/>
    						<html:hidden property="utilisateur.authentifiant" value="<%=authentifiant.toString()%>"/>
    								
    						<input type=button name="continuer" value="Continuer" onclick="this.form.submit()">
    						<input type=button name="annuler" value="Annuler" onclick="window.location='/logoff.do'">
    					</td>
    				</tr>
    				</table>
    			</li>
    		</logic:present>
    	</ul>
    </html:form>
    </form>
    </body>
    </html>

  5. #5
    Membre régulier
    Profil pro
    Inscrit en
    Décembre 2002
    Messages
    172
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Décembre 2002
    Messages : 172
    Points : 100
    Points
    100
    Par défaut
    Il y a de fortes chances que ce soit le test
    qui génère l'exception. La variable file doit être null.
    Essaie d'afficher la valeur de
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    this.getServletConfig().getServletContext().getRealPath("accueil.txt")
    . Il ne doit pas pointer vers le bon chemin.

  6. #6
    Membre à l'essai
    Inscrit en
    Avril 2007
    Messages
    25
    Détails du profil
    Informations forums :
    Inscription : Avril 2007
    Messages : 25
    Points : 17
    Points
    17
    Par défaut
    J'ai fais l'exercice très concluant puisque j'ai null pour le code this.getServletConfig().getServletContext().getRealPath("accueil.txt")

    En fait il sort en nullPointer à l'instanciation de l'objet File.

  7. #7
    Membre confirmé
    Avatar de bmoussaud
    Profil pro
    Inscrit en
    Décembre 2003
    Messages
    218
    Détails du profil
    Informations personnelles :
    Âge : 50
    Localisation : France, Paris (Île de France)

    Informations forums :
    Inscription : Décembre 2003
    Messages : 218
    Points : 555
    Points
    555
    Par défaut
    Pourquoi utiliser un Objet File alors qu'une URL serait plus adaptée. non ?
    Benoit Moussaud - XebiaLabs - Automatisation des déploiements. Screencast & Demo

  8. #8
    Membre à l'essai
    Inscrit en
    Avril 2007
    Messages
    25
    Détails du profil
    Informations forums :
    Inscription : Avril 2007
    Messages : 25
    Points : 17
    Points
    17
    Par défaut
    Pourquoi pas? Mais la question n'est pas là.
    N'étant pas en phase de dvpt, je ne peux pas modifier le code impunément.

    J'ai un ear avec ses avantages et ses inconvénients (plus d'inconvénients je te l'accorde) que je dois faire tourner avec Weblogic. L'historique de cet ear est énorme et je dois vivre voire survivre avec

    Cet ear tournant correctement sous Websphere, je pense qu'il me manque sous weblo des informations pour que ça tourne correctement. Avez-vous une idée?

    J'en profite pour demander si vous avez une URL décrivant les répertoires définis sous weblo (pour que je retrouve mais jsp compilées par exemple).

  9. #9
    Membre régulier
    Profil pro
    Inscrit en
    Décembre 2002
    Messages
    172
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Décembre 2002
    Messages : 172
    Points : 100
    Points
    100
    Par défaut
    La méthode getRealPath ne fonctionne pas avec un ear non explosé. Utilise plutot la méthode getResource de ServletContext. Dans une JSP tu peux y accéder avec application.getResource("accueil.txt").

    Par contre c'est vrai qu'il y a quelques trucs bizarres dans ta JSP. Par exemple, tu places l'attribut homeMessage dans la request pour t'en resservir dans la même page. Tu fais aussi un toString sur request.getAttribute alors que tu cast deja cet objet en String.

    et surtout, pourquoi t'embêter à instancier un File puis à parcourir le fichier alors que tu pourrais utiliser directement une inclusion du fichier (<jsp:include>) ?

  10. #10
    Membre à l'essai
    Inscrit en
    Avril 2007
    Messages
    25
    Détails du profil
    Informations forums :
    Inscription : Avril 2007
    Messages : 25
    Points : 17
    Points
    17
    Par défaut
    Je vais essayer de faire comme vous me l'avez indiquer précedemment
    Si je veux utiliser une URL, je dois procéder comment?
    Ca fonctionne comment?

    Parce que le but étant de récupérer le contenu de mon fichier txt pour le placer dans l'attribut "homeMessage" de ma request.

  11. #11
    En attente de confirmation mail
    Profil pro
    Inscrit en
    Avril 2004
    Messages
    208
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2004
    Messages : 208
    Points : 218
    Points
    218
    Par défaut
    Oups... un getRealPath doit etre en absolu je pense. normal que tu bouffes un null ! sinon pousecuriser tu fais : if(file != null && file.exists) et dans le else tu log (log4j t'aimes profondement)... comme ca tant que tu vois ton log tu rectifie ton path ou la methode choisie. ca dervait le faire : courage. S tu bosse sous eclipse Ctrl+espace est ton ami (plus que google meme).

Discussions similaires

  1. Changer l'URL de déploiement
    Par daydream123 dans le forum Glassfish et Payara
    Réponses: 4
    Dernier message: 04/12/2012, 11h08
  2. ClickOnce et récupération de l'URL de déploiement
    Par Flaw35 dans le forum Général Dotnet
    Réponses: 1
    Dernier message: 03/02/2009, 09h42
  3. test Url Image
    Par Alex35 dans le forum VB.NET
    Réponses: 2
    Dernier message: 08/01/2009, 12h15
  4. Réponses: 6
    Dernier message: 06/02/2008, 13h53

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