Raghda Ismail

Greenhorn
+ Follow
since Feb 22, 2009
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Raghda Ismail

Hi All,

I am still having this problem.
Any clues??

Thanks
Hi All,

I am new to both glassfish and log4j.
I used to use eclipse ,tomcat and log4j together and every thing was fine
the logs appeared in eclipse console
I did that by following instructions in this file



but the problem now that i want to use glassfish
I use eclipse with glassfish and no problems ,i see the logs in glassfish server log file
but when i use log4j i can not see the logs in eclipse console or in server log file

Please help
Thanks
Hi John ,

Thanks for your reply
I am sorry for being late.

First i forgot to mention that i am using eclipse IDE.
i was using org.hibernate.cfg.Configuration in my code which caused this problem.

But i have another problem now.

i started getting error : hibernate.cfg.xml not found

hibernate.cfg.xml is in scr folder and my mapping files are in src\comm folder just beside the persistence classes.

i tried this to work around :



but i am getting this error


any help is appreciated
i have been stuck in this problem for many days


Hi every body ,

I am trying to configure hibernate with glassfish.
i am new to both gassfish and hibernate.
I am using hibernate 3.3.2 , i want to configure transaction factory to use JTATransaction factory

hibernate.cfg.xml




i am getting this error in my log file

java.lang.ClassCastException: net.sf.hibernate.transaction.JTATransactionFactory cannot be cast to org.hibernate.transaction.TransactionFactory
at org.hibernate.transaction.TransactionFactoryFactory.buildTransactionFactory(TransactionFactoryFactory.java:65)
at org.hibernate.cfg.SettingsFactory.createTransactionFactory(SettingsFactory.java:452)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:165)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2101)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1325)
at comm.testHibernateServlet.doGet(testHibernateServlet.java:21)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:734)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:427)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:315)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:287)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:218)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:98)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:222)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1096)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:166)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1096)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:288)
at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:647)
at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:579)
at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:831)
at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)
at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)
at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)
at com.sun.enterprise.web.portunif.PortUnificationPipeline$PUTask.doTask(PortUnificationPipeline.java:380)
at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)


any idea what is wrong??

Thanks in advance

Hi every body ,

I am still having this problem.
could any body just have a look on the mapping and tell me if there is something wrong with it?

Thanks
hi David ,

Thanks for your reply.
You did not misunderstand ,what you said is exactly what i mean:
" I translate that to mean that a department can have only one head, not that a user can't have multiple departments"

and my problem with using one to one mapping is that i am not able to fetch users eagerly with the departments
I tried using this mapping :

<one-to-one
name="head"
class="helper.User"
foreign-key="department_head" //this is the name of the foreign key column in departments table
fetch="join"
/>

is there any thing wrong with this mapping??

Thanks in advance
Hi All,

I have User and Department classes ,the relation from Department to User is one to one unidirectional(Department has head ,and User can be head of only
one Department).
I did some search and found that to do this mapping i must do the following

<many-to-one
name="head"
class="helper.User"
column="department_head"
unique="true"
/>

and that unique="true" will force the relation to be one to one.

is that true??

I tried that but it works as many Departments to the same user, i add new department to user who is already a head and it works fine.

if this mapping is wrong ,could any one please tell me how to do it?

Thanks

Thanks dharmendra for your help
14 years ago
Hi every body,

I was reading code conventions from java.sun and i read these two lines and i really cannot understand them

Numerical constants (literals) should not be coded directly, except for -1, 0, and 1, which can
appear in a for loop as counter values.


i need to follow java standards in my current application and its important to me to understand it.

any help is appreciated.

Thanks in advance

Raghda
14 years ago
hi everybody ,
please i need to know what does it mean that hash table is synchronized and hash maps are not?

Thanks
Thanks Balu ,
i moved log4j.properties in classes folder and it works fine now
Thanks David and Balu ,your answer solved my problem but now i am getting this warning

log4j:WARN No appenders could be found for logger (org.log).
log4j:WARN Please initialize the log4j system properly.

and i cannot see my logs
i have log4j.properties in log4j folder inside my application folder(beside src folder)

Thanks David,
But i am new to log4j and i don not know what do you mean by deploying log4j to the server
I am using tomcat, if you could give me more directions that would be great.

Thanks in advance
Hi everybody,

i am not sure if this is the right place to ask a question about log4j ,please redirect me to thr right place if i am wrong.
i followed this link to integrate log4j with eclipse

http://snippets.dzone.com/posts/show/3248

but when i run the servlet that use the Logger ,i get this exception

SEVERE: Allocate exception for servlet testRate
java.lang.ClassNotFoundException: org.apache.log4j.Logger
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1386)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1232)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at helper.TestRateServlet.<clinit>(TestRateServlet.java:22)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1089)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:791)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:127)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:875)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
at java.lang.Thread.run(Unknown Source)



any ideas??

Thanks