AnsweredAssumed Answered

desplegar mi aplicacion desde eclipse

Question asked by kunkunkunkun on Nov 17, 2010
Latest reply on Nov 22, 2010 by kunkunkunkun
Hola!
Estoy intentando desplegar mi pequeña aplicacion JSF en Alfresco, y es sencillísima pero no lo consigo. Tengo construido desde eclipse el siguiente proyecto Java:

client-extension
|_build.properties
|_build.xml
|_config
|……..|_alfresco
|……………….|_extension
|…………………………..|_model
|…………………………………..|_web-client-config-custom.xml
|_src
….|_java
….|……|_formulario.java
….|……|_formulrio.properties
….|
….|_web
….|……|_jsp
….|……….. |_extension
….|……………………|_scan.jsp
….|_META-INF
……………..|_faces-config.xml


El Jsp no tiene más, que 4 etiquetas y llama al java bean formulario.java que no es más que un simple formulario.
el faces-config.xml me crea las respectivas reglas de navegación, y los managed-beans.
Todo muy básico pero a la hora de desplegar mediante Ant, la consola de Eclipse me salta un error, BUILD FAILED
…….${alfresco.sdk.dir}/server not found.

Lo curioso, es que si dejo la carpeta src/java vacía funciona todo a la perfección y me crea el Jsp todo lo bonito que yo quiera. Pero en cuanto hago referencia al bean de java… me salta el error. He probado mil cosas y nosé como desplegarlo ya.

El build.xml no creo que sea el problema, puesto que desplegando otras cosas funciona correctamente…
No obstante aquí adjunto su código.

Build.properties

alfresco.sdk.remote.dir=/Users/Alberto_Rivas/Documents/Alfresco3.2
alfresco.sdk.server.dir=/Users/Alberto_Rivas/Documents/Alfresco3.2
alfresco.web.dir=/Users/Alberto_Rivas/Alfresco/tomcat/webapps/alfresco

Build.xml

