[opencms-dev] CmsTemplateBean cannot be resolved to a type

Lorenz Lammersdorf lorenz.lammersdorf at kernbrand.ch
Wed Sep 16 11:44:35 CEST 2015


hi ricardo,

obviously your resource ids in opencms-modules.xml are different from 
your old installation ("1234" in the example below). compare your old 
opencms-modules.xml to the new one and fix the ids.

<resourcetypes>
...
<type class="org.opencms.file.types.CmsResourceTypeXmlContent" 
name="yourContentType" id="1234">

if you import a module opencms prevents existing resource ids from being 
overwritten. by default, opencms uses for "internal" modules ids  < 
1000, if you're module comes with an already used id the newly imported 
id is changed.
unfortunately opencms doesn't update the resource's type ids stored in 
the database, so the connection between resource type and workplace 
resource becomes lost.

regards
lorenz

Am 16.09.2015 um 11:03 schrieb Paul-Inge Flakstad:
> Good morning Ricardo and the rest of y’all,
>
> It’s a bit unclear to me what you mean here.
>
> If you are talking about ...
>
> ... the xsd files themselves (e.g. mytype.xsd):
>
> xsd files *are* just text files. They don’t have a more specific type,
> and should appear in the OpenCms workplace as type “plain”.
>
> ... xmlcontent files (e.g. resources of type “mytype”):
>
> If these appear as the “plain” or “uknown” type in the OpenCms
> workplace, it means the resource type is not recognized by OpenCms.
> Either because the resource type is not properly installed, OR your
> servlet container has not been re-deployed after the install. Your log
> should contain the info you need. Try restarting the servlet container
> (i.e. Tomcat) and keep an eye on {OPENCMS_HOME}/WEB-INF/logs/opencms.log
> – look for errors during OpenCms startup. Also, you may want to check
> the error you get when you try to edit one of your unrecognized resource
> types.
>
> If you don’t mind me asking; Exactly *how* did you migrate your modules
> from the old system to the new one...? (It seems to me all your errors
> so far have been somehow related to broken module installs.)
>
> Cheers,
>
> Paul
>
> *From:*opencms-dev-bounces at opencms.org
> [mailto:opencms-dev-bounces at opencms.org] *On Behalf Of *Ricardo Sanchez
> *Sent:* 16. september 2015 10:04
> *To:* opencms-dev at opencms.org
> *Subject:* Re: [opencms-dev] CmsTemplateBean cannot be resolved to a type
>
> Good morning community:
>
> I've found part of the solution to this problem. I looked at the part
> that says that the pointer was importing to a null reference and I
> realized that it was related to the xsd that is created in the module
> itself we use for our website.
>
> We have created 12 different types of content created and when I go to
> the folder from where the use I see that they all appear as text file
> and not the kind I want to use, that is, it does not recognize me the xsd.
>
> I found a solution that is right click on the resource you want to
> modify, go to Advanced > Change type and there you can select the new
> type. As you will understand this task to make migrating from an older
> version is quite tedious because I have thousands of news, folders, and
> others ... My question is ... is there any way that recognizes the xsd
> directly without having to go changing by hand recourse to appeal?
>
> For if you serve as a reference, the structure of our own module is:
>
> - Classes (here we have the properties to our workspace defined for
> Spanish and English)
>
> - Elements
>
> - Galleries (where are pdfs, images, other files that are part of the web)
>
> - XmlSchemaDefinitions (where are our own xsd created)
>
> - The JSP that serve as reference for templates
>
> - Lib (folder which is currently empty)
>
> - Resources (where css, js and images are)
>
> - Templates (JSP templates)
>
> Within XMLSchemaDefinitions, they are xsd:
>
> - Contenido.xsd
>
> - Curso.xsd
>
> - Directorio.xsd
>
> - Documento.xsd
>
> - Enlaces.xsd
>
> - Imagenes.xsd
>
> - Noticias.xsd
>
> - Ponente.xsd
>
> - Pregunta.xsd
>
> - Titulo.xsd
>
> What am I missing? Any change in a configuration file?
>
> Thanks for your comprehension. Best regards.
>
> 2015-09-14 14:15 GMT+02:00 Ricardo Sanchez <ricsanc1987 at gmail.com
> <mailto:ricsanc1987 at gmail.com>>:
>
> Hello list:
>
> I imported the templateone, I assure that within it is the class that
> needs to function properly and still no go. I give you an example of the
> error message shown me:
>
> Stacktrace:
>
> Motivo: Unable to compile class for JSP:
>
> An error occurred at line: 16 in the jsp file:
> /WEB-INF/jsp/offline/system/modules/org.opencms.frontend.templatetwo/templates/main.jsp
>
> CmsTemplateLayout cannot be resolved to a type
>
> 13: // be found at the following VFS location:
>
> 14: //
> /system/modules/org.opencms.frontend.templatetwo/java_src/CmsTemplateLayout.java
>
> 15:
>
> 16: CmsTemplateLayout cms = new CmsTemplateLayout(pageContext, request,
> response);
>
> 17: pageContext.setAttribute("cms", cms);
>
> 18: %>
>
> 19: <cms:template element="head">
>
> As I said before, the .java file is located in the appropriate folder.
> I'm a little desperate because I am incapable of finding a solution.
>
> Thank you. A greeting.
>
> 2015-09-10 13:06 GMT+02:00 Ricardo Sanchez <ricsanc1987 at gmail.com
> <mailto:ricsanc1987 at gmail.com>>:
>
> Thank you for your answer Paul.
>
> With the indications that you gave me the problem disappeared, in the
> WEB-INF lib  the jar of templateone missed. But unfortunately after a
> problem always comes another, now I get the following:
>
> An unexpected Happened mistake, but no fault message has been provided.
>
> Please check the bug details or contact your system administrator.
>
> All I did was change the path of the original file because I am now in a
> context of testing. The route is well written, I know it can be due, or
> if it is related to the problem described in the previous message.
>
> Thank you very much for your collaboration. Regards.
>
> 2015-09-10 10:18 GMT+02:00 Ricardo Sanchez <ricsanc1987 at gmail.com
> <mailto:ricsanc1987 at gmail.com>>:
>
> Hello list:
>
> I think I have already identified what the problem is. I imported in
> OpenCms modules that had in the old version that were related to
> templateone.
>
> Reviewing the queue, I saw for example when importing
> org.opencms.frontend.templateone displayed the following message:
>
> Publicando ficheros ...
>
> ( 1 / 86 ) Publicando fichero
> /system/galleries/pics/ocms-templateone/bg_nav.jpg ... o.k.
>
> ( 2 / 86 ) Publicando fichero
> /system/galleries/pics/ocms-templateone/head_img.jpg ... o.k.
>
> ( 3 / 86 ) Publicando fichero
> /system/galleries/pics/ocms-templateone/logo_alkacon_150.png ... o.k.
>
> ( 4 / 86 ) Publicando fichero
> /system/galleries/pics/ocms-templateone/logo_opencms_150.png ... o.k.
>
> ( 5 / 86 ) Publicando fichero
> /system/modules/org.opencms.frontend.templateone/classes/org/opencms/frontend/templateone/workplace.properties
> ... fallo
>
> ( 6 / 86 ) Publicando fichero
> /system/modules/org.opencms.frontend.templateone/classes/org/opencms/frontend/templateone/workplace_de.properties
> ... o.k.
>
> ( 7 / 86 ) Publicando fichero
> /system/modules/org.opencms.frontend.templateone/classes/org/opencms/frontend/templateone/workplace_en.properties
> ... fallo
>
> ( 8 / 86 ) Publicando fichero
> /system/modules/org.opencms.frontend.templateone/classes/templateone.properties
> ... fallo
>
> ( 9 / 86 ) Publicando fichero
> /system/modules/org.opencms.frontend.templateone/classes/templateone_de.properties
> ... o.k.
>
> ( 10 / 86 ) Publicando fichero
> /system/modules/org.opencms.frontend.templateone/classes/templateone_en.properties
> ... fallo
>
> ( 11 / 86 ) Publicando fichero
> /system/modules/org.opencms.frontend.templateone/classes/templateone_form.properties
> ... fallo
>
> ( 12 / 86 ) Publicando fichero
> /system/modules/org.opencms.frontend.templateone/classes/templateone_form_de.properties
> ... o.k.
>
> ( 13 / 86 ) Publicando fichero
> /system/modules/org.opencms.frontend.templateone/classes/templateone_form_en.properties
> ... fallo( 56 / 86 ) Publicando fichero
> /system/modules/org.opencms.frontend.templateone/resources/icons/ic_app_htm.gif
> ... fallo
>
> ( 57 / 86 ) Publicando fichero
> /system/modules/org.opencms.frontend.templateone/resources/icons/ic_app_html.gif
> ... fallo( 65 / 86 ) Publicando fichero
> /system/modules/org.opencms.frontend.templateone/resources/menu_over.js
> ... fallo
>
> Failure = failure
>
> Similarly it works on other modules such as
> org.opencms.frontend.templateone.form importé
>
> org.opencms.frontend.layoutpage
>
> org.opencms.frontend.templatetwo
>
> org.opencms.frontend.templatetwo.demo
>
> When I import org.opencms.frontend.templateone.modules also displays the
> following error:
>
> (3/64) Publishing file
> /system/modules/org.opencms.frontend.templateone.modules/classes/org/opencms/frontend/templateone/modules/workplace_en.properties
> ... Failure (2) File Indexing failure
> /system/modules/org.opencms.frontend.templateone.modules/copyresources/_configuration/layoutright
> ...
>
> org.opencms.main.CmsRuntimeException: Unable to unmarshal XML schema
> definition content "opencms:
> //system/modules/org.opencms.frontend.templateone.modules/schemas/layouts.xsd".
>
> What may be due? Do I have to change something in the modules that I
> imported? Thanks for your answers.
>
> Best regards.
>
>
>
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/cgi-bin/mailman/listinfo/opencms-dev
>
>
>



More information about the opencms-dev mailing list