Re: [Problem found - but how to solve it properly?] 3rd party Jars with latest WO?

Ray Kiddy <[email protected]>
Newsgroups gmane.comp.web.webobjects.devel
Message-ID <[email protected]>
On Sep 11, 2007, at 12:08 AM, Will Scheidegger wrote:

> I compared two jar-frameworks I'm using in this project (one  
> working and the new one not). They were identical. Then I had a  
> close look at the output of the  build process. First things look ok:
>
> JAVA_FRAMEWORK_JARS='/System/Library/Frameworks/ 
> JavaFoundation.framework/Resources/Java /System/Library/Frameworks/ 
> JavaEOControl.framework/Resources/Java /System/Library/Frameworks/ 
> JavaEOAccess.framework/Resources/Java /System/Library/Frameworks/ 
> JavaWebObjects.framework/Resources/Java /System/Library/Frameworks/ 
> JavaWOExtensions.framework/Resources/Java /System/Library/ 
> Frameworks/JavaXML.framework/Resources/Java /System/Library/ 
> Frameworks/JavaJDBCAdaptor.framework/Resources/Java /Library/ 
> Frameworks/FFWOUtilities.framework/Resources/Java /Library/ 
> Frameworks/WOOgnl.framework/Resources/Java /Library/Frameworks/ 
> FFStatelessListDetail.framework/Resources/Java /Library/Frameworks/ 
> POIJars.framework/Resources/Java /Library/Frameworks/ 
> FrontBasePlugIn.framework/Resources/Java /Library/Frameworks/ 
> XStreamJars.framework/Resources/Java /Library/Frameworks/ 
> QuartzJars.framework/Resources/Java'
>
> and
>
> LINKED_CLASS_ARCHIVES=:/System/Library/Frameworks/ 
> JavaFoundation.framework/Resources/Java:/System/Library/Frameworks/ 
> JavaEOControl.framework/Resources/Java:/System/Library/Frameworks/ 
> JavaEOAccess.framework/Resources/Java:/System/Library/Frameworks/ 
> JavaWebObjects.framework/Resources/Java:/System/Library/Frameworks/ 
> JavaWOExtensions.framework/Resources/Java:/System/Library/ 
> Frameworks/JavaXML.framework/Resources/Java:/System/Library/ 
> Frameworks/JavaJDBCAdaptor.framework/Resources/Java:/Library/ 
> Frameworks/FFWOUtilities.framework/Resources/Java:/Library/ 
> Frameworks/WOOgnl.framework/Resources/Java:/Library/Frameworks/ 
> FFStatelessListDetail.framework/Resources/Java:/Library/Frameworks/ 
> POIJars.framework/Resources/Java:/Library/Frameworks/ 
> FrontBasePlugIn.framework/Resources/Java:/Library/Frameworks/ 
> XStreamJars.framework/Resources/Java:/Library/Frameworks/ 
> QuartzJars.framework/Resources/Java
>
> But when Xcode wants to compile the java files, it starts looking  
> in "WebServerResources/Java" for jars!?
>
> classpath="/Users/will/Documents/CVSProjects/coachrentWOFB/build/ 
> coachrent.build/Development/Web Server.build/JavaClasses:/System/ 
> Library/Frameworks/JavaFoundation.framework/WebServerResources/ 
> Java:/System/Library/Frameworks/JavaEOControl.framework/ 
> WebServerResources/Java:/System/Library/Frameworks/ 
> JavaEOAccess.framework/WebServerResources/Java:/System/Library/ 
> Frameworks/JavaWebObjects.framework/WebServerResources/Java:/System/ 
> Library/Frameworks/JavaWOExtensions.framework/WebServerResources/ 
> Java:/System/Library/Frameworks/JavaXML.framework/ 
> WebServerResources/Java:/Library/Frameworks/FFWOUtilities.framework/ 
> WebServerResources/Java:/Library/Frameworks/WOOgnl.framework/ 
> WebServerResources/Java:/Library/Frameworks/ 
> FFStatelessListDetail.framework/WebServerResources/Java:/Library/ 
> Frameworks/POIJars.framework/WebServerResources/Java:/Library/ 
> Frameworks/FrontBasePlugIn.framework/WebServerResources/Java:/ 
> Library/Frameworks/XStreamJars.framework/WebServerResources/Java:/ 
> Library/Frameworks/QuartzJars.framework/WebServerResources/Java 
> $frameworkjars:"`/usr/bin/javaconfig  DefaultClasspath`
>
> I copied the jar in my jar framework from Resources/Java to  
> WebServerResources/Java... and my project compiled fine! Well, this  
> explains why the project would not build so far... but it does not  
> explain
>
> a) why it worked with the first (old) jar framework since this  
> framework does not have it's jar in WebServerResources/Java
> b) why Xcode is looking in WebServerResources/Java in the first place
>
> Any ideas anyone?
>
> Regards,
> Will

