• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Creating a managed bean from a referenced project

 
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm working in Eclipse on a JSF project. I have a POJO I want to reference from another project in my workspace. I've added this project to my build path in the Eclipse project properties. If I attempt to reference the class in the external project in the managed-bean-class element, it isn't found. I can create the POJO in the same project, change the namespace to the local project, and it works fine. I can only assume I'm missing a needed reference. Any help would be greatly appreciated.
 
Saloon Keeper
Posts: 28314
207
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Eclipse has absolutely zero to do with running a JSF webapp as far as cross-referencing projects are concerned. No matter what you define in Eclipse, it won't get referenced come runtime. The only things that your webapp container and the webapp itself can locate are items in the deployed application or in the webapp container's CLASSPATH chains.

On the other hand, if what you really mean is that you have created some sort of component that you want to deploy as part of a webapp, but the component is constructed outside of the project where you're building the webapp itself, you need to tailor the webapp build process so that the constructed component will be copied into the resulting deployable unit. In other words, if I made a Google Maps JSF tag component (which actually, I have) and made it a drop-in component in a JAR, I would copy that JAR into my webapp build. If the actual Google Maps component JAR is built in a different Eclipse project, about the only things Eclipse will do for me is allow me to get at the internal symbols for debugging purposes and ensure that any automated dependent build processes get done in the proper order (most of my deployables are built with Maven or Ant, so that's of limited use to me).
 
Chris Stewart
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Tim,

That makes sense. I'm currently running my application in Tomcat using the built-in server functionality with Eclipse. I suspect I'll need to somehow alter that "run" process to include a custom Ant script. Is that the correct path to take, or is there a better way?
 
Tim Holloway
Saloon Keeper
Posts: 28314
207
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's not a "run" thing, it's a "build" thing. Doesn't matter if you use Eclipse, Ant, or even DOS batch files.

The Tomcat that Eclipse is running is still Tomcat - just launched and managed by Eclipse - and it's still subject to the same constraints that every other J2EE container is. Which is that if you want an application to be able to see something, it has to be party of the application's deployment unit (WAR). No peeking outside.
 
Tim Holloway
Saloon Keeper
Posts: 28314
207
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's not a "run" thing, it's a "build" thing. Doesn't matter if you use Eclipse, Ant, or even DOS batch files.

The Tomcat that Eclipse is running is still Tomcat - just launched and managed by Eclipse - and it's still subject to the same constraints that every other J2EE container is. Which is that if you want an application to be able to see something, it has to be party of the application's deployment unit (WAR). No peeking outside.
 
This is my favorite tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic