The path is correct. When this code runs I get the error. What happens in detail is:
As said an error when creating
the required folders are created
When using cfcollection list, âvrkâ shows up in the list
When trying to delete the collection, the same nullPointerException error
When trying to add files to the collection, also the same error
So it seems as though cfcollection did some things, but then failed. Iâve tried this with different versions of Lucene, but they all give the same error. Any ideas would be welcome.
Didnât try much with Lucene, but could you show us the full stack trace? Of course, mask any sensitive data. With a full stack trace, others may see more information to help you.
Thanks for your reply. I hope the below stack trace helps?
lucee.runtime.exp.NativeException: java.lang.NullPointerException at
org.lucee.extension.search.SearchEngineSupport.addCollection(SearchEngineSupport.java:162) at
org.lucee.extension.search.SearchEngineSupport.createCollection(SearchEngineSupport.java:131) at
lucee.runtime.tag.Collection.doCreate(Collection.java:251) at
lucee.runtime.tag.Collection.doStartTag(Collection.java:156) at
normity.applicatie.zoeken.zoekenoverzicht_cfm$cf$2m.call(/normity/applicatie/zoeken/zoekenOverzicht
.cfm:30) at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:1034) at
lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:926) at
lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:907) at
normity.application_cfc$cf$2d.udfCall(/normity/Application.cfc:239) at
lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:106) at
lucee.runtime.type.UDFImpl._call(UDFImpl.java:344) at
lucee.runtime.type.UDFImpl.call(UDFImpl.java:217) at
lucee.runtime.ComponentImpl._call(ComponentImpl.java:684) at
lucee.runtime.ComponentImpl._call(ComponentImpl.java:572) at
lucee.runtime.ComponentImpl.call(ComponentImpl.java:1911) at
lucee.runtime.listener.ModernAppListener.call(ModernAppListener.java:437) at
lucee.runtime.listener.ModernAppListener._onRequest(ModernAppListener.java:216) at
lucee.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:44) at
lucee.runtime.PageContextImpl.execute(PageContextImpl.java:2460) at
lucee.runtime.PageContextImpl._execute(PageContextImpl.java:2450) at
lucee.runtime.PageContextImpl.executeCFML(PageContextImpl.java:2421) at
lucee.runtime.engine.Request.exe(Request.java:45) at
lucee.runtime.engine.CFMLEngineImpl._service(CFMLEngineImpl.java:1179) at
lucee.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:1125) at
lucee.loader.engine.CFMLEngineWrapper.serviceCFML(CFMLEngineWrapper.java:102) at
lucee.loader.servlet.CFMLServlet.service(CFMLServlet.java:51) at
javax.servlet.http.HttpServlet.service(HttpServlet.java:742) at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198) at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:496) at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81) at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) at
org.apache.coyote.ajp.AjpProcessor.service(AjpProcessor.java:479) at
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at
org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:790) at
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1468) at
org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at
java.lang.Thread.run(Thread.java:748) Caused by: java.lang.NullPointerException
to add files to a collection the action should be refresh, not create
When dealing with removing files, both ACF and Lucee on windows do not do well with spaces in names of files or folders and the windows max path bug plagues both cf engines on windows when dealing with long path operations where you do anything over 129 characters in length, even with the longpath enabled.
try creating a collection out on the \driveroot\test or âtestcollectionâ, the above code works
Iâve modified my code so that everything is as easy and simple as possible. All it is now is (for creating the collection, not adding to the collection):
Thanks all. Although it would be nicer to use Elastic (or something similar), I know that is a lot more work than using something already available. My first hope is still that I can use Lucene, just hoping this error can be avoidedâŚ
The only thing I can think of, (and forgive me, but this weekend was exhausting and I am not fully caffeinated this morning) is my âtestâ windows box, I have stripped all the WINDOWS ACL / permissions off.
When I run the following code, it works.
This creates a collection
So you got it to work? Thatâs interesting! Perhaps it had to do with the permissions. Can you give me insight as to how you stripped all WINDOWS ACL / premissions? I want to try that as well!
This seems to be a problem only when the collection is already created. The problem Iâm having is that the error already occurs when weâre creating the collectionâŚ
You could post you code here⌠it Does work, at least for us, but you have to keep in mind you can not go over 129 characters for file operations on windows.
Unfortunately no luck. I still get the error âjava.lang.NullPointerExceptionâ⌠Thanks for your suggestions though! When I look at the folder, I can see that 2 directories are created: CFtestcollection0 and CFtestcollection220. Both of them are empty.