Expand my Community achievements bar.

War file created in Eclipse works, but fails when created by Ant

Avatar

Former Community Member
Hi,

I am having trouble getting my flex war file to work when I create it using Ant, even though the same war works fine when I create it from my Eclipse Export War function. This is a critical problem and any ideas or suggestions would be greatly appreciated.



I have a working installation of LCDS running under JBoss 4.0.5 (in a CENTOS (Red Hat) environment). I have implemented a datatier in Java to interact with my PostgreSQL 8.x database. The Java code, plus the necessary flex jars and xml files and some mxml test programs, are all in an Eclipse J2EE project that I created from the flex samples.war file. It all works fine when I use Eclipse to create a WAR from the project and deploy it in JBoss. My problem is this: When I create a WAR piece by piece using Ant, then deploy it to JBoss, that WAR does not work. The error I get is this:

javax.servlet.ServletException: Invalid Configuration: see previous failures. flex.webtier.util.ServiceUtil.setupFlexService(ServiceUtil.java:55) flex.webtier.server.j2ee.MxmlServlet.init(MxmlServlet.java:57), etc.



When I look at the log I see this problem:

"You have more than one version of 'org.apache.commons.logging.Log' visible, which is not allowed.",

but that error is in the server log even when I use the good WAR file.



I have compared the two wars but cannot find any substantial difference between them.

Thanks in advance!
4 Replies

Avatar

Former Community Member
Me again, with another clue. I found an important difference between running the 'good' war and the 'bad' war. When I run the good war and launch the LCDS management console (by running 'flex-admin'), I see all of the test apps plus my own under the Remoting Service in the tree. When I run the bad war all I see under 'LiveCycle Data Services Samples' is 'MessageBroker1', and its 'isRunning' function returns false.



Thanks,

Jerry

Avatar

Level 4
Have you tried enabling debug level logging and removing the category filters in services-config.xml? It should show all the destinations being created, and if any are failing. To get the maximum level of log detail, something like this should work:



><logging>

>

> <target class="flex.messaging.log.ConsoleTarget" level="Debug">

>

> <properties>

>

> <prefix>[Flex] </prefix>

>

> <includeDate>false</includeDate>

>

> <includeTime>false</includeTime>

>

> <includeLevel>false</includeLevel>

>

> <includeCategory>false</includeCategory>

>

> </properties>

>

> </target>

>

> </logging>



Have a check that your remoting destinations are shown starting correctly for both WAR files, and see if there are any messages in the log that might be relevant.

Avatar

Former Community Member
Thanks. That's a good suggestion. I'll try it and let you know what I find.

Avatar

Former Community Member
Robert,



That was a huge help. With Debug turned on I found an error saying that flex/lcds could not open the WEB-INF/flex/user-classes directory. It turned out to be an error in my Ant script. I was not including that directory because my include rule for the copy was '**/*.*/, but I needed another one that was '**/*' because that silly file called 'add_your_as_and_swc_files_here' has no extension. Of course I will eventually remove the reference to user-classes from flex-config.xml when I understand things well enough to leave the whole samples thing behind.



The ant-created war now creates the flex webpage correctly, which is real progress. I still have problems with retrieving data from the server with the ant-created war. The eclipse war retrieves data from the lcds server just fine, but the ant-created war gets "Channel.Connect.Failed error NetConnection.Call.Failed" when I do a call to my data service. For now, to bed.



Thanks,

Jerry