problematicly fetching manifest info from a war

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

problematicly fetching manifest info from a war

Chris Hostetter-3

For what it's worth, i was trying to add a quick and diry little bit of
code to _info.jsp so that we could display info about the current version
of Solr being run by accessing the manifest file, ala...

        core.getClass().getPackage().getImplementationVersion();

...and discovered it didn't work.

I freaked out a bit, thinking I still hadn't managed to get the manifest
working properly, but i'm pretty sure it's right, it's just that for
whatever reason that doesn't seem to work with a WAR, if you do the same
type of thing with a jar it works fine, we can even modify _info.jsp
to get the lucene version info out of the lucene-core-nightly.jar's
manifest file using...

        org.apache.lucene.LucenePackage.class.getPackage().getImplementationVersion();

Do any WAR/J2EE experts out there know why a JSP in a webapp can get info
out of a MANIFEST.MF from a jar in it's classpath, but not out of
the webapps own MANIFEST.MF file?

One thing we might want to consider, is puting the solt.jar in the
solr.war's lib directory, instead of adding all of the classes directly
... it would deal with this problem, and it would make our war look a
little cleaner when/if it is unpacked.



-Hoss

Reply | Threaded
Open this post in threaded view
|

Re: problematicly fetching manifest info from a war

Yonik Seeley-2
On 12/6/06, Chris Hostetter <[hidden email]> wrote:
> One thing we might want to consider, is puting the solt.jar in the
> solr.war's lib directory, instead of adding all of the classes directly
> ... it would deal with this problem, and it would make our war look a
> little cleaner when/if it is unpacked.

I don't see any reason we shouldn't (but I'm not a WAR expert).

-Yonik
Reply | Threaded
Open this post in threaded view
|

Re: problematicly fetching manifest info from a war

Erik Hatcher
In reply to this post by Chris Hostetter-3
A good example of putting some diagnostic help into a JSP page is  
Axis happy.jsp (now called HappyAxis.jsp):

        <http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/ 
webapp/HappyAxis.jsp?view=markup>

As for Solr classes - no reason not to JAR them up.  Go for it.

        Erik


On Dec 6, 2006, at 9:26 PM, Chris Hostetter wrote:

>
> For what it's worth, i was trying to add a quick and diry little  
> bit of
> code to _info.jsp so that we could display info about the current  
> version
> of Solr being run by accessing the manifest file, ala...
>
> core.getClass().getPackage().getImplementationVersion();
>
> ...and discovered it didn't work.
>
> I freaked out a bit, thinking I still hadn't managed to get the  
> manifest
> working properly, but i'm pretty sure it's right, it's just that for
> whatever reason that doesn't seem to work with a WAR, if you do the  
> same
> type of thing with a jar it works fine, we can even modify _info.jsp
> to get the lucene version info out of the lucene-core-nightly.jar's
> manifest file using...
>
> org.apache.lucene.LucenePackage.class.getPackage
> ().getImplementationVersion();
>
> Do any WAR/J2EE experts out there know why a JSP in a webapp can  
> get info
> out of a MANIFEST.MF from a jar in it's classpath, but not out of
> the webapps own MANIFEST.MF file?
>
> One thing we might want to consider, is puting the solt.jar in the
> solr.war's lib directory, instead of adding all of the classes  
> directly
> ... it would deal with this problem, and it would make our war look a
> little cleaner when/if it is unpacked.
>
>
>
> -Hoss

Reply | Threaded
Open this post in threaded view
|

Re: problematicly fetching manifest info from a war

Chris Hostetter-3

: A good example of putting some diagnostic help into a JSP page is
: Axis happy.jsp (now called HappyAxis.jsp):
:
: <http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/
: webapp/HappyAxis.jsp?view=markup>

that's a pretty cool looking page (judging by the source) ... ironicly i
don't see any version info there ... but some cool ideas about reporting
back which jar files important classes are being found in.

i went ahead and switched us to putting the JAR in the WAR, and added the
basic version info to registry.jsp


-Hoss