<?xml version="1.0" encoding="UTF-8"?>
<project name="ejustice Client Extensions" default="deploy" basedir=".">
   <property file="build.properties" />

   <property name="label" value="ch3" />
   <property name="project.dir" value="." />
   <property name="build.dir" value="${project.dir}/build" />
   <property name="bin.dir" value="${project.dir}/bin" />
   <property name="project.name" value="ejustice-client-extensions" />
   <property name="package.file.zip" value="${build.dir}/${project.name}.zip" />
   <property name="package.file.jar" value="${build.dir}/${project.name}.jar" />
   <property name="project.file.zip" value="${build.dir}/${project.name}-project-${label}.zip" />
    <property name="package.file.amp" value="${build.dir}/${project.name}.amp" />
    <property name="module.id" value="com.ejustice.module.extensions.Core" />
    <property name="module.dir" value="/alfresco/module" />
   <property name="source.dir" value="${project.dir}/src" />
   <property name="config.dir" value="${project.dir}/config" />
   <property name="data.dir" value="${project.dir}/data" />
   <property name="web.dir" value="${source.dir}/web" />
   <property name="java.dir" value="${source.dir}/java" />
   <property name="extension.dir" value="/alfresco/extension" />

   <path id="classpath.server">
      <fileset dir="${alfresco.sdk.dir}/server" includes="**/*.jar" />
   </path>

   <path id="classpath.remote">
      <fileset dir="${alfresco.sdk.dir}/remote" includes="**/*.jar" />
   </path>   

   <path id="classpath.build">
       <fileset dir="${build.dir}" includes="**/*.jar" />
    </path>
   
    <path id="class.path">
        <dirset dir="${build.dir}" />
        <fileset dir="../../lib/server" includes="**/*.jar"/>
    </path>
   
   <target name="clean" description="Removes all generated files">
      <delete dir="${build.dir}" />
      <delete dir="${bin.dir}" />      
   </target>

   <target name="clean-tomcat" description="Removes deployed extension directory, lib/ejustice*.jar, and ejustice/" >
      <delete dir="${alfresco.web.dir}/WEB-INF/classes/alfresco/extension" />
      <delete dir="${alfresco.web.dir}/WEB-INF/classes/alfresco/module" />
      <delete dir="${alfresco.web.dir}/jsp/extension" />
      <delete dir="${alfresco.web.dir}/ejustice" />
      <delete file="${alfresco.web.dir}/WEB-INF/lib/ejustice-client-extensions.jar" />
   </target>

   <target name="setup" description="Creates the ${build.dir} and ${bin.dir} directories">
      <mkdir dir="${build.dir}" />
      <mkdir dir="${bin.dir}" />      
   </target>

   <target name="package-extension" depends="setup, package-jar" description="Creates a zip called ${package.file.zip} which can be unzipped on top of an exploded Alfresco web app">
      <delete file="${package.file.zip}" />
      <zip destfile="${package.file.zip}" update="true">
         <zipfileset dir="${config.dir}${extension.dir}" prefix="WEB-INF/classes${extension.dir}" />
         <zipfileset file="${package.file.jar}" prefix="WEB-INF/lib" />
         <zipfileset dir="${web.dir}" excludes="META-INF/**" />
      </zip>
   </target>
   
   <target name="package-amp" depends="setup, package-jar" description="Packages the customizations as an Alfresco module in ${package.file.amp}">
      <delete file="${package.file.amp}" />
      <zip destfile="${package.file.amp}">
         <zipfileset file="${package.file.jar}" prefix="lib" />
         <zipfileset dir="${web.dir}" prefix="web" />
         <zipfileset file="${config.dir}${module.dir}/${module.id}/module.properties" />                  
         <zipfileset file="${config.dir}${module.dir}/${module.id}/file-mapping.properties" />
         <zipfileset file="${config.dir}${module.dir}/${module.id}/module-context.xml" prefix="config${module.dir}/${module.id}" />
         <zipfileset file="${config.dir}${module.dir}/${module.id}/ejustice-core.properties" prefix="config${module.dir}/${module.id}" />         
         <zipfileset dir="${data.dir}" prefix="config${module.dir}/${module.id}/bootstrap" />
         <zipfileset dir="${config.dir}${extension.dir}/model" prefix="config${module.dir}/${module.id}/model" />
          <!–<zipfileset file="${config.dir}${extension.dir}/ejustice-model-context.xml" prefix="config${module.dir}/${module.id}" />–>
         <zipfileset file="${config.dir}${extension.dir}/web-client-config-custom.xml" prefix="config${module.dir}/${module.id}/ui" />         
      </zip>
   </target>
   
   <target name="install-amp" depends="package-amp" description="Uses the Alfresco MMT to install the AMP into ${alfresco.war.path}">
        <java dir="." fork="true" classname="org.alfresco.repo.module.tool.ModuleManagementTool">
         <classpath refid="classpath.server"/>
            <arg line="install ${package.file.amp} ${alfresco.war.path} -force -verbose"/>
        </java>
    </target>
   
    <target name="deploy-amp" depends="install-amp" description="Unzips the AMP'd WAR file into ${alfresco.web.dir}">
         <unzip src="${alfresco.war.path}" dest="${alfresco.web.dir}" />
    </target>

   <target name="deploy" depends="package-extension" description="Unzips the ${package.file.zip} into ${alfresco.web.dir}">
      <unzip src="${package.file.zip}" dest="${alfresco.web.dir}" />
   </target>

   <target name="zip-project" depends="setup" description="Zips the entire Eclipse project as-is into ${project.file.zip}">
      <delete file="${project.file.zip}" />
      <zip destfile="${project.file.zip}">
         <zipfileset dir="${project.dir}" excludes="build/** bin/**" prefix="${project.name}-${label}" />
      </zip>
   </target>   

   <target name="compile" description="Compiles src to ${bin.dir}">
      <mkdir dir="${bin.dir}" />
      <javac srcdir="${source.dir}/java/" destdir="${bin.dir}" source="1.5" target="1.5" debug="on" fork="yes" deprecation="on">
         <classpath refid="classpath.server"/>
         <classpath refid="classpath.remote"/>
      </javac>
      <!– copy in non-compiled files like props if needed –>
      <copy todir="${bin.dir}">
         <fileset dir="${source.dir}/java" excludes="**/*.java"/>
      </copy>
   </target>
   
   <target name="package-jar" depends="setup, compile"
      description="Jars up the compiled classes and ${web.dir}/META-INF into ${package.file.jar}">
         <delete file="${package.file.jar}" />
         <jar destfile="${package.file.jar}">
            <fileset dir="${bin.dir}" includes="com/**" />
            <zipfileset dir="${web.dir}/META-INF" excludes="*.zip" prefix="META-INF" />            
         </jar>
   </target>
   
   <target name="data-creator" depends="package-jar" >
      <java dir="./bin" fork="true" classname="com.ejustice.examples.ejusticeDataCreator">
         <classpath refid="classpath.build"/>
         <classpath refid="classpath.remote"/>
            <arg line="admin admin /app:company_home/cm:ejustice/cm:Marketing/cm:Whitepapers whitepaper whitepaper"/>
        </java>
    </target>

   <target name="data-relater" depends="package-jar" description="Run the ejustice web services examples">
      <java dir="./bin" fork="true" classname="com.ejustice.examples.ejusticeDataRelater">
         <classpath refid="classpath.build"/>
         <classpath refid="classpath.remote"/>
            <arg line="admin admin ${sourceId} ${targetId}"/>
        </java>
    </target>

   <target name="data-queries" depends="package-jar" description="Run the ejustice web services examples">
      <java dir="./bin" fork="true" classname="com.ejustice.examples.ejusticeDataQueries">
         <classpath refid="classpath.build"/>
         <classpath refid="classpath.remote"/>
            <arg line="admin admin /app:company_home/cm:ejustice/cm:Marketing/cm:Whitepapers"/>
        </java>
    </target>

   <target name="data-cleaner" depends="package-jar" description="Run the ejustice web services examples">
      <java dir="./bin" fork="true" classname="com.ejustice.examples.ejusticeDataCleaner">
         <classpath refid="classpath.build"/>
         <classpath refid="classpath.remote"/>
            <arg line="admin admin /app:company_home/cm:ejustice/cm:Marketing/cm:Whitepapers whitepaper"/>
        </java>
    </target>
   
</project>

EDITO:
el error que aparece cuando abro Alfresco es:

javax.faces.FacesException: javax.faces.FacesException: Could not retrieve value of component with path : {Component-Path : [Class: javax.faces.component.UIViewRoot,ViewId: /jsp/extension/scan.jsp][Class: javax.faces.component.html.HtmlForm,Id: _idJsp1][Class: javax.faces.component.html.HtmlInputText,Id: _idJsp3]}
caused by:
org.apache.jasper.JasperException: javax.faces.FacesException: Could not retrieve value of component with path : {Component-Path : [Class: javax.faces.component.UIViewRoot,ViewId: /jsp/extension/scan.jsp][Class: javax.faces.component.html.HtmlForm,Id: _idJsp1][Class: javax.faces.component.html.HtmlInputText,Id: _idJsp3]}
caused by:
javax.faces.FacesException: Could not retrieve value of component with path : {Component-Path : [Class: javax.faces.component.UIViewRoot,ViewId: /jsp/extension/scan.jsp][Class: javax.faces.component.html.HtmlForm,Id: _idJsp1][Class: javax.faces.component.html.HtmlInputText,Id: _idJsp3]}
caused by:
javax.faces.el.EvaluationException: Cannot get value for expression '#{formulario.id}'
caused by:
javax.faces.FacesException: java.lang.ClassNotFoundException: org.ejustice.module.Formulario
caused by:
java.lang.ClassNotFoundException: org.ejustice.module.Formulario

Outcomes