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>
Related
I am trying to declare a new JNDI with the tool jboss-cli.sh.
This is my basic instruction:
/subsystem=naming/binding=java:/comp/env/config/rutaLogback:add(value="/var/opt/logback.xml",binding-type=simple)
The problem is that my value has a dot (value="/var/opt/logback.xml") and when I execute it , the value shown is only "xml" instead of the complete value that I wrote in the instruction.
I tried to escape the dot by many different ways.
:add(value="/var/opt/logback\.xml",binding-type=simple)
:add(value="/var/opt/logback\\.xml",binding-type=simple)
:add(value="/var/opt/logback\\\.xml",binding-type=simple)
:add(value="/var/opt/logback.xml",binding-type=simple)
Etc...
But it doesn`t work..
I expect to obtain the value /var/opt/logback.xml in the JNDI when i look that in the server console.
Finally I found the solution:
I watch the value in the standalone.xml and there the value is OK!! The problem seems to be only with the viewer of the admin console of the JBOSS and it doesn`t matter!
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)
Using pentaho 5.3, Modified Java Script Value step to inject those data.
I want to dynamically set path and names in the MongoDB Output step. Here is my code
var meta = new org.pentaho.di.trans.TransMeta( source_path );
var mongoStep = meta.findStep("MongoDB Output");
mongoStep.setDescription('This is MongoDB Output by Ray');
Alert(mongoStep.getName()); // code is ok until here.
var mongoStepMeta = mongoStep.getStepMetaInterface() // error occurs here
When I want to get the getStepMetaInterface() to use step functions, the error occurs.
java.lang.LinkageError: loader constraint violation: loader (instance of org/pentaho/di/core/plugins/KettleURLClassLoader) previously initiated loading for a different type with name "org/pentaho/metastore/api/IMetaStore"
This error seems to be generated by the violation of .jar.
But when I use those original steps, like "Microsoft Access Input", I can successfully get getStepMetaInterface(). In this way, I can use all the functions defined in AccessInputMeta.java.
From my point of view, this problem may have a relation to the MongoDB Output step, because this is a plugin for kettle, but I am not sure.
Any response is appreciated!!
Yep, it's because of the plugin system. The Modified Java Script step and the Access Input step (among many others) are all in the Kettle engine and share a classloader. External plugins (like MongoDB Input/Output) have their own isolated classloaders. You have to do some voodoo with thread context classloaders and reflection in order to get at the Meta classes for those steps.
Here's an example of the hoops you have to jump through to get at external plugins (the Big Data plugin in this example) from the Modified Java Script step:
https://github.com/brosander/pentaho-hadoop-shims/blob/verification-2/test/verification/jobs/dependencies/ForceHiveToConnectRemotely.ktr
First, thanks to Mass who solves the problem.
Here is his advice:
This problem is caused by jar file conflict.
In pentaho installation there are two jar files:
-lib/metastore-5.3.0.0-213.jar
-plugins/pentaho-mongodb-plugin/lib/metastore-5.3.0.0-213.jar
Just remove the last jar file, this error will disappear.
I would like to map pages such domain/content/myProject/home.html to domain/home.html. /content/myProject/ is not needed. I have the following code:
String newpath = getResourceResolver().map(page.getPath());
this does not change anything. newpath is stay page.getPath()
how to solve this issue?
Answering as this question as it remains unanswered. Here is an example of how the etc mappings should look like:
Trick is you add 2 entries to sling:internalRedirect as / and /content/example/
AEM first tries to resolve resources with first entry '/'. So non page URLs like /etc/designs, /content/dam etc will be addressed by the first entry. If it is unable to resolve using the first one, it uses the second entry to resolve the page.
This is also the adobe recommended way for URL shortening compared to other techniques like apache redirect.
You need to create map in etc.Then Resource Resolver will take care of trimming the path .
CREATING MAPPING DEFINITIONS IN AEM
In a standard installation of AEM you can find the folder:
/etc/map/http
This is the structure used when defining mappings for the HTTP protocol. Other folders (sling:Folder) can be created under /etc/map for any other protocols that you want to map.
Configuring an Internal Redirect to /content
To create the mapping that prefixes any request to http://localhost:4503/ with /content:
Using CRXDE navigate to /etc/map/http.
Create a new node:
Type sling:Mapping
This node type is intended for such mappings, though its use is not mandatory.
Name localhost_any
Click Save All.
Add the following properties to this node:
Name sling:match
Type String
Value localhost.4503/
Name sling:internalRedirect
Type String
Value /content/
Click Save All.
This will handle a request such as:
localhost:4503/geometrixx/en/products.html
as if:
localhost:4503/content/geometrixx/en/products.html
had been requested.
You can refer here for further documentation http://docs.adobe.com/docs/en/cq/5-6-1/deploying/resource_mapping.html
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.