I think that your problem is related to the things that Xcode does to  
make an older project style look like something in java. The Xcode  
project structure is set up for "NSBundle" application, as they were  
designed into OpenStep. Xcode does a bunch of funky things to make a  
java project look like an NSBundle. One thing it has to do, at times,  
is pretend there is an NSPrincipalClass in the bundle. There is old  
documentation on this. If you want to read it, it is not hard to  
find. It will probably not be very useful, though. Essentially, Xcode  
may need to pretend some little scrap of nothing in a java framework  
is the NSPrincipalClass so that it can recognize it as a framework.

Xcode projects have one or more targets. A WebObjects project is  
composed of an aggregate target (the top one in the last, named with  
the project name), and a "server side" target and a "client side"  
target. There is a current target popup in the top area of the  
project window. It is not difficult to accidentally set this to 'Web  
Server' or 'Application Server', in which case the project as a whole  
is not built, or it looks like it is built, but only because the  
other target is not re-built. This is a bad thing to have happen.  
Given that all the paths reference the WebServerResources directory,  
I would guess this is what happened.

If you want to see what actually gets used in an application, look at  
the stuff inside the woa directory. List the contents of any jars you  
see. Run the executable in there on the command-line and look at the  
last line, as the variables get expanded.

Things in the Resources directory get used by the server side, so  
your database stuff goes here, for example. The stuff inside  
WebServerResources gets used by the client side. So, javascript files  
that get put into pages can go here. Anything on the client side  
will, it is assumed, get deployed into a web server directory, so the  
server side puts in references to stuff on the client side with urls,  
in a <img src="">, for example.

Various strange and inexplicable things happen to make this work in a  
development system, pre-deployment.

And I could go on. At length. But life is short.

Was this more than you wanted to know? I could have said "there be  
dragons...."

- ray

>
> On 11.09.2007, at 08:23, Cornelius Jaeger wrote:
>
>> hi will
>>
>> i had to add an empty text file so that Xcode picked up the  
>> framework, i don't know why but that made it work.
>> actually, i think i added an KeyValueCodingProtectedAccessor.java  
>> but i think an empty text file will do the trick
>>
>> regards
>>
>> Cornelius
>>
>>
>> On 10.09.2007, at 20:33, Will Scheidegger wrote:
>>
>>> I've used the Framework solution before to use 3rd party jars  
>>> with my wo apps. But now that I want to do the same thing with a  
>>> new Jar, I fail no matter what approach I'm taking. I've tried  
>>> both these solutions:
>>>
>>> http://en.wikibooks.org/wiki/Programming:WebObjects/ 
>>> Web_Applications/Development/Third_Party_Jars
>>>
>>> Can anyone tell me if it's just me or if this really does not  
>>> work anymore? Thanks!
>>>
>>> -Will
>>> _______________________________________________
>>> WebObjects-dev mailing list
>>> [email protected]
>>> http://www.omnigroup.com/mailman/listinfo/webobjects-dev
>>
>
> _______________________________________________
> WebObjects-dev mailing list
> [email protected]
> http://www.omnigroup.com/mailman/listinfo/webobjects-dev
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.