我目前正在尝试构建一个使用Spring,Hibernate和Maven(在tomcat上运行)的小型webapp.它工作得很好,除了我无法使我的嵌入式数据库工作.我希望你能帮助我.
当我将webapp部署到Tomcat时,我总是面临这个错误:
匹配的通配符是严格的,但是找不到元素'jdbc:embedded-database'的声明
在我的调查过程中,我了解到这条消息指向缺少的图书馆.因此我添加了我的pom.xml,我添加了工件spring-jdbc.
你能帮我找到错误吗?非常感谢!
这是我的spring-configuration文件,它会在webapp初始化期间导致错误:
<?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:tx="http://www.springframework.org/schema/tx"
xmlns:jdbc="http://www.springframework.org/schema/jdbc/spring-jdbc-3.1.xsd"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://www.springframework.org/schema/jdbc
http://www.springframework.org/schema/jdbc/spring-jdbc-3.1.xsd">
<bean id="sessionFactory" class=
"org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource" ref="embeddedDatasource" />
<property name="packagesToScan" value="org.rest" />
<property name="hibernateProperties">
<value>
hibernate.dialect=org.hibernate.dialect.MySQL5Dialect
hibernate.hbm2ddl.auto=update
hibernate.show_sql=false
</value>
</property>
</bean>
<jdbc:embedded-database id="embeddedDatasource" type="HSQL"/>
<bean id="txManager" class=
"org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<tx:annotation-driven transaction-manager="txManager" />
</beans>
Run Code Online (Sandbox Code Playgroud)
这是我的pom.xml:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.marcus</groupId>
<artifactId>maven-webapp-archetype</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>maven-webapp-archetype Maven Webapp</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency> …Run Code Online (Sandbox Code Playgroud) 目前我们所有的构建都失败了,因为它们无法从公共SBT插件回购中解析插件.我们收到以下错误:
[warn]注意:一些未解析的依赖项具有额外的属性.检查这些依赖项是否与请求的属性一起存在.[warn] com.typesafe.play:sbt-plugin:2.4.0(scalaVersion = 2.10,sbtVersion = 0.13)[warn] com.github.gseitz:sbt-release:1.0.0(scalaVersion = 2.10,sbtVersion = 0.13)
SBT 文档列出了预定义的回购.sbt插件的链接导致404.我认为某种重定向机制被破坏了.
我知道实际的工件是在bintray上托管的.因此我试图将我的构建直接指向此repo,但这似乎有所帮助.我在项目/ plugins.sbt中添加了以下内容:
resolvers += Resolver.url(
"fix-sbt-plugin-releases",
url("http://dl.bintray.com/sbt/sbt-plugin-releases"))(
Resolver.ivyStylePatterns)
Run Code Online (Sandbox Code Playgroud)
有谁知道修复如何绕过这个?
UISearchBar我的应用程序中有一个屏幕.当用户进入屏幕时,搜索栏中可能已存在文本.如果用户然后点击该字段然后点击取消,则不应清除搜索栏的内容.
这可以实现吗?我试图实现searchBarCancelButtonClicked,但我对text属性的修改被忽略,文本字段仍然被清除.
我正在关注 https://www.graph.cool/docs/1.0/quickstart/backend/typescript/typescript-rohd6ipoo4 for graphcool 并且我收到错误
{
"errors": [
{
"code": 3016,
"requestId": "api:api:cjc7gf91e002v0180uq2hqace",
"message": "Project not found: 'my-app@dev'"
}]}
Run Code Online (Sandbox Code Playgroud)
用于查询和变异。我是 graphcool 的新手,所以不知道为什么会这样。我正在按照上述链接中提供的步骤进行操作。
Graphql 服务器:
const server = new GraphQLServer({
typeDefs: './src/schema.graphql',
resolvers,
context: req => ({
...req,
db: new Graphcool({
endpoint: 'http://localhost:60000/my-app/dev',
secret: 'mysecret123',
}),
}),
})
$ graphcool info
Service Name: my-app
dev (cluster: `local`)
HTTP: http://localhost:60000/my-app/dev
Websocket: ws://localhost:60000/my-app/dev
Run Code Online (Sandbox Code Playgroud) 考虑我目前正在进行的以下简化域模型:
case class Product(val id : Long, val name : String, product : Option[Product], category : Option[ProductCategory])
case class Price(val id : Long, val amount : Double, val conditions : Seq[Condition])
trait Condition {
def isTrue(product: Product):Boolean
}
case class ManufacturerNameCondition(val id : Long, val name : String){...}
case class DateCondition(val id : Long, val validFrom : Date, val validTo : Date){...}
Run Code Online (Sandbox Code Playgroud)
这个模型代表什么?
它代表一种简单的价格服务,允许为产品或产品类别定义多个价格.产品的最终价格通过检查所有匹配价格及其相关条件来确定.例如,产品可能有正常价格和一个额外价格,这只是今天有效,因为它有一个DateCondition.
我的问题是什么? 价格可能与多个条件相关联.每种情况可以是另一种类型.所以我问自己应该如何用Slick(=多态关系)解决这个问题.基本上我想要一个类似DAO的界面,它可以获取价格以及相关条件.
我的问题:
Plz注意: 是的,我没有代码可以显示我尝试过的内容,但是现在我需要一些方向来寻找.目前我不知何故失去了:-)
我是新的Objective C开发,我的工作流程无法发送消息.为了调用方法,java i会输入以下内容:
obj
// .. i am thinking about what to do... call a method!
obj.
// autocompletion pops up
obj.someMethod()
Run Code Online (Sandbox Code Playgroud)
XCode中的工作流程目前对我来说不太方便.目前,如果经常看起来像这样:
obj
// .. i am thinking about what to do... send a message!
obj //damn i need to have the bracket at the beginning
// and jumping to the beginning of the line with cmd+arrow ignores indentation!
[obj // now i need the cursor at the end of the line
[obj someMessage //now i have to insert …Run Code Online (Sandbox Code Playgroud)