Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Please help I need to solve this

Reply
Thread Tools

Please help I need to solve this

 
 
kris
Guest
Posts: n/a
 
      09-13-2007
Hi

I am using Weblogic8.1 SP3 , Hibernate 3 and spring 1.2.3 version.
While deploying the code , I am getting this exception. can any body
help that how to solve this problem.



org.springframework.beans.factory.BeanCreationExce ption: Error
creating bean with name 'sessionFactory' defined in ServletContext
resource [/WEB-INF/applicationContext.xml]: Initialization of bean
failed; nested exception is java.io.FileNotFoundException: class path
resource [WEB-INF/classes/com/elemica/api/component/account/
AccountBean.hbm.xml] cannot be opened because it does not exist
java.io.FileNotFoundException: class path resource [WEB-INF/classes/
com/elemica/api/component/account/AccountBean.hbm.xml] cannot be
opened because it does not exist
at
org.springframework.core.io.ClassPathResource.getI nputStream(ClassPathResource.java:
137)
at
org.springframework.orm.hibernate3.LocalSessionFac toryBean.afterPropertiesSet(LocalSessionFactoryBea n.java:
679)
at
org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.invokeInitMethods(Abstr actAutowireCapableBeanFactory.java:
1091)
at
org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:
396)
at
org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:
233)
at
org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:
145)
at
org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:
277)
at
org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:
313)
at
org.springframework.web.context.support.AbstractRe freshableWebApplicationContext.refresh(AbstractRef reshableWebApplicationContext.java:
139)

 
Reply With Quote
 
 
 
 
Manish Pandit
Guest
Posts: n/a
 
      09-13-2007
On Sep 12, 10:11 pm, kris <(E-Mail Removed)> wrote:
> Hi
>
> I am using Weblogic8.1 SP3 , Hibernate 3 and spring 1.2.3 version.
> While deploying the code , I am getting this exception. can any body
> help that how to solve this problem.
>
> org.springframework.beans.factory.BeanCreationExce ption: Error
> creating bean with name 'sessionFactory' defined in ServletContext
> resource [/WEB-INF/applicationContext.xml]: Initialization of bean
> failed; nested exception is java.io.FileNotFoundException: class path
> resource [WEB-INF/classes/com/elemica/api/component/account/
> AccountBean.hbm.xml] cannot be opened because it does not exist
> java.io.FileNotFoundException: class path resource [WEB-INF/classes/
> com/elemica/api/component/account/AccountBean.hbm.xml] cannot be
> opened because it does not exist


Can you verify if the file it is complaining about exists?

Location:

your_app_root/WEB-INF/classes/com/elemica/api/component/account/
AccountBean.hbm.xml


-cheers,
Manish

 
Reply With Quote
 
 
 
 
Andrew Thompson
Guest
Posts: n/a
 
      09-13-2007
kris wrote:

Sub: Please help I need to solve this

Please don't be so pathetic. Other notes..
- Is that a question? If so, adding a '?' at the end
sure helps mark it as such.*
- A subject of 'BeanCreationException in WebLogic' would
be a lot better at attracting the attention of those who have
most experience with this type of error. (And also help avoid
acerbic comments as lead this reply).

>I am using Weblogic8.1 SP3 , Hibernate 3 and spring 1.2.3 version.
>While deploying the code , I am getting this exception. can any body
>help that how to solve this problem.


* 'Ditto' - please add question marks to questions.

>org.springframework.beans.factory.BeanCreationExc eption: Error


OK - this it the immediate or end problem, but
further down..

>creating bean with name 'sessionFactory' defined in ServletContext
>resource [/WEB-INF/applicationContext.xml]: Initialization of bean
>failed; nested exception is java.io.FileNotFoundException: class path
>resource [WEB-INF/classes/com/elemica/api/component/account/
>AccountBean.hbm.xml] cannot be opened because it does not exist


..this seems to be the real or *underlying* problem.

Some comments based on that..
- Have you checked that path in the WEB-INF directory,
to check that file actually *does* exist?
- It seems odd to me that the Exception mentions the
'classes' directory specifically. Any attempt to gain
resources for a web app. (or app., or applet) should use
Class.getResource("name") or similar to locate the
resource in either the classes directory, *or* as part
of an (.jar) archive in the ..'lib'(?) directory. If this code
used the Class.gR() mehtod to locate the resource,
it should have returned a null URL if the resource
was not located, long before throwing an FNFE.
The Exception instead suggests that some coder
has perhaps *hard* *coded* that filename into the app.
Slap them for me, there's a pet.

--
Andrew Thompson
http://www.athompson.info/andrew/

Message posted via http://www.javakb.com

 
Reply With Quote
 
kris
Guest
Posts: n/a
 
      09-13-2007

Sorry,Ignore my english as my mother tounge is not English . Dont
mine.

I verified that the file exists in the folder that specified inside
the applicationContext.xml.

And its inside the classes folder with the class files.


 
Reply With Quote
 
Andrew Thompson
Guest
Posts: n/a
 
      09-13-2007
kris wrote:
>Sorry,Ignore my english as my mother tounge is not English .


