Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Machine Learning for Business: Using Amazon SageMaker and JupyterE this week in the Jython/Python forum
or Object Design Style Guide in the Object-Oriented programming forum!
  • 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
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

Error with web.xml

 
Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I created a spring maven project in Netbeans 7. When I ececute Clean and Build, it generated the following errors:



Here is the pom.xml of the project:



WebContent/WEB-INF/web.xml file is:



What is wrong with my project configuration?

Thanks in advance for any suggestion and help.

Sam
 
Ranch Hand
Posts: 55
Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Maven by default looks for web.xml at location: src/main/webapp/WEB-INF/web.xml.
If your web.xml is at right place, you can try giving location explicitly in your pom.xml file as:
 
sam White
Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for the suggestion, I can progress further now, with further errors:



Here is my beans.xml file:



What is wrong with my project configuration?

Thanks
Sam
 
sam White
Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I uncomment the lines for the "<imports..." it shown a different error.

beans.xml file with "<import..." lines:




Errors:



Thanks
Sam
 
Ranch Hand
Posts: 206
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In web.xml you didn't specified the correct path and file cxf.xml on the contextConfigLocation as you defined in beans.xml import statement.
 
sam White
Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, thank you for your suggestion.
I don't have cxf.xml.
Where is this file and how to create one for my project?

Thanks
Sam
 
sam White
Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is my web.xml file:



But I don't know where and how to define a cxf.xml file.

Thanks
Sam
 
sam White
Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I really think that I have missing some cxf packages in my maven project.
What should I include in my pom.xml file in order to have the missing cxf.xml and etc in-placed?

Thanks
Sam
 
Tommy Delson
Ranch Hand
Posts: 206
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, you missed or not created a cxf or cxf-servlet.xml file for you app configuration. I assumed that you know how to configure the configuration file, if not refer to spring documentation or other sources how to created and configure one.

Based on the code you listed look like your beans.xml file is your cxf file, but you defined it twice with cxf name. No need to import anything you defined as showed below.


For single beans.xml file use this configuration:



-----------
For multiple (i.e beans.xml, beans2.xml, beans3.xml...) files use this, this is just like above example, but multiple files:




Remember place all these files in "WEB-INF" directory otherwise it won't find your file, place the file to correct location where you have defined.



 
I'm doing laundry! Look how clean this tiny ad is:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!