cancel
Showing results for 
Search instead for 
Did you mean: 

no puedo compilar PageTag.class

no-name
Champ in-the-making
Champ in-the-making
Buenos dias, se que tenia que poner un titulo curioso para ver si me echais una mano a entender java.

No os voy a engañar yo soy mas de PHP C++ y cositas asi, donde los compiladores funcionan a la primera y no necesito volverme picha, bien la cuestion es la suiguiente, queria modificar la parte de abajo de alfresco para quitar lo que no tiene garantia ni nada, para poner que es mi empresa la que se encargara del soporte de ese alfresco, un numero de telefono la web tal y cual, y seguido los siguientes pasos:

-Buscar el jar correspondiente en este caso: alfresco-web-client.jar
-Lo descomprimo para podes trabjar con el
-edito el archivo que tiene esta clase: org/alfresco/web/ui/repo/tag/PageTag.class (para esto uso un decompilador llamado DJ Java Decompiler)
-Lo guardo como PageTag.java

Hasta aqui no hay ningun problema, todo se hace correctamente.

entonces me voy al cmd (bash shell o como se llame esa cosa negra de windows)y yo con toda mi ilusion escribo:
javac PageTag.java

A lo que el me dice para desilusionarme:

PageTag.java:5: package javax.faces.context does not exist
import javax.faces.context.FacesContext;
                         ^
PageTag.java:6: package javax.servlet.http does not exist
import javax.servlet.http.HttpServletRequest;
                        ^
PageTag.java:7: package javax.servlet.jsp does not exist
import javax.servlet.jsp.*;
^
PageTag.java:8: package javax.servlet.jsp.tagext does not exist
import javax.servlet.jsp.tagext.TagSupport;
                              ^
PageTag.java:9: package org.alfresco.web.app does not exist
import org.alfresco.web.app.Application;
                          ^
PageTag.java:10: package org.alfresco.web.app.servlet does not exist
import org.alfresco.web.app.servlet.FacesHelper;
                                  ^
PageTag.java:11: package org.alfresco.web.bean.coci does not exist
import org.alfresco.web.bean.coci.CCProperties;
                                ^
PageTag.java:12: package org.alfresco.web.ui.common does not exist
import org.alfresco.web.ui.common.Utils;
                                ^
PageTag.java:13: package org.apache.commons.logging does not exist
import org.apache.commons.logging.Log;
                                ^
PageTag.java:14: package org.apache.commons.logging does not exist
import org.apache.commons.logging.LogFactory;
                                ^
PageTag.java:16: cannot find symbol
symbol: class TagSupport
public class PageTag extends TagSupport
                            ^
PageTag.java:85: cannot find symbol
symbol  : class JspException
location: class org.alfresco.web.ui.repo.tag.PageTag
       throws JspException
              ^
PageTag.java:175: cannot find symbol
symbol  : class JspException
location: class org.alfresco.web.ui.repo.tag.PageTag
       throws JspException
              ^
PageTag.java:259: cannot find symbol
symbol  : class Log
location: class org.alfresco.web.ui.repo.tag.PageTag
   private static final Log logger =
LogFactory.getLog(org/alfresco/web/ui/repo/tag/PageTag);
                        ^
PageTag.java:76: cannot find symbol
symbol  : variable super
location: class org.alfresco.web.ui.repo.tag.PageTag
       super.release();
       ^
PageTag.java:259: cannot find symbol
symbol  : variable org
location: class org.alfresco.web.ui.repo.tag.PageTag
   private static final Log logger =
LogFactory.getLog(org/alfresco/web/ui/repo/tag/PageTag);
                                                       ^
PageTag.java:259: illegal forward reference
   private static final Log logger =
LogFactory.getLog(org/alfresco/web/ui/repo/tag/PageTag);
                                                           ^
PageTag.java:259: cannot find symbol
symbol  : variable web
location: class org.alfresco.web.ui.repo.tag.PageTag
   private static final Log logger =
LogFactory.getLog(org/alfresco/web/ui/repo/tag/PageTag);
                                                                    ^
PageTag.java:259: cannot find symbol
symbol  : variable ui
location: class org.alfresco.web.ui.repo.tag.PageTag
   private static final Log logger =
LogFactory.getLog(org/alfresco/web/ui/repo/tag/PageTag);
                                                                        ^
PageTag.java:259: cannot find symbol
symbol  : variable repo
location: class org.alfresco.web.ui.repo.tag.PageTag
   private static final Log logger =
LogFactory.getLog(org/alfresco/web/ui/repo/tag/PageTag);
                                                                           ^
PageTag.java:259: cannot find symbol
symbol  : variable tag
location: class org.alfresco.web.ui.repo.tag.PageTag
   private static final Log logger =
LogFactory.getLog(org/alfresco/web/ui/repo/tag/PageTag);

         ^
PageTag.java:259: cannot find symbol
symbol  : variable PageTag
location: class org.alfresco.web.ui.repo.tag.PageTag
   private static final Log logger =
LogFactory.getLog(org/alfresco/web/ui/repo/tag/PageTag);

             ^
PageTag.java:259: cannot find symbol
symbol  : variable LogFactory
location: class org.alfresco.web.ui.repo.tag.PageTag
   private static final Log logger =
LogFactory.getLog(org/alfresco/web/ui/repo/tag/PageTag);
                                     ^
PageTag.java:91: cannot find symbol
symbol  : class HttpServletRequest
location: class org.alfresco.web.ui.repo.tag.PageTag
           String reqPath =
((HttpServletRequest)pageContext.getRequest()).getContextPath();
                              ^
PageTag.java:91: cannot find symbol
symbol  : variable pageContext
location: class org.alfresco.web.ui.repo.tag.PageTag
           String reqPath =
((HttpServletRequest)pageContext.getRequest()).getContextPath();
                                                 ^
PageTag.java:92: cannot find symbol
symbol  : variable pageContext
location: class org.alfresco.web.ui.repo.tag.PageTag
           Writer out = pageContext.getOut();
                        ^
PageTag.java:93: cannot find symbol
symbol  : variable Application
location: class org.alfresco.web.ui.repo.tag.PageTag
           if(!Application.inPortalServer())
               ^
PageTag.java:110: cannot find symbol
symbol  : variable pageContext
location: class org.alfresco.web.ui.repo.tag.PageTag

out.write(Utils.encode(Application.getMessage(pageContext.getSession(),
titleId)));
                                                                 ^
PageTag.java:110: cannot find symbol
symbol  : variable Application
location: class org.alfresco.web.ui.repo.tag.PageTag

out.write(Utils.encode(Application.getMessage(pageContext.getSession(),
titleId)));
                                          ^
PageTag.java:110: cannot find symbol
symbol  : variable Utils
location: class org.alfresco.web.ui.repo.tag.PageTag

out.write(Utils.encode(Application.getMessage(pageContext.getSession(),
titleId)));
                             ^
PageTag.java:113: cannot find symbol
symbol  : variable Utils
location: class org.alfresco.web.ui.repo.tag.PageTag
                   out.write(Utils.encode(title));
                             ^
PageTag.java:161: cannot find symbol
symbol  : variable Application
location: class org.alfresco.web.ui.repo.tag.PageTag
           if(!Application.inPortalServer())
               ^
PageTag.java:169: cannot find symbol
symbol  : class JspException
location: class org.alfresco.web.ui.repo.tag.PageTag
           throw new JspException(ioe.toString());
                     ^
PageTag.java:179: cannot find symbol
symbol  : class HttpServletRequest
location: class org.alfresco.web.ui.repo.tag.PageTag
           HttpServletRequest req =
(HttpServletRequest)pageContext.getRequest();
           ^
PageTag.java:179: cannot find symbol
symbol  : class HttpServletRequest
location: class org.alfresco.web.ui.repo.tag.PageTag
           HttpServletRequest req =
(HttpServletRequest)pageContext.getRequest();
                                     ^
PageTag.java:179: cannot find symbol
symbol  : variable pageContext
location: class org.alfresco.web.ui.repo.tag.PageTag
           HttpServletRequest req =
(HttpServletRequest)pageContext.getRequest();
                                                        ^
PageTag.java:181: cannot find symbol
symbol  : variable pageContext
location: class org.alfresco.web.ui.repo.tag.PageTag
               pageContext.getOut().write(getAlfrescoButton());
               ^
PageTag.java:182: cannot find symbol
symbol  : variable Application
location: class org.alfresco.web.ui.repo.tag.PageTag
           if(!Application.inPortalServer())
               ^
PageTag.java:183: cannot find symbol
symbol  : variable pageContext
location: class org.alfresco.web.ui.repo.tag.PageTag
               pageContext.getOut().write("\n</body></html>");
               ^
PageTag.java:187: cannot find symbol
symbol  : class JspException
location: class org.alfresco.web.ui.repo.tag.PageTag
           throw new JspException(ioe.toString());
                     ^
PageTag.java:194: cannot find symbol
symbol  : variable super
location: class org.alfresco.web.ui.repo.tag.PageTag
       return super.doEndTag();
              ^
PageTag.java:200: cannot find symbol
symbol  : variable pageContext
location: class org.alfresco.web.ui.repo.tag.PageTag
           loginPage =
Application.getLoginPage(pageContext.getServletContext());
                                                ^
PageTag.java:200: cannot find symbol
symbol  : variable Application
location: class org.alfresco.web.ui.repo.tag.PageTag
           loginPage =
Application.getLoginPage(pageContext.getServletContext());
                       ^
