小编Arn*_*lay的帖子

maven编译 - 错误log4j

我正在构建java应用程序,突然我发现编译问题:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project sonda: Compilation failure: Compilation failure:
[ERROR] ..../service/UserService.java:[7,23] package org.apache.log4j does not exist
Run Code Online (Sandbox Code Playgroud)

但我之前正在构建这个应用程序,一切都很好.另外,当我使用tomcat在Eclipse下运行这个应用程序时,它运行良好.

在pom我有:

<dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>${org.slf4j-version}</version>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>jcl-over-slf4j</artifactId>
        <version>${org.slf4j-version}</version>
        <scope>runtime</scope>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-log4j12</artifactId>
        <version>${org.slf4j-version}</version>
        <scope>runtime</scope>
    </dependency>
    <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>1.2.15</version>
        <exclusions>
            <exclusion>
                <groupId>javax.mail</groupId>
                <artifactId>mail</artifactId>
            </exclusion>
            <exclusion>
                <groupId>javax.jms</groupId>
                <artifactId>jms</artifactId>
            </exclusion>
            <exclusion>
                <groupId>com.sun.jdmk</groupId>
                <artifactId>jmxtools</artifactId>
            </exclusion>
            <exclusion>
                <groupId>com.sun.jmx</groupId>
                <artifactId>jmxri</artifactId>
            </exclusion>
        </exclusions>
        <scope>runtime</scope>
    </dependency>
Run Code Online (Sandbox Code Playgroud)

你能帮助我吗 ?

log4j pom.xml maven

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

如何为JSON公开REST服务?

我需要公开一个接受JSON有效负载的Spray服务.我在哪里可以找到能够展示这种功能的样本?

scala spray spray-json

11
推荐指数
1
解决办法
8602
查看次数

从Jquery-ui自动完成到typeahead.js

我正在将我的应用程序迁移到twitter-bootstrap,我想用typeahead.js替换我的jquery-ui自动完成.

最好使用twitter-bootstrap中嵌入的功能,但如果需要,我可以使用额外的typeahead插件.

我的问题是我很难再现当前的行为,尤其是在没有结果的情况下.

你会怎么做那样的事情?

$("#search").autocomplete({
           source : myUrl,
            delay : 100,
            minLength : 2,
            select : function(event, ui) {
              // do whatever i want with the selected item
            },

            response : function(event, ui) {
                if (ui.content.length === 0) {
                    ui.content.push({
                        label : "No result",
                        value : customValue
                    });
                }
            }
        });
Run Code Online (Sandbox Code Playgroud)

基本上,如果没有结果,我想在组件中显示自定义消息.

谢谢!

jquery-ui twitter-bootstrap bootstrap-typeahead typeahead.js

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

网络流量模拟测试

我有一个PHP站点启动并运行,db是mysql.在启动网站之前,我想测试一下流量处理.现在我假设有一些软件可以模拟流量并记录我网站上运行的进程.我应该使用的任何软件推荐?流量不一定是真实的,但是,我想产生高流量来调查网站的门槛.感谢帮助

simulation performance stress-testing network-traffic web

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

为什么光滑的预测不起作用

出于某种原因,在我的情况下,即使简单的Slick表声明也不起作用.我正在使用光滑的2.10(1.0.0),这是maven中央存储库中的最新版本.

case class DeviceType(id: Option[Int] = None, name: String, version: String)

object DeviceTypes extends Table[DeviceType]("device_types") {

  def id = column[Int]("id", O.PrimaryKey, O.AutoInc)
  def name = column[String]("name", O.NotNull)
  def version = column[String]("version")

  def * = id.? ~ name ~ version <> (DeviceType, DeviceType.unapply _)


  def delete(device_type: DeviceType): Unit = {
database withSession { implicit session : Session =>
  val dt_query = for(dt <- DeviceTypes if dt.id == device_type.id.get) yield dt
    //Query(DeviceTypes).filter(_.id == device_type.id.get)
  dt_query.delete
}
  }
}

[warn] /home/salil/Scala/sd_ventures/app/models/DeviceType.scala:38: scala.slick.lifted.Column[Int] and …
Run Code Online (Sandbox Code Playgroud)

scala scalaquery slick

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