小编cas*_*dox的帖子

匹配的通配符是严格的,但是找不到元素'tx:annotation-driven'的声明

我正在尝试配置JSF + Spring + hibernate,我想要运行测试,但是当我在application-context.xml文件中使用"tx:annotation-driven"时,我收到此错误:

匹配的通配符是严格的,但是找不到元素'tx:annotation-driven'的声明

这是我的application-context.xml:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:aop="http://www.springframework.org/schema/aop"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:tx="http://www.springframework.org/schema/tx"

       xsi:schemaLocation="http://www.springframework.org/schema/beans 
          http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
          http://www.springframework.org/schema/aop 
          http://www.springframework.org/schema/aop/spring-aop-2.5.6.xsd
          http://www.springframework.org/schema/context 
          http://www.springframework.org/schema/context/spring-context-2.5.6.xsd
          http://www.springframework.org/schema/tx 
          http://www.springframework.org/schema/tx/spring-tx-2.5.6.xsd
" xmlns:tool="http://www.springframework.org/schema/tool">
    <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
        <property name="driverClassName" value="oracle.jdbc.OracleDriver"/>
        <property name="url" value="jdbc:oracle:thin:@192.168.56.101:1521:Gpsi"/>
        <property name="username" value="omar"/>
        <property name="password" value="omar"/>
    </bean>

    <bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
       <property name="dataSource" ref="dataSource"/>
       <property name="annotatedClasses">
            <list>
                <value>om.mycompany.model.Course</value>
                <value>om.mycompany.model.Student</value>
                <value>om.mycompany.model.Teacher</value>
            </list>
       </property>
       <property name="hibernateProperties">
            <props>
                <prop key="hibernate.dialect">org.hibernate.dialect.OracleDialect</prop>
            </props>
       </property>

    </bean>
    <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
       <property name="sessionFactory" ref="sessionFactory"/>
    </bean>
    <tx:annotation-driven transaction.manager="transactionManager"/>

    <context:annotation-config/>
    <context:component-scan base.package="com.mmycompany"/>
</beans>
Run Code Online (Sandbox Code Playgroud)

这是我的CourseServiceImplTest.我还没有实现测试:

public class …
Run Code Online (Sandbox Code Playgroud)

spring transactions spring-transactions

42
推荐指数
3
解决办法
13万
查看次数

序列增加 50 而不是 1

我创建了一个 Oracle 序列:

创建序列 seq_acteurs 以 1 递增 1 开始;

通常序列必须递增 1,但插入Acteurstable 时,序列s递增 50!这似乎不合逻辑。为什么会这样?

任何帮助都会得到很大的帮助。

sequences oracle10g id-generation

7
推荐指数
1
解决办法
5396
查看次数

Glassfish 3.x开始失败

我试图在Netbeans 7上的Glassfish v3.x上运行我的java EE Web应用程序,但它不能工作,并且给我以下错误:Glassfish 3.x启动失败.我不知道玻璃鱼过去常常工作的问题是什么,然后突然停止工作我没有设置netbeans和glassfish再次安装它,但仍然是同样的问题.这是glassfish日志:

Launching GlassFish on Felix platform
INFO: Registered org.glassfish.ha.store.adapter.cache.ShoalBackingStoreProxy for persistence-type = replicated in BackingStoreFactoryRegistry
INFO: Grizzly Framework 1.9.31 started in: 585ms - bound to [0.0.0.0:3700]
INFO: Grizzly Framework 1.9.31 started in: 580ms - bound to [0.0.0.0:8181]
INFO: Grizzly Framework 1.9.31 started in: 738ms - bound to [0.0.0.0:8080]
INFO: Grizzly Framework 1.9.31 started in: 584ms - bound to [0.0.0.0:7676]
INFO: Grizzly Framework 1.9.31 started in: 539ms - bound to [0.0.0.0:4848]
GRAVE: Exception while visiting com/ibm/icu/impl/data/LocaleElements_zh__PINYIN.class …
Run Code Online (Sandbox Code Playgroud)

netbeans glassfish

5
推荐指数
1
解决办法
6328
查看次数

目标无法访问,返回null

我在尝试使用对象currentActeurObjetProjet时遇到问题,并使用Primefaces在对话框中显示其属性,但它一直显示此错误:

注意:/infoprojet.xhtml @ 493159值= "#{} acteurObjetProjetBean.currentActeurObjetProjet.objets.nomObjet":目标不可达, 'OBJETS' 返回null javax.el.PropertyNotFoundException:/infoprojet.xhtml @ 493159值="#{acteurObjetProjetBean. currentActeurObjetProjet.objets.nomObjet}":目标无法访问,'objets'返回null

这是备份bean:

package com.mycompany.projet;
.......

/**
 *
 * @author Omar
 */
@Component("etatsBean")
@Scope("session")
public class ActeurObjetProjetBean implements Serializable{
   .......
    private ActeurObjetProjet currentActeurObjetProjet=new ActeurObjetProjet();
   .......
     ////////////////////////////////////////////////////////// Méthodes & fonctions\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

