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

Paul-Inge Flakstad flakstad at npolar.no
Wed Sep 16 16:21:06 CEST 2015


Hi again Ricardo & Lorenz

Yes, the ID is one thing that could break the resource type. That’s why I asked to check the log; any conflicting IDs are reported during startup. But if there is no log... :/

Just to make sure we’ve eliminated any confusion here:
This problem is *not* related to your XSDs. They define the *content* for a resource type. Your issue is with the very resource type itself. (And once you’ve fixed that issue, your files will return to their correct type again.)

Like Lorenz said, you'll need to apply your fix in the module configuration file:
{OPENCMS_HOME}/WEB-INF/config/opencms-modules.xml

It's likely just a matter of assigning a new ID to the resource type you're struggling with. Remember to re-deploy OpenCms (i.e. restart Tomcat) in order for your changes to take effect.

PS: Gintonic is a favorite of mine, hehe :)

Good luck,
Paul
-------------
From: opencms-dev-bounces at opencms.org [mailto:opencms-dev-bounces at opencms.org] On Behalf Of Lorenz Lammersdorf
Sent: 16. september 2015 11:45
To: The OpenCms mailing list
Cc: ricsanc1987 at gmail.com
Subject: Re: [opencms-dev] CmsTemplateBean cannot be resolved to a type

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

From: opencms-dev-bounces at opencms.org [mailto:opencms-dev-bounces at opencms.org] On Behalf Of Ricardo Sanchez
Sent: 16. september 2015 11:38
To: opencms-dev at opencms.org
Subject: Re: [opencms-dev] CmsTemplateBean cannot be resolved to a type

Thank you for your quick response Paul.

About the file contents opencms.log nothing I can tell you becouse it is absolutely empty.

Probably I am expressing wrong and I try to do better now. I will explain with an example:

On my site I have a folder called home and within another call copyright. This copyright folder containing what are links both to a disclaimer as to copyrigth company.

The problem is that these files in version 7.5.4 of OpenCms itself appear as structured content types links in version 9.5.2 appear as text file. I do not know if I have now expressed well.

I wanted to know if there is any way to avoid having to change them one by one or if there is something that modify xsd for the original problem between versions.

How did the migration, I installed version 9.5.2 of OpenCms and directly impact both the database and the necessary modules. Particularly with my business module itself I had no problem and reported the queue was imported correctly, errors related to templateone and templatetwo got solve importing from a clean version of OpenCms 7.5.4.

Thank you very much for your attention Paul, you are invited to a gintonic if you ever decide to come to Spain.

2015-09-16 10:04 GMT+02:00 Ricardo Sanchez <ricsanc1987 at gmail.com<mailto:ricsanc1987 at gmail.com>>:
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.




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20150916/634fb68f/attachment.htm>


More information about the opencms-dev mailing list