Exception in thread "Thread-0" java.lang.ExceptionInInitializerError
at com.sand.service.ReaderProcesserTest.run(ReaderProcesserTest.java:48)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'productService' defined in class path resource [ApplicationContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.sand.service.ProductService]: Constructor threw exception; nested exception is java.lang.NullPointerException
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:881)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:837)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:220)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:729)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:381)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)
at com.sand.util.ContextHelper.<clinit>(ContextHelper.java:10)
... 1 more
Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.sand.service.ProductService]: Constructor threw exception; nested exception is java.lang.NullPointerException
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:111)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:61)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:875)
... 17 more
Caused by: java.lang.NullPointerException
at com.sand.service.ProductService.<init>(ProductService.java:47)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:96)
... 19 more
配置文件如下:
    <bean id="branddaomys" class="com.sand.dao.impl.BrandDaoForMysqlImpl">

    </bean>
    <bean id="giftdaomys" class="com.sand.dao.impl.GiftDaoForMysqlImpl">    </bean>
    <bean id="goodscatdaomys" class="com.sand.dao.impl.GoodsCatDaoForMysqlImpl">    </bean>
    <bean id="goodsdaomys" class="com.sand.dao.impl.GoodsDaoForMysqlImpl">    </bean>
    <bean id="orderdaomys" class="com.sand.dao.impl.OrderDaoForMysqlImpl">    </bean>
    <bean id="orderpaydaomys" class="com.sand.dao.impl.OrderPayDaoForMysqlImpl">    </bean>
    <bean id="orderproductdaomys" class="com.sand.dao.impl.OrderProductDaoForMysqlImpl">    </bean>
    <bean id="productsdaomys" class="com.sand.dao.impl.ProductsDaoForMysqlImpl">    </bean>
    <bean id="myThrowsAdvice"
        class="com.sand.util.MyThrowsAdvice">
    </bean>
    <bean id="orderService"
        class="com.sand.service.OrderService">
    </bean>  
<bean id="productService"
        class="com.sand.service.ProductService">
    </bean>    <bean id="aopsevice"
        class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">        <property name="interceptorNames">
            <list>
                <value>myThrowsAdvice</value>
            </list>
        </property>
        <property name="beanNames">
            <list>
                <value>*Service</value>
            </list>
        </property>
    </bean>
public ProductService(){
// DataFactory mysqlfac = new MysqlFactory();
// DataFactory sqlserverfac = new SqlServerFactory();
// productdaoSqls = sqlserverfac.createProductDao();
// productsdaomys = mysqlfac.createProductsDao();
// branddaomys = mysqlfac.createBrandDao();
// goodscatdaomys = mysqlfac.createGoodsCatDao();
// goodsdaomys = mysqlfac.createGoodsDao();
// goodscatdaoSqls = sqlserverfac.createGoodsCatDao();
// giftdaomys = mysqlfac.createGiftDao();
// giftdaoSqls = sqlserverfac.createGiftDao();
        ApplicationContext context = ContextHelper.getContext();
        productdaoSqls = (ProductDao) context.getBean("productdaoSqls");
        productsdaomys = (ProductsDao) context.getBean("productsdaomys");
        branddaomys = (BrandDao) context.getBean("branddaomys");
        goodscatdaomys = (GoodsCatDao) context.getBean("goodscatdaomys");
        goodsdaomys = (GoodsDao) context.getBean("goodsdaomys");
        goodscatdaoSqls = (GoodsCatDao) context.getBean("goodscatdaoSqls");
        giftdaomys = (GiftDao) context.getBean("giftdaomys");
        giftdaoSqls = (GiftDao) context.getBean("giftdaoSqls");
        
}

解决方案 »

  1.   

    ProductService 47行init方法 空指针
      

  2.   

    既然用spring注入,为什么还要在类中context.getBean()
      

  3.   

    不该context.getBean()获得实例吗
    哪位大哥给个解决方案啊,我知道初始化错了
    但是不知道怎么改啊
      

  4.   

    要使用context.getBean(),前提是spring配置加载成功,显然你这因为Error creating bean with name 'productService' 这个错误,spring没有加载成功.
    合理的办法是在ProductService类里面,不用context.getBean()获取实例,而是定义成ProductService类的私有成员,然后在spring当中配置注入
    <bean id="productService"
            class="com.sand.service.ProductService">
    <property name="productDao" ref="productdaoSqls"></property>
        </bean>
      

  5.   

       <bean id="branddaomys" class="com.sand.dao.impl.BrandDaoForMysqlImpl">

        </bean>
        <bean id="giftdaomys" class="com.sand.dao.impl.GiftDaoForMysqlImpl">    </bean>
        <bean id="goodscatdaomys" class="com.sand.dao.impl.GoodsCatDaoForMysqlImpl">    </bean>
        <bean id="goodsdaomys" class="com.sand.dao.impl.GoodsDaoForMysqlImpl">    </bean>
        <bean id="orderdaomys" class="com.sand.dao.impl.OrderDaoForMysqlImpl">    </bean>
        <bean id="orderpaydaomys" class="com.sand.dao.impl.OrderPayDaoForMysqlImpl">    </bean>
        <bean id="orderproductdaomys" class="com.sand.dao.impl.OrderProductDaoForMysqlImpl">    </bean>
        <bean id="productsdaomys" class="com.sand.dao.impl.ProductsDaoForMysqlImpl">    </bean>    
        
        
        <bean id="productdaoSqls" class="com.sand.dao.impl.ProductDaoForSqlServerImpl">    </bean>
        <bean id="giftdaoSqls" class="com.sand.dao.impl.GiftDaoForSqlServerImpl">    </bean>
        <bean id="goodscatdaoSqls" class="com.sand.dao.impl.GoodsCatDaoForSqlServerImpl">    </bean>
        <bean id="orderdaoSqls" class="com.sand.dao.impl.OrderDaoForSqlServerImpl">    </bean>
        <bean id="orderpaydaoSqls" class="com.sand.dao.impl.OrderPayDaoForSqlServerImpl">    </bean>
        <bean id="orderproductdaoSqls" class="com.sand.dao.impl.OrderProductDaoForSqlServerImpl">    </bean>
       
       <!--  事物的配置       -->    
       <bean id="transactionManagerSqlserver" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
        <property name="dataSource" ref="dataSourceSqlserver"/>
       </bean>
        
    <!-- 自动代理事物    -->
    <bean id="transactionInterceptorSqlserver"
        class="org.springframework.transaction.interceptor.TransactionInterceptor"> 
        <property name="transactionManager">
         <ref bean="transactionManagerSqlserver" />
        </property> 
        <property name="transactionAttributes">
          <props>
            <prop key="*">PROPAGATION_REQUIRED</prop>    
          </props>
        </property>
    </bean>
    <bean id="autoproxySqlserver" class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">
        <property name="beanNames">
         <list>
          <value>*daoSqls</value>
         </list>
        </property>
        <property name="interceptorNames">
         <list>
             <value>transactionInterceptorSqlserver</value>
         </list>
        </property>
    </bean>         
            
               <!--  事物的配置       -->    
       <bean id="transactionManagerMysql" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
         <property name="dataSource" ref="dataSourceMysql"/>
       </bean>
        
    <!-- 自动代理事物    --> <bean id="transactionInterceptorMysql"
        class="org.springframework.transaction.interceptor.TransactionInterceptor"> 
        <property name="transactionManager">
         <ref bean="transactionManagerMysql" />
        </property> 
        <property name="transactionAttributes">
          <props>
            <prop key="*">PROPAGATION_REQUIRED</prop>    
          </props>
        </property>
    </bean>
    <bean id="autoproxyMysql" class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">
        <property name="beanNames">
         <list>
          <value>*daomys</value>
         </list>
        </property>
        <property name="interceptorNames">
        <list>
             <value>transactionInterceptorMysql</value> 
         </list>
        </property>
    </bean>  



        <bean id="myThrowsAdvice"
            class="com.sand.util.MyThrowsAdvice">
        </bean> 
    <bean id="productService"
            class="com.sand.service.ProductService">
             <property name="productdaoSqls" ref="productdaoSqls" /> 
             <property name="productsdaomys" ref="productsdaomys" /> 
             <property name="branddaomys" ref="branddaomys" /> 
             <property name="goodscatdaomys" ref="goodscatdaomys" /> 
             <property name="goodsdaomys" ref="goodsdaomys" /> 
             <property name="goodscatdaoSqls" ref="goodscatdaoSqls" /> 
             <property name="giftdaomys" ref="giftdaomys" /> 
             <property name="giftdaoSqls" ref="giftdaoSqls" />                               
        </bean>    <bean id="aopsevice"
            class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">        <property name="interceptorNames">
                <list>
                    <value>myThrowsAdvice</value>
                </list>
            </property>
            <property name="beanNames">
                <list>
                    <value>*Service</value>
                </list>
            </property>
        </bean></beans> 
      

  6.   

    public class ProductService implements Service{
    ProductDao productdaoSqls;
    ProductsDao productsdaomys;
    BrandDao branddaomys;
    GoodsCatDao goodscatdaomys;
    GoodsCatDao goodscatdaoSqls;
    GoodsDao goodsdaomys;
    GiftDao giftdaomys;
    GiftDao giftdaoSqls;

    public ProductService(){
    // DataFactory mysqlfac = new MysqlFactory();
    // DataFactory sqlserverfac = new SqlServerFactory();
    // productdaoSqls = sqlserverfac.createProductDao();
    // productsdaomys = mysqlfac.createProductsDao();
    // branddaomys = mysqlfac.createBrandDao();
    // goodscatdaomys = mysqlfac.createGoodsCatDao();
    // goodsdaomys = mysqlfac.createGoodsDao();
    // goodscatdaoSqls = sqlserverfac.createGoodsCatDao();
    // giftdaomys = mysqlfac.createGiftDao();
    // giftdaoSqls = sqlserverfac.createGiftDao();
    //        ApplicationContext context = ContextHelper.getContext();
    ////        productdaoSqls = (ProductDao) context.getBean("productdaoSqls");
    //        productsdaomys = (ProductsDao) context.getBean("productsdaomys");
    //        branddaomys = (BrandDao) context.getBean("branddaomys");
    //        goodscatdaomys = (GoodsCatDao) context.getBean("goodscatdaomys");
    //        goodsdaomys = (GoodsDao) context.getBean("goodsdaomys");
    //        goodscatdaoSqls = (GoodsCatDao) context.getBean("goodscatdaoSqls");
    //        giftdaomys = (GiftDao) context.getBean("giftdaomys");
    //        giftdaoSqls = (GiftDao) context.getBean("giftdaoSqls");
            
    }

    public  void process(Map map) throws ProcessLoggerException{
    System.out.println("进入Product处理逻辑");
         if(map.containsKey("action")){
          String goods_id = (String)map.get("goods_id");
          String product_id = (String)map.get("product_id");
          if(map.get("action").equals("create")){
          try{
          Goods goods = goodsdaomys.selectGoods(goods_id);
          int cat_id = goods.getCat_id();
          int brand_id = goods.getBrand_id();
          Products products = productsdaomys.selectProducts(product_id);
          GoodsCat goodscat = goodscatdaomys.selectGoodsCat(cat_id);
          Brand brand = branddaomys.selectBrand(brand_id);
          Product product = new Product();
          product.setGoods(goods);
          product.setProducts(products);
          product.setGoodscat(goodscat);
          product.setBrand(brand);
          productdaoSqls.saveProduct(product);
          //同步商品分类表
          GoodsCat goodscatsqls = goodscatdaoSqls.selectGoodsCat(cat_id);
          System.out.println("-------"+goodscatsqls);
          System.out.println("-------"+goodscatsqls.getCat_id());       
          if(0 == goodscatsqls.getCat_id()){
          goodscatdaoSqls.saveGoodsCat(goodscat);
          }
          //同步赠品表
          Gift gift = giftdaomys.selectGiftDao(Integer.parseInt(product_id));
          if(0 == gift.getProductid()){
          gift.setProductid(Integer.valueOf(goods_id));
          gift.setProid(Integer.valueOf(product_id));
          giftdaoSqls.saveGiftDao(gift);
          } 
          }catch(Exception e){
          e.printStackTrace();
          throw new ProcessLoggerException("Product 订单日志同步执行插入异常"); 
          }
          }else if(map.get("action").equals("update")){ 
          try{
          Goods goods = goodsdaomys.selectGoods(goods_id);
          int cat_id = goods.getCat_id();
          int brand_id = goods.getBrand_id();
          Products products = productsdaomys.selectProducts(product_id);
          GoodsCat goodscat = goodscatdaomys.selectGoodsCat(cat_id);
          Brand brand = branddaomys.selectBrand(brand_id);
          Product product = new Product();
          product.setGoods(goods);
          product.setProducts(products);
          product.setGoodscat(goodscat);
          product.setBrand(brand);
          productdaoSqls.updateProduct(product);
          //同步商品分类表
          GoodsCat goodscatsqls = goodscatdaoSqls.selectGoodsCat(cat_id);
          System.out.println("-------"+goodscatsqls);
          System.out.println("-------"+goodscatsqls.getCat_id());       
          if(0 == goodscatsqls.getCat_id()){
          goodscatdaoSqls.updateGoodsCat(goodscat);
          }
          //同步赠品表
          Gift gift = giftdaomys.selectGiftDao(Integer.parseInt(product_id));
          if(0 == gift.getProductid()){
          gift.setProductid(Integer.valueOf(goods_id));
          gift.setProid(Integer.valueOf(product_id));
          giftdaoSqls.updateGiftDao(gift);
          }        
          }catch(Exception e){
          e.printStackTrace();
          throw new ProcessLoggerException("Product 订单日志同步执行更新异常");        
          }
          
          }else if(map.get("action").equals("delete")){
          try{
          Product product = productdaoSqls.selectProduct(product_id);
          if(0 == product.getProducts().getProduct_id()){
          productdaoSqls.deleteProduct(product_id);
          } 
          Gift gift = giftdaomys.selectGiftDao(Integer.parseInt(product_id));
          if(0 != gift.getProductid()){
          gift.setProductid(Integer.valueOf(goods_id));
          gift.setProid(Integer.valueOf(product_id));
          giftdaoSqls.deleteGiftDao(gift.getGiftid());
          } 
          }catch(Exception e){
          e.printStackTrace();
          throw new ProcessLoggerException("Product 订单日志同步执行删除异常");           
          }
          }
          
          
         }

    }}
      

  7.   

    public class ProductDaoForSqlServerImpl implements ProductDaoForSqlServer {
        Logger logger=Logger.getLogger(ProductDaoForSqlServerImpl.class);
        ReadPro readpro = new ReadPro();
    public boolean deleteProduct(String product_id) throws ProcessLoggerException {
    Boolean result= true;
    String sql = readpro.getPara("sql.properties","SqlServerForProductDelete");
    ResultSet rs=null;
    DataSource ds = DBUtil.getDataSource("SqlServer");
    Connection conn = DBUtil.getCon(ds);
    PreparedStatement preparstat = DBUtil.getPreparstat(conn, sql);
    try {
    preparstat.setString(1, product_id);
    preparstat.executeUpdate();
    result = true;
        } catch (SQLException e) {
    e.printStackTrace();
    logger.debug("Prodct删除出错");
    throw new ProcessLoggerException("Product 订单日志同步执行插入异常");
        } finally {
         DBUtil.closeConn(conn);
         DBUtil.closePreparstat(preparstat);
        }
    return false;
    } public boolean saveProduct(Product product) throws ProcessLoggerException {
    boolean result = false;
    String sql = readpro.getPara("sql.properties","SqlServerForProductSave");
    DataSource ds = DBUtil.getDataSource("SqlServer");
    Connection conn = DBUtil.getCon(ds);
    PreparedStatement preparstat = DBUtil.getPreparstat(conn, sql);
    try {
    preparstat.setString(1 ,product.getGoods().getName());
    preparstat.setBigDecimal(2,product.getGoods().getMktprice());
    preparstat.setBigDecimal(3, product.getGoods().getCost());
    preparstat.setBigDecimal(4, product.getGoods().getPrice());
    preparstat.setString(5, product.getGoods().getBrief());
    preparstat.setString(6, product.getGoods().getInfo());
    preparstat.setInt(7 , product.getGoods().getP_order());
    preparstat.setBigDecimal(8 ,product.getProducts().getWeight() );
    preparstat.setBoolean(9 ,product.getProducts().getMarkettable() );
    preparstat.setInt(10,product.getProducts().getProduct_id() );
    preparstat.setString(11,product.getProducts().getUnit() );
    preparstat.setInt(12, product.getGoods().getBrand_id());
    preparstat.setString(13, product.getBrand().getBrand_name());
    preparstat.setString(14, product.getGoods().getBig_pic());
    preparstat.setString(15, product.getGoods().getSamll_pic());
    preparstat.setInt(16, product.getGoods().getView_count());
    preparstat.setInt(17, product.getGoods().getBuy_count());
    // preparstat.setInt(18, product.getGoods().getLast_modify());
      preparstat.setTimestamp(18,Timestamp.valueOf("2012-12-12 10:43:49.500"));
    preparstat.setInt(19, product.getGoods().getScore());
    preparstat.setInt(20, product.getGoods().getCat_id());
    preparstat.setInt(21, product.getGoodscat().getParent_id());
    preparstat.setString(22, product.getGoodscat().getCat_path());
    preparstat.setString(23, product.getGoodscat().getCat_name());
    preparstat.setBigDecimal(24, product.getProducts().getStore());
    preparstat.setInt(25, product.getGoods().getMin_buy());
    //时间需特殊处理
    // if(((Integer)(product.getProducts().getUptime())).equals(null)){
    // preparstat.setString(26,null);
    // }else{
    // Integer date = (Integer)(product.getProducts().getUptime());
    // preparstat.setTimestamp(26, Timestamp.valueOf(DateUtil.getInttoDateTime(date.toString())));
    // }
      preparstat.setTimestamp(26,Timestamp.valueOf("2012-12-12 10:43:49.500"));
    //  preparstat.setDate(26, new Date(System.currentTimeMillis()));// preparstat.setLong(27, product.getGoods().getGoods_id().longValue());  
    preparstat.executeUpdate();
    result = true;
    } catch (SQLException e) {
    e.printStackTrace();
    logger.debug("Prodct插入出错");
    throw new ProcessLoggerException("Product 订单日志同步执行插入异常");
    } finally {
    DBUtil.closeConn(conn);
    DBUtil.closePreparstat(preparstat);
    }
    return result;
    } public Product selectProduct(String product_id) throws ProcessLoggerException {
    logger.info("welcome to Products");
    ResultSet rs=null;
    Product product = new Product();
    Products products = new Products();
    String sql = readpro.getPara("sql.properties","SqlServerForProductSelect");
    DataSource ds = DBUtil.getDataSource("SqlServer");
    Connection conn = DBUtil.getCon(ds);
    PreparedStatement preparstat = DBUtil.getPreparstat(conn, sql);
    try {
    preparstat.setInt(1, Integer.valueOf(product_id));
    rs=preparstat.executeQuery();
                while(rs.next()){
                 products.setProduct_id(rs.getInt("ProductID"));           
                }
                product.setProducts(products);
    } catch (SQLException e) {
    e.printStackTrace();
    logger.debug("查询Products表出错");
    throw new ProcessLoggerException("Product 订单日志同步执行插入异常");
    } finally {
    DBUtil.closeConn(conn);
    DBUtil.closePreparstat(preparstat);
    }
    return product;
    } public boolean updateProduct(Product product) throws ProcessLoggerException {
    boolean result = false;
    String sql = readpro.getPara("sql.properties","SqlServerForProductUpdate");
    DataSource ds = DBUtil.getDataSource("SqlServer");
    Connection conn = DBUtil.getCon(ds);
    PreparedStatement preparstat = DBUtil.getPreparstat(conn, sql);
    try {
    preparstat.setString(1 ,product.getGoods().getName());
    preparstat.setBigDecimal(2,product.getGoods().getMktprice());
    preparstat.setBigDecimal(3, product.getGoods().getCost());
    preparstat.setBigDecimal(4, product.getGoods().getPrice());
    preparstat.setString(5, product.getGoods().getBrief());
    preparstat.setString(6, product.getGoods().getInfo());
    preparstat.setInt(7 , product.getGoods().getP_order());
    preparstat.setBigDecimal(8 ,product.getProducts().getWeight() );
    preparstat.setBoolean(9 ,product.getProducts().getMarkettable() );
    preparstat.setInt(10,product.getProducts().getProduct_id() );
    preparstat.setString(11,product.getProducts().getUnit() );
    preparstat.setInt(12, product.getGoods().getBrand_id());
    preparstat.setString(13, product.getBrand().getBrand_name());
    preparstat.setString(14, product.getGoods().getBig_pic());
    preparstat.setString(15, product.getGoods().getSamll_pic());
    preparstat.setInt(16, product.getGoods().getView_count());
    preparstat.setInt(17, product.getGoods().getBuy_count());
    // preparstat.setInt(18, product.getGoods().getLast_modify());
      preparstat.setTimestamp(18,Timestamp.valueOf("2012-12-12 10:43:49.500"));
    preparstat.setInt(19, product.getGoods().getScore());
    preparstat.setInt(20, product.getGoods().getCat_id());
    preparstat.setInt(21, product.getGoodscat().getParent_id());
    preparstat.setString(22, product.getGoodscat().getCat_path());
    preparstat.setString(23, product.getGoodscat().getCat_name());
    preparstat.setBigDecimal(24, product.getProducts().getStore());
    preparstat.setInt(25, product.getGoods().getMin_buy());
    //时间需特殊处理
    // if(((Integer)(product.getProducts().getUptime())).equals(null)){
    // preparstat.setString(26,null);
    // }else{
    // Integer date = (Integer)(product.getProducts().getUptime());
    // preparstat.setTimestamp(26, Timestamp.valueOf(DateUtil.getInttoDateTime(date.toString())));
    // }
      preparstat.setTimestamp(26,Timestamp.valueOf("2012-12-12 10:43:49.500"));
    //  preparstat.setDate(26, new Date(System.currentTimeMillis())); preparstat.setBigDecimal(27, new BigDecimal(product.getGoods().getGoods_id()));  
    preparstat.setBigDecimal(28, new BigDecimal(product.getGoods().getGoods_id()));
    preparstat.executeUpdate();
    result = true;
    } catch (SQLException e) {
    e.printStackTrace();
    logger.debug("Prodct更新出错");
    throw new ProcessLoggerException("Product 订单日志同步执行插入异常");
    } finally {
    DBUtil.closeConn(conn);
    DBUtil.closePreparstat(preparstat);
    }
    return result;
    }}