Re: Change Velocity Template Directory in Solr 4.6
Thank you very much for the confirmation iorixxx. When I started this thread on Dec. 6, I did not know about the confluence wiki (https://cwiki.apache.org/confluence/display/solr/Apache+Solr+Reference+Guide). I learned about it through another thread I started (http://lucene.472066.n3.nabble.com/Use-of-Deprecated-Classes-SortableIntField-SortableFloatField-SortableDoubleField-tp4105762p4106001.html). I think that is much more up to date and has a lot more information than the official Solr Wiki and I would be reading it before posting here. Thank you again for your help. O. O. -- View this message in context: http://lucene.472066.n3.nabble.com/Change-Velocity-Template-Directory-in-Solr-4-6-tp4105381p4106467.html Sent from the Solr - User mailing list archive at Nabble.com.
Re: Change Velocity Template Directory in Solr 4.6
Hi Olson, You are correct v.base_dir parameter is not used at all after SOLR-4882. "{corename}/conf/velocity" is the only option. solr.allow.unsafe.resourceloading system property does not affect this behavior. Wiki needs update. (confluence does not mention v.base_dir parameter) Do you want to add your findings to velocity wiki page? P.S. If you don't have a wiki account anyone can create it. But to edit the wiki, your username should be added wiki contributors group. This is achieved by sending an e-mail to solr user mailing list. On Wednesday, December 11, 2013 10:49 PM, O. Olson wrote: Thank you iorixxx. Yes, when I run: > java -Dsolr.allow.unsafe.resourceloading=true -jar start.jar And I then load the root of my site, I get: ERROR - 2013-12-11 14:36:03.434; org.apache.solr.common.SolrException; null:java.io.IOException: Unable to find resource 'browse.vm' at org.apache.solr.response.VelocityResponseWriter.getTemplate(VelocityResponseWriter.java:174) at org.apache.solr.response.VelocityResponseWriter.write(VelocityResponseWriter.java:50) In the above case, in the solrconfig.xml I have set: MyVMTemplates And my velocity templates are in /corename/conf/MyVMTemplates . If you look at the VelocityResponseWriter at http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_4_6/solr/contrib/velocity/src/java/org/apache/solr/response/VelocityResponseWriter.java?revision=1541081&view=markup nowhere does it use v.base_dir. So it seems that you need to name the velocity template directory as "velocity". (I tried to set it to "/corename/conf/velocity" and it works without any errors.) Thank you, O. O. -- View this message in context: http://lucene.472066.n3.nabble.com/Change-Velocity-Template-Directory-in-Solr-4-6-tp4105381p4106232.html Sent from the Solr - User mailing list archive at Nabble.com.
Re: Change Velocity Template Directory in Solr 4.6
Thank you iorixxx. Yes, when I run: > java -Dsolr.allow.unsafe.resourceloading=true -jar start.jar And I then load the root of my site, I get: ERROR - 2013-12-11 14:36:03.434; org.apache.solr.common.SolrException; null:java.io.IOException: Unable to find resource 'browse.vm' at org.apache.solr.response.VelocityResponseWriter.getTemplate(VelocityResponseWriter.java:174) at org.apache.solr.response.VelocityResponseWriter.write(VelocityResponseWriter.java:50) In the above case, in the solrconfig.xml I have set: MyVMTemplates And my velocity templates are in /corename/conf/MyVMTemplates . If you look at the VelocityResponseWriter at http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_4_6/solr/contrib/velocity/src/java/org/apache/solr/response/VelocityResponseWriter.java?revision=1541081&view=markup nowhere does it use v.base_dir. So it seems that you need to name the velocity template directory as "velocity". (I tried to set it to "/corename/conf/velocity" and it works without any errors.) Thank you, O. O. -- View this message in context: http://lucene.472066.n3.nabble.com/Change-Velocity-Template-Directory-in-Solr-4-6-tp4105381p4106232.html Sent from the Solr - User mailing list archive at Nabble.com.
Re: Change Velocity Template Directory in Solr 4.6
Hi Olson, Even if you set -Dsolr.allow.unsafe.resourceloading=true, do you still get IOException("For security reasons, SolrResourceLoader cannot load..")? On Wednesday, December 11, 2013 12:17 AM, O. Olson wrote: Hi, Does anyone have a clue regarding this? Or would this question be more appropriate on the Solr-Dev? After posting this I realized that the template directory needs to be named "velocity" even if you place it under /core/conf/. This seems to be too restrictive. O. O. -- View this message in context: http://lucene.472066.n3.nabble.com/Change-Velocity-Template-Directory-in-Solr-4-6-tp4105381p4106012.html Sent from the Solr - User mailing list archive at Nabble.com.
Re: Change Velocity Template Directory in Solr 4.6
Hi, Does anyone have a clue regarding this? Or would this question be more appropriate on the Solr-Dev? After posting this I realized that the template directory needs to be named "velocity" even if you place it under /core/conf/. This seems to be too restrictive. O. O. -- View this message in context: http://lucene.472066.n3.nabble.com/Change-Velocity-Template-Directory-in-Solr-4-6-tp4105381p4106012.html Sent from the Solr - User mailing list archive at Nabble.com.
Change Velocity Template Directory in Solr 4.6
I would like to know how to set the Velocity Template Directory in Solr. About 6 months ago I asked this question on this list: http://lucene.472066.n3.nabble.com/Change-Velocity-Template-Directory-td4078120.html At that time Erik Hatcher advised me to use the v.base_dir in solrconfig.xml. This worked perfectly in Solr 4.3. However now I am attempting to move my code/data to Solr 4.6, and this does not work i.e. it does not recognize the v.base_dir in solrconfig.xml. Doing a diff of org.apache.solr.response.VelocityResponseWriter I can see that some code has been removed from the getEngine() method in the new 4.6 version. I was discussing this with hossman on the IRC, and he pointed me to https://issues.apache.org/jira/browse/SOLR-4882 I understand that this is a security issue and I am ready to take the risk because for now this would only be used internally by non-technical folk. Hossman pointed me to https://gist.github.com/hossman/7827910 This is a system property solr.allow.unsafe.resourceloading=true that would supposedly enable unsafe template loading from other locations. However this does not work. (Here I am assuming I start up Solr with java -Dsolr.allow.unsafe.resourceloading= -jar start.jar i.e. I have tried setting this property on the commandline.) Any ideas? If this has been changed, then someone might need to remove v.base_dir from the documentation at http://wiki.apache.org/solr/VelocityResponseWriter Thank you, O. O.