PageTag.java:208: cannot find symbol
symbol  : class HttpServletRequest
location: class org.alfresco.web.ui.repo.tag.PageTag
           HttpServletRequest req =
(HttpServletRequest)pageContext.getRequest();
           ^
PageTag.java:208: cannot find symbol
symbol  : class HttpServletRequest
location: class org.alfresco.web.ui.repo.tag.PageTag
           HttpServletRequest req =
(HttpServletRequest)pageContext.getRequest();
                                     ^
PageTag.java:208: cannot find symbol
symbol  : variable pageContext
location: class org.alfresco.web.ui.repo.tag.PageTag
           HttpServletRequest req =
(HttpServletRequest)pageContext.getRequest();
                                                        ^
PageTag.java:216: cannot find symbol
symbol  : class FacesContext
location: class org.alfresco.web.ui.repo.tag.PageTag
       FacesContext fc = FacesContext.getCurrentInstance();
       ^
PageTag.java:216: cannot find symbol
symbol  : variable FacesContext
location: class org.alfresco.web.ui.repo.tag.PageTag
       FacesContext fc = FacesContext.getCurrentInstance();
                         ^
PageTag.java:219: cannot find symbol
symbol  : class CCProperties
location: class org.alfresco.web.ui.repo.tag.PageTag
           CCProperties ccProps =
(CCProperties)FacesHelper.getManagedBean(fc, "CCProperties");
           ^
PageTag.java:219: cannot find symbol
symbol  : class CCProperties
location: class org.alfresco.web.ui.repo.tag.PageTag
           CCProperties ccProps =
(CCProperties)FacesHelper.getManagedBean(fc, "CCProperties");
                                   ^
PageTag.java:219: cannot find symbol
symbol  : variable FacesHelper
location: class org.alfresco.web.ui.repo.tag.PageTag
           CCProperties ccProps =
(CCProperties)FacesHelper.getManagedBean(fc, "CCProperties");

51 errors

y yo me quedo con cara de  :shock:

Alguien me esplica un poquito en que estoy metiendo la pata, porque me imagino que durante este proceso e tenido que cometer algun error
5 REPLIES 5

pjcaracuel_2349
Confirmed Champ
Confirmed Champ
Buenas,

Asi a simple viste decirte que no has incluido el classpath en la compilacion, echale un vistazo a este post, sino en google seguro que encuentras infinidad de post.

http://foro.elhacker.net/java/import_en_java-t28791.0.html;wap2=

Saludos

no-name
Champ in-the-making
Champ in-the-making
Muchas gracias, esto me resuleve una duda, que es cual era mi fallo, ahora seme plantea otra.

Caules son los compiladores que necesitaria para esto, bien me esplicare un poquito yo tengo el path definido, y creo haberlo hecho bien porque cuando le digo javac me saltan todas las opciones que tengo, tambien alado del JDK 1.6.0_12 tengo una carpeta que se llama jre6 que es la que creo que usa alfresco y dentro de bin hay un monton de .dll (que si no estoy equivocado es donde se define lo que a mi me da errores)

Ahora no tengo muy claro como definir o decirle que use estos tambien para que no salte errores, me podeis guiar un poquito mas, o decirme si solo con el jdk 1.6 no me vale y necesito bajarme e intalar alguna cosilla mas


Muchas gracias de antemano.

pjcaracuel_2349
Confirmed Champ
Confirmed Champ
Buenas,

No necesitas bajarte nada mas, yo uso eclipse para desarrollar, pero si te creas una variable de entorno CLASSPATH y le asignas un valor tal que p.e. C:\Alfresco\tomcat\webapps\alfresco\WEB-INF\lib te deberia funcionar.

Saludos

no-name
Champ in-the-making
Champ in-the-making
E probado

C:\Documents and Settings\usuario\Escritorio>JAVAC -classpath C:\Alfresco\tomcat\w
ebapps\alfresco\WEB-INF\lib -classpath c:\Alfresco\tomcat\webapps\alfresco\WEB-INF\clas
ses PageTag.java

C:\Documents and Settings\usuario\Escritorio>JAVAC -classpath C:\Alfresco\tomcat\w
ebapps\alfresco\WEB-INF\lib PageTag.java

C:\Documents and Settings\usuario\Escritorio>JAVAC -classpath c:\Alfresco\tomcat\webapps\alfresco\WEB-INF\clas
ses PageTag.java

y la respuesta es la misma 51 errores.

No entiendo, que tengo mal configurado, esque a mi me parece que es algo que no tengo bien definido, pero esque no se que puede ser.

pjcaracuel_2349
Confirmed Champ
Confirmed Champ
Buenas,

Entiendo que porque tendras que añadir los .jar que necesites, revisa esta entrada sobre el uso de la variable CLASSPATH

http://javabasico.osmosislatina.com/curso/progbasico/classp.htm

Saludos