首页 \ 问答 \ Maven将applicationContext.xml从src / main / resources复制到target / myproject / WEB-INF(Maven copying applicationContext.xml from src/main/resources to target/myproject/WEB-INF)

Maven将applicationContext.xml从src / main / resources复制到target / myproject / WEB-INF(Maven copying applicationContext.xml from src/main/resources to target/myproject/WEB-INF)

目前,默认我认为,它复制到

target/myproject/WEB-INF/classes

因此在部署时不会获取上下文。

另外,我想引用服务器特定的配置文件database.properties ,我想把它放在tomcat / conf中,然后在applicationContext.xml中引用它,我该怎么做?

另外(2),我觉得这是一个相当标准和体面的方式来设置 - 如果我错了,请纠正我。

编辑服务器特定的配置文件我用户这个

<context:property-placeholder 
      location="file:${catalina.home}/conf/database.properties" 
      ignore-unresolvable="true"
 />

At the moment, the default I think, it copies to

target/myproject/WEB-INF/classes

so when deploying it does not pick up the context.

Also, i want to reference a server specific config file database.properties, I want to put it in tomcat/conf and then reference it in applicationContext.xml, how can I do this ?

Also(2), I am under the impression that this is a fairly standard and decent way to set things up - please correct me if I am wrong.

edit for the server specific config file I user this

<context:property-placeholder 
      location="file:${catalina.home}/conf/database.properties" 
      ignore-unresolvable="true"
 />

原文:https://stackoverflow.com/questions/8170773
更新时间:2022-04-22 19:04

最满意答案

基于其他答案,下面是一种使用软锁API来防止节点同时进入涉及两种状态的事务的方法:

@InitiatingFlow
@StartableByRPC
class AtomicFlow(val stateRefToSpend: StateRef, val stateRefToLock: StateRef) : FlowLogic<Unit>() {
    @Suspendable
    override fun call() {
        try {
            serviceHub.vaultService.softLockReserve(runId.uuid, NonEmptySet.of(stateRefToSpend, stateRefToLock))
        } catch (e: StatesNotAvailableException) {
            logger.error("A transaction is already underway using S2.")
            return
        }

        val stateToSpend = serviceHub.loadState(stateRefToSpend)

        // Continue with transaction...
    }
}

Building on the other answers, here's one way of using the soft-locking API to prevent a node from entering into transactions involving both states at once:

@InitiatingFlow
@StartableByRPC
class AtomicFlow(val stateRefToSpend: StateRef, val stateRefToLock: StateRef) : FlowLogic<Unit>() {
    @Suspendable
    override fun call() {
        try {
            serviceHub.vaultService.softLockReserve(runId.uuid, NonEmptySet.of(stateRefToSpend, stateRefToLock))
        } catch (e: StatesNotAvailableException) {
            logger.error("A transaction is already underway using S2.")
            return
        }

        val stateToSpend = serviceHub.loadState(stateRefToSpend)

        // Continue with transaction...
    }
}

相关问答

更多
  • 这两点是无关的 顺序 如果插入值1到1000,则它将与WHERE和ORDER BY顺序连接,以将某些列中的这1000行限制为您。 除非有重复,否则你需要一个独特的约束 如果您依赖于IDENTITY,则无法保证: 插入的记录总是接收连续的标识值 。 原子性 所有交易都是原子的: 是否需要在事务中封装单个合并语句(使用插入,删除和更新)? SQL Server和事务中间的连接丢失 如果在没有事务的情况下执行删除语句,是否部分删除? The 2 points are unrelated Sequential If ...
  • 存储服务是支持节点的数据库。 保管库是该数据库中的一个表,用于跟踪与该节点相关的状态。 分类帐是一个比喻性的“全局事务日志”,它存储每个节点执行的每个事务(实际上,每个节点只能看到并存储该分类帐上的一部分事务) 存储服务是数据库的另一个名称。 保管库是该数据库中的一个表。 分类帐只是一种比喻 分类帐只是一种比喻。 存储服务存储节点已知的所有内容 是的,保险库存储已消耗和未消耗的状态。 每次记录事务时,节点都会获取相关状态并将其存储在其保管库中 存储服务包含节点已知的所有内容,包括保管库 The storag ...
  • 基于其他答案,下面是一种使用软锁API来防止节点同时进入涉及两种状态的事务的方法: @InitiatingFlow @StartableByRPC class AtomicFlow(val stateRefToSpend: StateRef, val stateRefToLock: StateRef) : FlowLogic() { @Suspendable override fun call() { try { serviceHub.va ...
  • 用@ConstructorForDeserialization注解你的参数化构造函数 尽管java文档提到使用注释[@CordaConstructor] - java文档需要在SerializationHelper.Kt中更新 在某些情况下,公民也应该参与共享项目。 还要确保为所有子项目添加-parmeters,例如: subprojects { tasks.withType(JavaCompile) { options.compilerArgs << '-parameters' ...
  • 通过令牌,我假设你指的是可替代资产(一个令牌与另一个令牌相同)。 在corda中,这是使用契约模型 - 契约定义了契约/资产行为。 对于这个例子,你可以在这里看到现金https://github.com/corda/corda/blob/master/finance/src/main/kotlin/net/corda/finance/contracts/asset/Cash.kt 。 为了证明一个党拥有令牌corda使用公证人。 每个状态(代币合同中定义的代币实例)都由公证人检查其有效性,只需简单地运行合同 ...
  • 这是一个SessionRejectException 。 这是因为从BroadcastTransaction收到消息的节点没有注册流来响应BroadcastTransaction 。 您需要在表单的接收节点上安装响应程序流: @InitiatedBy(BroadcastTransaction::class) class Responder(val counterpartySession: FlowSession) : FlowLogic() { @Suspendable over ...
  • 是的,你不需要做任何特别的事情。 命令指定谁需要签名的PublicKeys。 州参与者指定州的分配清单。 Commands中列出的PublicKeys通常是交易中状态参与者列表中PublicKeys的子集。 请记住,交易的分发清单将是每个州中所有参与者集合的联合。 Yes, you shouldn't need to do anything special. Commands specify the PublicKeys of who needs to sign. State participants sp ...
  • Bouncy Castle加密库支持OpenPGP和其他一些加密库。 它在文档上有点短,但确实支持分割键。 The Bouncy Castle crypto library has support for OpenPGP and a number of others. It's a bit short on documentation, but it does support split keys.
  • 在声明中:原子事务是执行所需步骤的最小操作集。 所有这些必需的操作都发生(成功)或原子事务失败。 原子操作通常与事务没有任何共同之处。 据我所知,这来自硬件编程,其中一组操作(或一个)碰巧立即得到解决。 In a statement: an atomic transaction is the smallest set of operations to perform the required steps. Either all of those required operations happen(succ ...
  • 您需要公证人有两个原因: 恶意节点 :节点有目的地从其保管库中提取消耗状态,在另一个事务中使用它,并将事务发送给没有看到原始事务的交易对手 竞争条件 :两个节点同时建议消耗相同状态的事务 There are two reasons you need a notary: Malicious nodes: A node purposefully extracts a consumed state from its vault, consumes it in another transaction, and se ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)