在本地注册的时候执行完insert语句后,就报了这个错:
XMPPError connecting to 127.0.0.1:5222.: remote-server-error(502) XMPPError connecting to 127.0.0.1:5222.
  -- caused by: java.net.ConnectException: Connection refused: connect
我不明白的是为啥本地注册,他说服务器连接受限?
这个工程我是网上下载的,数据库是本地的,如果是数据库问题,为啥能够修改注册用户的信息,但是就是不能新注册。其他的对数据库里面数据的删除,修改都能实现的,请教这是为啥?
现在我能修改,也能查询,就是不能注册,问问是不是我机器的系统的问题?还是这个端口被占用了?可能的原因猜了很多个,最后还是没有弄好
100分求解。。
在线等。。

解决方案 »

  1.   

    可以保证不是代码问题了,最让我诡异的是办公室里面3个电脑都能对www.800khr.com上的那个新用户注册,但是我的机器不能,报了系统异常。这样的情况有可能是系统问题还是ie问题?
    我吧ie都装成8了还是不能注册。。
      

  2.   

    你在程序里打印一下sql语句,再用这个sql语句直接在数据库执行一下,看看能不能插入.
      

  3.   

    如果用了hibernate 确保你的hbm.xml中的
     <set
            name=""
            lazy="true"
            inverse="true"
    cascade="all"    >
    cascade="all"为all
      

  4.   


    问题描述:
    便人机器能在服务器上注册,我的不能,把服务器上面的程序和数据库下载到本地,我的还不能,其他人的没有试。
    错误信息:
    XMPPError connecting to 127.0.0.1:5222.: remote-server-error(502) XMPPError connecting to 127.0.0.1:5222. 
      -- caused by: java.net.ConnectException: Connection refused: connect 
    就报了这个代码:注册的工厂类,jdbc实现的,action里面调用的。。struts配置文件指定路径的,太多了就不贴了。代码我认为没有错是因为在服务器上面就能注册的。
      

  5.   


    struts,spring。hibernite。。jdbc。。程序里面很乱的
      

  6.   

    你看看,有没有注册的用户那个bean的hbm.xml文件.
    把它贴出来看看.
      

  7.   

    一般是放在pojo里的,或者带有hibernate名的文件夹里.
      

  8.   


    我奇怪怎么又用了hibernate  又用了jdbc?
      

  9.   

    <?xml version="1.0" encoding="utf-8"?>
    <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
    <!-- 
        Mapping file autogenerated by MyEclipse Persistence Tools
    -->
    <hibernate-mapping package="com.imhrs.domainobjects.person">
        <class name="Person" table="people" catalog="imhrs">
            <id name="intUID" type="java.lang.Integer">
                <column name="uid" />
                <generator class="native" />
            </id>
            <property name="strID" type="java.lang.String">
                <column name="id" length="30" />
            </property>
            <property name="strPWD" type="java.lang.String">
                <column name="pwd" length="15" />
            </property>
            <property name="strEMail" type="java.lang.String">
                <column name="email" length="30" />
            </property>
            <property name="dateCreate" type="java.sql.Date">
                <column name="create_date" length="10" />
            </property>
            <property name="DateUpdate" type="java.sql.Date">
                <column name="update_date" length="10" />
            </property>
            <property name="strName" type="java.lang.String">
                <column name="name" length="20" />
            </property>
            <property name="strSex" type="java.lang.String">
                <column name="sex" length="1" />
            </property>
            <property name="dateBirthDay" type="java.sql.Date">
                <column name="birthday" length="10" />
            </property>
            <property name="strNation" type="java.lang.String">
                <column name="nation" length="12" />
            </property>
            <property name="strCardType" type="java.lang.String">
                <column name="card_type" length="12" />
            </property>
            <property name="strCardID" type="java.lang.String">
                <column name="card_id" length="18" />
            </property>
            <property name="strCity" type="java.lang.String">
                <column name="city" length="15" />
            </property>
            <property name="strPoliticsFace" type="java.lang.String">
                <column name="politics_face" length="6" />
            </property>
            <property name="strLearnExperience" type="java.lang.String">
                <column name="learn_experience" length="9" />
            </property>
            <property name="strWorked" type="java.lang.String">
                <column name="isworked" length="1" />
            </property>
            <property name="strComputerAbility" type="java.lang.String">
                <column name="computer_ability" length="6" />
            </property>
            <property name="strPhone" type="java.lang.String">
                <column name="phone" length="15" />
            </property>
            <property name="strAddress" type="java.lang.String">
                <column name="address" length="100" />
            </property>
            <property name="strPostCode" type="java.lang.String">
                <column name="postcode" length="6" />
            </property>
            <property name="strQQ" type="java.lang.String">
                <column name="qq" length="11" />
            </property>
            <property name="strMSN" type="java.lang.String">
                <column name="msn" length="30" />
            </property>
            <property name="strYahoo" type="java.lang.String">
                <column name="yahoo" length="30" />
            </property>
            <property name="intAge" type="java.lang.Integer">
                <column name="age" />
            </property>
            <property name="strPhoto" type="java.lang.String">
                <column name="photo" length="200" />
            </property>
            <property name="strProvince" type="java.lang.String">
                <column name="province" length="30" />
            </property>
            <property name="collGradDate" type="java.lang.String">
                <column name="grad_date" length="5" />
            </property>
            
        </class>
    </hibernate-mapping>太长了点。。
      

  10.   

    我也在奇怪,程序是便人写的,让我过来维护了
    要是直接用pojo的话好弄得多了
      

  11.   

    他就没有写hibernate。conf。xml的配置文件
    好想是写到spring里面了,我跑一个,看看是不是那个
      

  12.   

    文件名象这样的applicationContext.xml
      

  13.   

        <generator class="native" /> 这个是系统自带的吗?
      

  14.   

    里面的内容是这样的:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
    <beans>

    <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <property name="locations">
          <list>
            <value>WEB-INF/jdbc.properties</value>
          </list>
        </property>
      </bean>

    <bean id="baseTransactionProxy" 
    class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean" 
              abstract="true"> 
            <property name="transactionManager" ref="transactionManager"/> 
            <!--  <property name="proxyTargetClass" value="true"/> -->
            <property name="transactionAttributes"> 
                <props>
                 <prop key="insert*">PROPAGATION_REQUIRED</prop>
    <prop key="update*">PROPAGATION_REQUIRED</prop>
                    <prop key="get*">PROPAGATION_REQUIRED,readOnly</prop> 
                    <prop key="find*">PROPAGATION_REQUIRED,readOnly</prop> 
                    <prop key="load*">PROPAGATION_REQUIRED,readOnly</prop> 
                    <prop key="save*">PROPAGATION_REQUIRED</prop> 
                    <prop key="add*">PROPAGATION_REQUIRED</prop> 
                    <prop key="remove*">PROPAGATION_REQUIRED</prop>
                    <prop key="delete*">PROPAGATION_REQUIRED</prop>
                </props> 
            </property> 
        </bean>
        
    <bean id="imhrs" parent="baseTransactionProxy">
    <property name="target">
    <bean class="com.imhrs.domainobjects.logic.ImhrsImpl">
    <property name="industryDao" ref="industryDao" />
    <property name="areaDao" ref="areaDao" />
    <property name="companyDao" ref="companyDao"/>
    <property name="personDao" ref="personDao"/>
    <property name="chatDao" ref="chatDao" />
    <property name="systemDao" ref="systemDao" />
    <property name="personStatusDao" ref="personStatusDao" />
    <property name="adDao" ref="adDao" />

    <!-- <property name="flowDao" ref="flowDao" />
     -->
    </bean>
    </property>
    </bean>

    <bean id="remoteImpl" class="com.imhrs.remoting.impl.RemoteImpl"/>

    </beans>
      

  15.   

    <value>WEB-INF/jdbc.properties </value>.......
    怎么又去连接jdbc了?
      

  16.   


    那你到其他电脑上把原码考过去试试看看行不.
    我实在不知道系统怎么又连jdbc又有hbm.xml,
    不好意思  技术有限
      

  17.   

    这个问题我遇见过 有2种情况。1.是服务器链接不上看看用户名和密码正确吗?2.去找一下管理员 让他设置一下权限 可能 服务器上不允许你这个机器链接。
       
       要是本地机器 在mysql上设置一下链接权限。
      

  18.   


    用户名和密码是正确的,可以保证了。
    只有管理员哪块我不太明白,注册一下还要权限?
    mysql的链接权限在那块设置了,找了,没有找到。。
      

  19.   

    127.0.0.1:5222
    你的数据,这个端口,用 telnet 127.0.0.1 5222  返回什么?
    能确定,连接得上吗?
      

  20.   

    直接telnet 127.0.0.1.告诉我是23端口连接失败。。证明连接本地是有问题的。。其他人的机器也是这样的,所以我提的那个问题这样是布恩那个解决的。
      

  21.   

    看看你是不是开了防火墙之类的安全软件,你用查询分析器之类的可以直接操作数据库,说明你的IP没有被服务器屏蔽,你又不能在自己的机器上注册,说明可能你用来注册的客户端或浏览器被防火墙之类的东西视作危险软件而禁止其访问网络了,另外,你telnet自己的23端口都不通,弄不好是那防火墙直接封的端口,可能把23端口和5222端口都封了(说不定还有其他的,我记得某个防火墙软件有个简易选项,只开放常用的几个低端端口的,弄不好你用的就是那个……)
      

  22.   

    还是这个问题,为了测试这个端口问题,我专门写了个测试类,直接调用jdbc的话是可以插入的,但是在action里面调用就涉及到端口问题了。有人给我的解释是action是个监听器,当然涉及到端口了,但是由此引发我的疑问:action如果涉及到端口的话,那是不是insert一个端口,update一个端口,delete一个端口?
    求高人指点迷津。。
      

  23.   

    办公室里面3个电脑都能对www.800khr.com上的那个新用户注册,但是我的机器不能
    这个也把action监听的推论否决了重建数据库 或者重装数据库试试  
    也想不到其他办法了
      

  24.   

    既然可以查,该,和删除 用的是ssh,端口和Ip应该没问题
    那么查一下loginAction 中是否用了依赖注入,看看spring的配置文件中是否有该action
    的配置