Your English is every bit good enough to hold a
technical discussion. After all, the fundamental
language we all speak is 'Java'.

(You stop apologising for your English*, and I'll
refrain from apologising that English is the only
language I understand. Deal?)

>..Dont
>mine.


I am completely unstressed (relaxed).

>I verified that the file exists in the folder that specified inside
>the applicationContext.xml.


OK. Thanks for confirming that.

>And its inside the classes folder with the class files.


Fine. But what about the other part of what I asked you?

Why does the code ask for that file, by that exact
*path*?

That part does not make sense to me, though perhaps
the server-side gurus can indentify a fault in my logic.
That does seem a problem to me.

* As an aside, the problem with being someone who speaks
English as a 'native language' is that we too often make it
too difficult for others to understand (mostly by accident).
If there are any words I say that are unclear to you, please
let me know, so that I might be able to explain, and gain
more talent with communicating to people who use English
as a second (3rd, or more..) language.

Thanks in advance..

--
Andrew Thompson
http://www.athompson.info/andrew/

Message posted via http://www.javakb.com

 
Reply With Quote
 
Andrew Thompson
Guest
Posts: n/a
 
      09-13-2007
Andrew Thompson wrote:
...
>Fine. But what about the other part of what I asked you?


Sh*t! Sorry, but it was not an actual question,
just a comment at the bottom of my earlier post.

"- It seems odd to me that the Exception mentions the
'classes' directory specifically. Any attempt to gain
resources for a web app. (or app., or applet) should use
Class.getResource("name") or similar to locate the
resource in either the classes directory, *or* as part
of an (.jar) archive in the ..'lib'(?) directory. If this code
used the Class.gR() mehtod to locate the resource,
it should have returned a null URL if the resource
was not located, long before throwing an FNFE.
The Exception instead suggests that some coder
has perhaps *hard* *coded* that filename into the app.
Slap them for me, there's a pet."

I suspect this comment is central to the problem.

--
Andrew Thompson
http://www.athompson.info/andrew/

Message posted via JavaKB.com
http://www.javakb.com/Uwe/Forums.asp...neral/200709/1

 
Reply With Quote
 
kris
Guest
Posts: n/a
 
      09-13-2007
Actually we are using that one in the webapp only the directory
structure follows


APPROOT
Pages
Images
WEB-INF
Classes
com.something....(In this folders I have the .hbm.xml's)
lib
applicationContext.xml ( this itself will load other parallel
context xml's)

The thing is the spring bean factory is not able to find the location
of the hbm.xml file.
And actually I am indirectly asking wether the path given is the
correct one or something to change.
Its a old code developed by somebody who is not in access.


Thanks
Kris

 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      09-13-2007
On Wed, 12 Sep 2007 22:11:45 -0700, kris <(E-Mail Removed)>
wrote, quoted or indirectly quoted someone who said :

> [WEB-INF/classes/com/elemica/api/component/account/
>AccountBean.hbm.xml] cannot be opened because it does not exist
>java.io.FileNotFoundException: class path resource [WEB-INF/classes/
>com/elemica/api/component/account/AccountBean.hbm.xml] cannot be
>opened because it does not exist

Does there exist a file
WEB-INF/classes/com/elemica/api/component/account/AccountBean.hbm.xml

Is there a typo in there anywhere "elemica", caps off, .hbm ?

If not, it is in a jar on the Classpath or in the ext directory?

Is this some sort of persisted file that you are erroneously insisting
must exist even the first time out?
--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      09-13-2007
On Thu, 13 Sep 2007 05:46:57 GMT, "Andrew Thompson" <u32984@uwe>
wrote, quoted or indirectly quoted someone who said :

>Please don't be so pathetic.


for once could you make a request with belittling the questioner.
--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
 
Reply With Quote
 
Manish Pandit
Guest
Posts: n/a
 
      09-13-2007
On Sep 13, 3:02 am, kris <(E-Mail Removed)> wrote:
> WEB-INF
> Classes
> com.something....(In this folders I have the .hbm.xml's)


It is supposed to be classes (lower-case 'C'). If this is just a typo
in the message, it is fine but if your app has WEB-INF/Classes instead
of WEB-INF/classes, that could be a problem. Another way to test it
out (if you know the file is there in its entirity, with the exact
path as mentioned in the error) is to jar up the com-tree (everything
under WEB-INF/classes) and add that jar to WEB-INF/lib, and removing
the classes folder.

-cheers,
Manish

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Please help me to solve this settyv@gmail.com ASP .Net 0 11-15-2006 03:38 PM
Can somebody please help me solve DVD Decrytper mystery? LZernov DVD Video 1 01-31-2005 07:25 PM
Disappearing OE 5.5 archicve files -- Please help solve puzzle!!!! Jim McLaughlin Computer Support 29 02-11-2004 09:00 PM
please help... ...me learn C++ please please please :) KK C++ 2 10-14-2003 02:08 PM
please help solve these linked list and sscanf problems Andrej Hocevar C Programming 1 08-18-2003 08:02 PM



Advertisments