第二章的问题!

04-07-17 yq76034150

为什么我用JBX打开,为什么不能运行!

错误:
"HibernateUtil.java": cannot resolve symbol: class Session in package hibernate at line 8, column 25
"HibernateUtil.java": cannot resolve symbol: class SessionFactory in package hibernate at line 9, column 25
"HibernateUtil.java": package net.sf.hibernate.cfg does not exist at line 10, column 29
"HibernateUtil.java": cannot resolve symbol: class SessionFactory in class com.jdon.simpleregister.HibernateUtil at line 25, column 11
"HibernateUtil.java": cannot resolve symbol: class Session in class com.jdon.simpleregister.HibernateUtil at line 43, column 17
"HibernateUtil.java": cannot resolve symbol: class Session in class com.jdon.simpleregister.HibernateUtil at line 48, column 35
"HibernateUtil.java": cannot resolve symbol: class Session in class com.jdon.simpleregister.HibernateUtil at line 68, column 11
"HibernateUtil.java": incompatible types;found : net.sf.hibernate.HibernateException,required: java.lang.Throwable at line 43, column 46
"HibernateUtil.java": cannot resolve symbol: class Configuration in class com.jdon.simpleregister.HibernateUtil at line 62, column 29
"HibernateUtil.java": incompatible types;found : net.sf.hibernate.HibernateException,required: java.lang.Throwable at line 68, column 41
"Profile.java": cannot resolve symbol: class Session in package hibernate at line 5, column 25
"Profile.java": cannot resolve symbol: class Transaction in package hibernate at line 6, column 25
"Profile.java": cannot resolve symbol: class Session in class com.jdon.simpleregister.Profile at line 283, column 5
"Profile.java": cannot resolve symbol: class Transaction in class com.jdon.simpleregister.Profile at line 284, column 5
"SendMail.java": package javax.activation does not exist at line 7, column 1
"SendMail.java": package javax.activation does not exist at line 8, column 25
D:/JBOSS/client/jbossmqha.jar (The system cannot find the file specified)
可是我已经将在属性里的Required Libraries里加入里所需要的

yq76034150
2004-07-17 10:40
上面的问题解决了!!现在的问题:

HttpConnector[8083] Starting background thread
TyrexDataSourceFactory: Cannot create DataSource, Exception
java.lang.NoClassDefFoundError: tyrex/jdbc/xa/EnabledDataSource
at org.apache.naming.factory.TyrexDataSourceFactory.getObjectInstance(TyrexDataSourceFactory.java:166)
at org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:164)
at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:301)
at org.apache.naming.NamingContext.lookup(NamingContext.java:834)
at org.apache.naming.NamingContext.lookup(NamingContext.java:181)
at org.apache.naming.NamingContext.lookup(NamingContext.java:822)
at org.apache.naming.NamingContext.lookup(NamingContext.java:181)
at org.apache.naming.NamingContext.lookup(NamingContext.java:822)
at org.apache.naming.NamingContext.lookup(NamingContext.java:181)
at org.apache.naming.NamingContext.lookup(NamingContext.java:822)
at org.apache.naming.NamingContext.lookup(NamingContext.java:194)
at org.apache.naming.SelectorContext.lookup(SelectorContext.java:183)
at javax.naming.InitialContext.lookup(InitialContext.java:347)
at com.jdon.simpleregister.Mysql.getDataSource(Mysql.java:49)
at com.jdon.simpleregister.Mysql.<init>(Mysql.java:74)
at com.jdon.simpleregister.SignIn.SignIn(SignIn.java:71)
at org.apache.jsp.signup$jsp._jspService(signup$jsp.java:206)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:201)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1027)
at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125)getDataSource() error: javax.naming.NamingException: Exception creating DataSource: tyrex/jdbc/xa/EnabledDataSource
Mysql init error: java.lang.NullPointerException
java.lang.NullPointerException
Mysql close error: java.lang.NullPointerException
at java.lang.Thread.run(Thread.java:534)
TyrexDataSourceFactory: Cannot create DataSource, Exception
java.lang.NoClassDefFoundError: tyrex/jdbc/xa/EnabledDataSource
at org.apache.naming.factory.TyrexDataSourceFactory.getObjectInstance(TyrexDataSourceFactory.java:166)
at org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:164)
at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:301)
at org.apache.naming.NamingContext.lookup(NamingContext.java:834)
at org.apache.naming.NamingContext.lookup(NamingContext.java:181)
at org.apache.naming.NamingContext.lookup(NamingContext.java:822)
at org.apache.naming.NamingContext.lookup(NamingContext.java:181)
at org.apache.naming.NamingContext.lookup(NamingContext.java:822)
at org.apache.naming.NamingContext.lookup(NamingContext.java:181)
at org.apache.naming.NamingContext.lookup(NamingContext.java:822)
at org.apache.naming.NamingContext.lookup(NamingContext.java:194)
at org.apache.naming.SelectorContext.lookup(SelectorContext.java:183)
at javax.naming.InitialContext.lookup(InitialContext.java:347)
at com.jdon.simpleregister.Mysql.getDataSource(Mysql.java:49)
at com.jdon.simpleregister.Mysql.<init>(Mysql.java:74)
at com.jdon.simpleregister.Profile.EmailExist(Profile.java:360)
at org.apache.jsp.signup$jsp._jspService(signup$jsp.java:148)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:201)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1027)
at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125)getDataSource() error: javax.naming.NamingException: Exception creating DataSource: tyrex/jdbc/xa/EnabledDataSource
Mysql init error: java.lang.NullPointerException
Mysql close error: java.lang.NullPointerException
at java.lang.Thread.run(Thread.java:534)

banq
2004-07-18 09:51
关键在这里:
javax.naming.NamingException: Exception creating DataSource: tyrex/jdbc/xa/EnabledDataSource
Mysql init error: java.lang.NullPointerException
java.lang.NullPointerException
Mysql close error: java.lang.NullPointerException


你定义JNDI :tyrex/jdbc/xa/EnabledDataSource 系统没有发现。

ahuatian
2006-04-13 11:20
请问你是怎么解决的,我也遇到了同样的问题

banq
2006-04-14 18:15
配置容器的数据源JNDI, Tomcat/JBoss等网上都有介绍,配好后,将JNDI完整名称写在jdonframework.xml中即可。