How to tell IJ to use XML files in the Classes Output directory
My hibernate xml files are in the same dir as output classes:
AppRoot/WEB-INF/classes/hibernate.cfg.xml
AppRoot/WEB-INF/classes/myapp.hbm.xml
I'm not sure how to tell IJ to
a) read/use those xml files in runtime (getting resource not found errors)
b) include those files in the IDE so I can edit them.
The screenshot shows that the WEB-INF/lib shows up but not WEB-INF/classes. My key hibernate files are in there, and they are being ignored by both the IDE editor and by the debugger/runtime.
Help appreciated.
-
btw, this structure works fine when I run tests from the command line
Edited by: Stephen Boesch on Aug 3, 2008 10:55 AM
Edited by: Stephen Boesch on Aug 3, 2008 10:58 AM
Edited by: Stephen Boesch on Aug 3, 2008 10:07 PM
Attachment(s):
whereAreMyClasses.JPG
Please sign in to leave a comment.
Hello Stephen,
The compilation output directory is by default excluded from abalysis by
IntelliJ IDEA. Don't store your source (or configuration) files there.
--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"
Hi Dimitry
As part of my (long!) troubleshooting, I had at one point changed the output classes dir to another directory. The AppRoot/WEB-INF/classes never showed up. In fact I just did it again (changed to /tmp/classes): but the AppRoot/WEB-INF/classes still does not show up in the project explorer, or allow me to find the xml files in it.
There may be a bug that IJ is holding on to the old output classes dir, so I can never see the files in it,
Note: it is not acceptable to be forced to move the configuration files out of the WEB-INF/classes dir.
Changing the output classes dir is acceptable, but I have already done that and still the xml configuration files are not found, even after shutting down / restarting IJ.
Please test this yourself and advise a workaround. Thanks.
Edited by: Stephen Boesch on Aug 4, 2008 7:37 AM
Edited by: Stephen Boesch on Aug 4, 2008 7:56 AM
Hello Stephen,
Is the WEB-INF/classes directory located under any module's content root?
By default WEB-INF/classes is created in exploded directory, out of content
roots. If it does not belong to any module, it cannot be shown anywhere.
Alexander.
Hi Alexander,
The directory AppRoot is included as the web context. The original post mentioned that other directories under AppRoot and even AppRoot/WEB-INF show up in the project explorer and are picked up at runtime. Specifically AppRoot/WEB-INF/lib/* , AppRoot/WEB-INF/tags/, AppRoot/jsp/ AppRoot/* , AppRoot/images/*, etc
It's just the WEB-INF/classes dir that refuses to be picked up . And it's not even the output dir anymore (although I do wish it could be).
Hello Stephen,
Does your directory structure look like one on the screenshot (attached)?
Alexander.
Attachment(s):
WebOutputInSource.JPG
yes, that's what the screenshot is for.
Hello Stephen,
Ah, sorry. Your screenshot was not loaded from forum into the news, what
I am reading.
I will try to reproduce the problem.
Alexander.
Hello Stephen,
I have re-created the similar project structure and can access WEB-INF/classes
with all content.
If you attached your .iml file (sources are not necessary) it could help.
Alexander.
attached the .iws and .iml files
Attachment(s):
myproject.iws
myproject.iml
Hello Stephen,
Thank you. Again, I have re-created the module structure accordingly to the
.iml settings. For me WEB-INF/classes is shown and hibernate configs may
be found by search and "go to file", for example. Both 7757 (7.0.3) and the
latest 7938. I'm giving up. You could try to clean caches and restart.
Alexander.