      ////////////////////////////////////////////////////////// setters & getters \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ 
    public void setCurrentActeurObjetProjet(ActeurObjetProjet currentActeurObjetProjet)
    {
        this.currentActeurObjetProjet=currentActeurObjetProjet;
    }
    public ActeurObjetProjet getCurrentActeurObjetProjet()
    {
        return currentActeurObjetProjet;
    } 
    .......
} 
Run Code Online (Sandbox Code Playgroud)

这是我的页面代码:

<p:dialog header="Editer Objet" widgetVar="editobjetDialog" resizable="true" width="300" height="300" showEffect="clip" hideEffect="clip" modal="true">
                                    <p:outputPanel id="editobjetDetail" style="text-align:center;" layout="block">
                                        <center>
                                            <h:panelGrid  columns="2" cellpadding="5">
                                                 <h:outputLabel …
Run Code Online (Sandbox Code Playgroud)

java-ee primefaces jsf-2

3
推荐指数
1
解决办法
2万
查看次数

从primeface的selectOneMenu中选择项目不起作用

我从a获取所选项目时遇到问题selectOneMenu.
这是我的JSF代码:

<h:form id="mainfrm">   
    <h:panelGrid columns="2" style="margin-bottom:10px" cellpadding="5">  
        <h:outputText value="Basic Usage: " />  
        <p:selectOneMenu id="domaine" value="#{projet.currentDomaines}">  
            <f:selectItem itemLabel="Select One" itemValue="" />  
            <f:selectItems value="#{projet.initDomaines()}"  var="d" itemValue="#{d}" itemLabel="#{d.libelleDomaine}" /> 
            <p:ajax update="formEquipe" process="mainfrm" event="change" />
        </p:selectOneMenu>
     </h:panelGrid>     

</h:form>  

<h:form id="formEquipe">  
    <h:panelGrid id="display" columns="2" cellpadding="4">  
        <f:facet name="header">  
            <p:graphicImage value="/images/cars/xxxx.jpg"/>  
        </f:facet>  

        <h:outputText value="Domaine name :" />  
        <h:outputText value="#{projet.currentDomaines.libelleDomaine}"/>  

        <h:outputText value="Director :" />  
        <h:outputText value="#{projet.currentDomaines.nomDirecteur}" />  
    </h:panelGrid>  
</h:form>
Run Code Online (Sandbox Code Playgroud)

似乎一切都是正确的但我必须遗漏一些东西......所以我通过改变当前的Domaines(对象类型Domaines)来测试文本(String)并且它工作了,这里是代码:

<h:form id="mainfrm">   
    <h:panelGrid columns="2" style="margin-bottom:10px" cellpadding="5">  
        <h:outputText value="Basic Usage: " />  
        <p:selectOneMenu id="domaine" value="#{projet.text}">  
            <f:selectItem …
Run Code Online (Sandbox Code Playgroud)

jsf selectonemenu primefaces

2
推荐指数
1
解决办法
4万
查看次数

函数多次被无故召唤

我有一个init()函数,它返回填充数据表所需的Domaines列表,这个数据表的每一行都有两个命令链接,一个用于编辑,另一个用于删除,所以当我按下编辑命令链接时,一个对话框窗口显示Domaine有可能编辑的信息(还有另一个用于添加新域的对话框),所以问题是当我按下编辑时,调用init函数8次然后设置添加对话框的属性(即使之间没有关系)再次调用init函数4次后,编辑命令链接和添加对话框窗口.我不明白wh.这里是我的页面代码:

    <?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.prime.com.tr/ui"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core">
    <h:head>
        <title>Facelet Title</title>
    </h:head>
    <h:body>
         <ui:composition template="gpsiTemplate.xhtml">
            <ui:define name="left-menu">
                <ui:include src="admin-menuGauche.xhtml" />
            </ui:define> 
            <ui:define name="top">
                <ui:include src="menu-top.xhtml" />
            </ui:define>
            <ui:define name="content-top">
                <center>
                       <f:view>
                           <h:form id="topacteurs">
                               <h:panelGrid columns="14" styleClass="adminTopTable" >
                                   <h5 class="calendar">Direction :</h5> 
                                   <p:selectOneMenu id="typeacteurs" value="#{domaine.choixDirection}" style="width: 180px">  
                                        <f:selectItem itemLabel="Direction..." itemValue="" />  
                                        <f:selectItems value="#{direction.initcomb()}"  var="ta" itemValue="#{ta.codeDirection}" itemLabel="#{ta.libelleDirection}" />
                                        <p:ajax update=":mainform:domainlist" process="topacteurs" event="change" />
                                    </p:selectOneMenu>      

                                    <p:spacer width="20" height="0" />
                                    <p:commandButton title="Ajouter un domaine" …
Run Code Online (Sandbox Code Playgroud)

jsf java-ee primefaces jsf-2

0
推荐指数
1
解决办法
4092
查看次数