• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Struts and Ant

 
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a simple struts project it compiles good and also i can test that one perfeclty when i compile it Straight away using javac..and pkg it
But when i try building it using ant build.xml file....then when i try testing that appliaction
it throws this error
Exception creating bean of the calss org.antproj.forms.SearchForm

any clue?
 
Saloon Keeper
Posts: 22482
151
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since you're probably using Ant to build a WAR file for deployment to your webapp server, it's most likely that the WAR task didn't include that class in the WAR.

To see what's in a WAR, use the JAR command, since a WAR is just a special form of JAR, just as JAR is a special form of ZIP:

jar -tvf myfile.war

See if anything else is missing - it may give a clue. If not, run ant with the "-v" flag and you'll get very detailed messages about the build process.
 
sudharshan tettu
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi thanks for your reply.... i could see all the java files everything in position..in war file.. <br>
my heirarchy is like this <br>
antproj / WEB-INF /build/com/antproj/actions/SearchAction.java <br> <p> build/com/antproj/forms/SearchForm.java <br>
<p>
when i compile the java files and drop the classes into the resp folders and package it ,it worked fine but when i use the ant to build it directly it throws <br>Excetpion could not create bean of class com.antproj.forms.SearchForm.....<br> and all the package naming are also fine... has the build.xml got anything to do with that ???
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds like your Ant target doesn't copy all the classes it should to your deployed application.


/ WEB-INF /build/com/antproj/actions/SearchAction.java


Shouldn't that be / WEB-INF /build/com/antproj/actions/SearchAction.class for your application to work?
 
sudharshan tettu
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Paul
sorry for the previous post....
my ant build is not copying any of the class files to .war.....
wat could be the problem???any clue?
this is wat I am using for pakaging the war.


<br>
<target name="war">
<war warfile="${war.file.name}" webxml="./WEB-INF/web.xml">
<fileset dir="./" includes="**/*.*" excludes="*.war, **/*.nbattrs, web.xml, **/WEB-INF/**/*.*, **/project-files/**/*.*"/>
<webinf dir="./WEB-INF" includes="**/*" excludes="web.xml, **/*.jar, **/*.class"/>
<lib dir="./WEB-INF/lib"/>
<classes dir="${build.dir}" includes="**/*.properties" />
</war>
</target>
</br>
 
Paul Sturrock
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Looks like you are asking that only .properties files be included in the WEB-INF/classes folder.
 
sudharshan tettu
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
cool i got it ,thanks for the help
 
Once upon a time there were three bears. And they were visted by a golden haired tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic