我正在尝试为Spring框架项目建立一个与机器无关的构建环境,而我的ant配置似乎无法正常工作.我搜索了很多,但似乎每个人都认为env.*引用开箱即用.有人可能会发现我的方式错误吗?
错误:
bash-3.1$ ant build
Buildfile: c:\Users\mkumpan\Projects\Spring testing\build.xml
BUILD FAILED
c:\Users\mkumpan\Projects\Spring testing\build.xml:85: c:\Users\mkumpan\Projects\Spring testing\${env.CATALINA_HOME}\lib does not exist.
Run Code Online (Sandbox Code Playgroud)
build.xml文件:85:
<taskdef name="install" classname="org.apache.catalina.ant.InstallTask">
<classpath refid="catalina-ant-classpath"/>
</taskdef>
Run Code Online (Sandbox Code Playgroud)
catalina-ant-classpath参考:
<path id="catalina-ant-classpath">
<fileset dir="${appserver.lib}">
<include name="catalina-ant.jar"/>
</fileset>
</path>
Run Code Online (Sandbox Code Playgroud)
在build.properties中声明$ {appserver.lib}:
appserver.home=${env.CATALINA_HOME}
appserver.lib=${appserver.home}/lib
deploy.path=${appserver.home}/webapps
Run Code Online (Sandbox Code Playgroud)
与envvar相呼应:
bash-3.1$ echo $CATALINA_HOME
C:\Program Files\Tomcat
Run Code Online (Sandbox Code Playgroud)
两大问题:
仍然试图做出无可救药的过时官方春季教程的正面或反面.
这一次,这是主题中的错误:
c:\Users\mkumpan\Projects\Spring testing\build.xml:152: java.lang.NoClassDefFoundError: org/apache/tomcat/util/codec/binary/Base64
<stack trace dump omitted>
Run Code Online (Sandbox Code Playgroud)
这个类实际上包含在tomcat-util.jar中:
bash-3.1$ pwd
/c/Program Files/Tomcat/lib
bash-3.1$ jar -tf ./tomcat-util.jar | grep Base64
org/apache/tomcat/util/codec/binary/Base64.class
Run Code Online (Sandbox Code Playgroud)
而且我非常确定我将它包含在build.xml中:
<fileset dir="${appserver.home}/bin">
<include name="*.jar"/>
</fileset>
Run Code Online (Sandbox Code Playgroud)
我甚至试图更明确:
<fileset dir="C:\Program Files\Tomcat\lib\" includes="tomcat-util.jar">
Run Code Online (Sandbox Code Playgroud)
什么都行不通,每次我尝试运行任何与tomcat相关的目标时,我仍然会收到该消息.也许某人可以提出一系列调查建议吗?
谷歌似乎没有提供任何相关的东西.
更新: 下面提供的完整的主类路径引用.
<path id="master-classpath">
<fileset dir="${web.dir}/WEB-INF/lib">
<include name="*/*.jar"/>
</fileset>
<fileset dir="${appserver.lib}">
<include name="*.jar"/>
</fileset>
<fileset dir="${appserver.home}/bin">
<include name="*.jar"/>
</fileset>
<pathelement path="${build.dir}"/>
</path>
Run Code Online (Sandbox Code Playgroud) 我试图在Java中使用它们之后弄清楚线程并且我有点困惑.两个问题:
任何正确方向的刺激都将非常感激.
我该如何解释这条消息?
src/CHandler.h:27:9: error: 'thread' in namespace 'std' does not name a type
std::thread _thread;
^
Run Code Online (Sandbox Code Playgroud)
这是我尝试扩展线程:
src/CHandler.h:17:30: error: expected class-name before '{' token
class CHandler : std::thread {
^
Run Code Online (Sandbox Code Playgroud)
完整,麻烦的标题:
#ifndef __projectm__CHandler__
#define __projectm__CHandler__
#include <set>
#include <vector>
#include <thread>
#include "CListener.h"
class CHandler {
public:
virtual bool subscribe(std::shared_ptr<CListener> aListener);
virtual bool unsubscribe(std::shared_ptr<CListener> aListener);
virtual bool hasSubscriber(std::shared_ptr<CListener> aListener);
virtual ~CHandler() {}
protected:
std::thread _thread;
std::vector<std::weak_ptr<CListener> > _subscribers;
std::set<const CListener *> _subscribersSet;
virtual void …Run Code Online (Sandbox Code Playgroud) 如何使用sql加入视图?我现在正在使用Oracle?
Sql视图1
CREATE VIEW florence_staff AS
SELECT *
FROM staff
WHERE libname ='florence'
Run Code Online (Sandbox Code Playgroud)
Sql视图2
CREATE VIEW alexandria_staff AS
SELECT *
FROM staff
WHERE libname ='alexandria'
Run Code Online (Sandbox Code Playgroud)
我这样做是为了检查碎片是否正确,如果你理解我的意思.谢谢 :))
代码尽可能简单,但我似乎遇到了编译器错误.我错过了什么?
作为旁注,_name完全删除字段只会在下一个字段上生成相同的错误.
PS:期待在这一个上有相当多的减号票,感觉我错过了一些非常简单的东西.
package mkumpan.helpers;
public final class BotState
{
private final String _name;
private final double _x;
private final double _y;
private final double _energy;
private final double _heading;
private final double _velocity;
public BotState(
String name,
double x,
double y,
double energy,
double heading,
double velocity
) {
String _name = name;
double _x = x;
double _y = y;
double _energy = energy;
double _heading = heading;
double _velocity = velocity;
} // BotState.java:26: error: …Run Code Online (Sandbox Code Playgroud)