Hi All

One for our JAXRS gurus here...

At ApacheCon, we came up with the idea of having a welcome page on the Tika Server, so that we could point people to it to try Tika, and let them discover what it offered. Based on that, and the mailing list discussions, we raised TIKA-1269.

(Related to that is TIKA-1270, which aims to add endpoints similar to the --list- ones the Tika CLI has, which is in progress)

While we work out the best way to allow users to discover + learn about + try the various REST endpoints on TIKA-1269, I've started with something basic. This is done with the simple TikaWelcome class, which has a Path of /

The problem - when the MetadataEP and UnpackerResource are enabled, it doesn't work! With those to there, when you request / you get a 404 and the server logs:
rg.apache.cxf.jaxrs.utils.JAXRSUtils findTargetMethod
WARNING: No operation matching request path "/" is found, Relative Path: /, HTTP Method: GET, ContentType: */*, Accept: */*,. Please enable FINE/TRACE log level for more details.

However, if you comment out those two endpoint classes from the sf.setResourceClasses() call in TikaServerCLI, then the request gets correctly routed to the welcome page.

Neither MetadataEP nor UnpackerResource have a path that clashes, so I've no idea why having them active stops / working. Any ideas?

(Patch below if you want to try disabling them yourself to investigate)

Nick


Index: src/main/java/org/apache/tika/server/TikaServerCli.java
===================================================================
--- src/main/java/org/apache/tika/server/TikaServerCli.java (revision 1592656) +++ src/main/java/org/apache/tika/server/TikaServerCli.java (working copy)
@@ -92,10 +92,20 @@
       JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean();
       // Note - at least one of these stops TikaWelcome matching on /
// This prevents TikaWelcome acting as a partial solution to TIKA-1269
-      sf.setResourceClasses(MetadataEP.class, MetadataResource.class,
-              TikaResource.class, UnpackerResource.class,
-              TikaDetectors.class, TikaMimeTypes.class,
-              TikaVersion.class, TikaWelcome.class);
+//      sf.setResourceClasses(MetadataEP.class, MetadataResource.class,
+//              TikaResource.class, UnpackerResource.class,
+//              TikaDetectors.class, TikaMimeTypes.class,
+//              TikaVersion.class, TikaWelcome.class);
+      sf.setResourceClasses(
+//              MetadataEP.class,
+              MetadataResource.class,
+              TikaResource.class,
+//              UnpackerResource.class,
+              TikaDetectors.class,
+              TikaMimeTypes.class,
+              TikaVersion.class,
+              TikaWelcome.class
+      );

       List<Object> providers = new ArrayList<Object>();
       providers.add(new TarWriter());

Reply via email to