AEM: How to find location of Exception on Sightly/HTL page? - aem

I'm working on a fairly large HTL page, which is throwing a:
java.lang.IllegalArgumentException: Invalid property name
How can I find the location in the HTL that's causing this?
UPDATE
The full trace is too big for SO. I saved it here: http://pastebin.com/xajiY5MD
Here's the first few lines:
Invalid property name
Cannot serve request to /content/XXXX/en-us/cart.html in /apps/XXXXcommerce/components/content/cart/cart.html
Exception:
java.lang.IllegalArgumentException: Invalid property name
at org.apache.sling.scripting.sightly.impl.utils.RenderUtils.getProperty(RenderUtils.java:151)
at org.apache.sling.scripting.sightly.impl.utils.RenderUtils.resolveProperty(RenderUtils.java:143)
at org.apache.sling.scripting.sightly.apps.XXXXcommerce.components.content.cart.SightlyJava_cart.render(SightlyJava_cart.java:512)
at org.apache.sling.scripting.sightly.impl.engine.runtime.RenderUnit.render(RenderUnit.java:54)

This comes when you are using a property which is:
1. not defined in dialog
2. You are using it in a wrong manner(Check for double quotes vs single quotes)
3. If you are using java, that property is not present in the java class and you are trying to access it.
Pls check and respond if thats no the case and the resolution too to help others.

java.lang.IllegalArgumentException: Invalid property name without a property name apparently occurs when indexing an array using an empty value (in my case the object containing the index had gone out of scope)

Related

Object reference exception when importing content in Episerver

We are using Optimizely/Episerver CMS 11.20. When trying to export a page hierarchy from our production environment and then import the resulting ExportedFile.episerverdata file to our acceptance test environment I get the following error:
[Importing content 70725_133679] Exception: Object reference not set to an instance of an object.
I have no idea what 70725_133679 is referring to. Is there a way to look this up, e.g. via an SQL query against the "EPi" database?
It refers to a specific version of some content (which could be just about anything).
You could try to browse to https://yoursite/EPiServer/CMS/#context=epi.cms.contentdata:///70725_133679 (note the ID at the end) to see which content it is.
Got another answer on a Optimizely forum (thanks to Surjit Bharath):
The following SQL against the EPi database gives information about the referenced content:
select * from tblContent where pkID = 70725 
select * from tblWorkContent where pkID = 133679
This too points to a submit button. I have yet to understand why that block would cause an exception during import, but now I at least have a place to start digging.

how to pass a single value parameter through jndi in glassfish server?

Hi i would like to set context level parameter through JNDI but i am getting problem with Glasfish server when i am manually set the parameter like the below in web.xml
< env-entry>< env-entry-name>name< /env-entry-name>< env-entry-value>value< /env-entry-value>< env-entry-type>type< /env-entry-type>< /env-entry>
while i am setting the above patameters on web.xml it gives error like
cvc-complex-type.2.4.a: Invalid content was found starting with element 'env-entry-type'. One of
'{http://xmlns.jcp.org/xml/ns/javaee:mapped-name,
i am acquiring the initialContext object by this object i got the environment context on java:/comp/env/ now can any one help me how to set single value parameter using JNDI glass fish server in eclipse?
You need to change the order of the elements. The correct order is:
<env-entry>
<env-entry-name>name</env-entry-name>
<env-entry-type>type</env-entry-type>
<env-entry-value>value</env-entry-value>
</env-entry>

How to get the exact cause for the error - ORA-00955: name is already used by an existing object?

ORA-00955: name is already used by an existing object
There are so many statements and so many objects already. Then, how do you find out which object (table, column, sequence, view etc) caused this error to occur ?
I tried these links, but could not solve the problem -
http://www.techonthenet.com/oracle/errors/ora00955.php
http://www.dba-oracle.com/t_ora_00955_name_already_used_by_existing_object.htm
If you're running a script in SQL*Plus, you could SET ECHO ON and then spool the output to a file for later analysis.

GWT set inner HTML giving Unknown runtime error

Please let me know what i am doing wrong here:
I need to add dynamic content to my htmy table using GWT.
I am using setInnerHTML method for this
Element tableElement=(Element) Document.get().getElementById("htmltable");
tableElement.setInnerHTML("<tr><td>1</td><td>2000</td><td>2</td><td>3000</td></tr>");
But i am getting this error
com.google.gwt.core.client.JavaScriptException: (Error): Unknown runtime error
number: -2146827688
description: Unknown runtime error
Please let me know what i am doing wrong here.
this can be due to multiple reasons.
If this is happening on IE only this post covers it: Debugging IE8 Javascript Replace innerHTML Runtime Error
In Ie you can not set the inner html of a table element.
From GWT CellTableImplementation for IE:
IE doesn't support innerHTML on tbody, nor does it support removing or
replacing a tbody. The only solution is to remove and replace the rows
themselves.

How to change location of ValidationMessages.properties in Bean Validation

By default, ValidationMessages.properties can be located in root of my classpath. Can I change the location of this file like com.myapp.Anything.properties?
From the JSR-303 specification:
4.3.1.1. Default message interpolation algorithm The default message interpolator uses the following steps:
Message parameters are extracted from the message string and used as keys to search the ResourceBundle named ValidationMessages (often
materialized as the property file /ValidationMessages.properties and
its locale variations) using the defined locale (see below). If a
property is found, the message parameter is re- placed with the
property value in the message string. Step 1 is applied recursively
until no replacement is per- formed (i.e. a message parameter value
can itself contain a message parameter).
It seems that this is the default and the suggestion. To back this up the JSR-303 TCK uses TestNG to move them to the "WEB-INF/classes/" directory which is the same as "./" on the resources classpath.
(You can experiment with it but that's about all I can figure out.)
Sorry.