创建新项目时,需要设置archetypeArtifactId.有人知道这个元素的含义吗?
我在两台机器 - 我的笔记本电脑和台式机上工作我的学校项目.最近我开始使用subclipse进行版本控制,并在两台机器上插入Eclipse.
在单台计算机上工作时,我了解结帐/提交过程并在"团队同步"选项卡中进行同步.
那么,如何在subclipse中更新其他机器的工作副本而不必检查并覆盖本地机器上的整个项目?
我有一个依赖于几个库的Java项目,这些库作为JAR文件分发.当我构建我的项目时,我最终myProject.jar得到一个lib文件夹,其中包含我使用的每个库的JAR文件.
为了分发我的项目,我想我可以拉上整个dist文件夹,但这不是很干净.
而不是为包含库的每个平台(.app对于Mac,.exe对于Windows,...)制作单独的可执行文件,是否有办法制作可以分发的单个跨平台文件(最好是JAR)?
谢谢!
我正在运行jboss,尝试将其绑定到特定地址.我的命令行如下:
./run.sh -b 192.168.99.3 -c temp-config
Run Code Online (Sandbox Code Playgroud)
这给了我以下错误:
15:27:54,178 INFO [ServerInfo] VM arguments: -Dprogram.name=runzing.sh -XX:+DisableExplicitGC -server -Xms31G -Xmx31G -PX:ARTAPort=
50001 -XX:GenPauselessNewThreads=3 -XX:GenPauselessOldThreads=3 -XX:+KeepSafepointsInCountedLoops -XX:+Log4J12Optimized -XX:+UseLock
edCollections -Djava.net.preferIPv4Stack=true -Xloggc:zingtest5.log -verbose:gc -XX:+PrintGCTimeStamps -Djava.net.preferIPv4Stack=tr
ue -Djava.library.path=/solaiemes/mss-1.7.0-SNAPSHOT-1109290403.ejb3.cl.ws.hb/bin/META-INF/lib/linux2/x64 -Djava.endorsed.dirs=/sola
iemes/mss-1.7.0-SNAPSHOT-1109290403.ejb3.cl.ws.hb/lib/endorsed
15:27:54,195 INFO [JMXKernel] Legacy JMX core initialized
15:27:54,930 INFO [ProfileServiceBootstrap] Loading profile: ProfileKey@4c78ca88[domain=default, server=default, name=cazahib]
15:27:55,601 ERROR [AbstractKernelController] Error installing to Start: name=jboss:service=WebService state=Create mode=Manual requ
iredState=Installed
java.lang.Exception: Port 8083 already in use.
at org.jboss.web.WebServer.start(WebServer.java:233)
at org.jboss.web.WebService.startService(WebService.java:322)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:376)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:322)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) …Run Code Online (Sandbox Code Playgroud) 我目前正在重构一些旧代码.我正在寻找有关最佳设计模式的说明.我在考虑工厂模式,但我不确定这是不是最好的方式.
所以这里是伪代码的简要概述.Foo类具有核心业务逻辑.
Class Foo{
private List<Things> stuff;
private static Integer count;
//getter setter for stuff
public Foo(List<Things> stuff){
this.stuff = stuff;
this.count=1;
}
//the following 3 methods are 90% similar
public List<Newthings> doSomeThingFirst(){
//uses the list stuff and also increments the static member count for each entry in List<NewThings> based on certain conditions
}
public List<Newthings> doSomethingSecond(){
//uses the list stuff and also increments the static member count for each entry in List<NewThings> based on certain conditions
}
public List<Newthings> …Run Code Online (Sandbox Code Playgroud) 我有这个:
for(int i=0;i<5;i++){
lbl1.setText(""+tarningar[i]);
Run Code Online (Sandbox Code Playgroud)
现在我想将lbl1更改为lbl + i ..所以它打印出lbl0,lbl1,lbl2,lbl3,lbl4.
我怎样才能做到这一点?
执行"mvn clean package"后出现此错误:
[错误]无法在项目webapp1上执行目标org.apache.maven.plugins:maven-war-plugin:2.1.1:w ar(default-war):组装WAR时出错:需要webxml属性(或预先存在如果在更新模式下执行,则为WEB-INF/web.xml) - > [帮助1]
此maven Web应用程序通过Eclipse(运行方式/在服务器上运行)顺利运行.
我正在使用Tomcat 6.0.32,我正在尝试将JSP文件包含到另一个中,但不知何故找不到该文件(是的,该文件存在).这是文件结构和代码:
<jsp:include page="${pageContext.request.contextPath}/templates/header.jsp">
</jsp:include>
WebContent
- folder/caller.jsp
- templates/header.jsp
Run Code Online (Sandbox Code Playgroud)
但是,如果我在其外部使用$ {pageContext.request.contextPath}来检查它是否输出正确,它可以工作,有人知道为什么会发生这种情况吗?
目前我的代码导致间歇性的ConcurrentModificationException错误,可能是因为我循环遍历HashMap的方式:
for (Map.Entry<String, Entity> entry : entities.entrySet()) {
String key = entry.getKey();
Entity item = entry.getValue();
if (item.isDestroyed()){
entities.remove(key);
ViewManager.getInstance().removeItem(key);
//INSTRUCT THE ENTITY TO PERFORM IT'S DESTROYED BEHAVIOR item.Destroyed()
} else {
item.update(1);
ConsoleItem ci = new ConsoleItemImpl(item.getIdentifier(), item.getLocation(), ColorStringConverter.getInstance().StringToColor(item.getSide()), item.getAngle(), item.getShape(), item.toString(), item.isDestroyed(), item.isDamaged());
ViewManager.getInstance().updateItem(ci);
}
item.update(1);
}
// updateInfo call
ViewManager.getInstance().updateInfo(summary());
}
Run Code Online (Sandbox Code Playgroud)
如何通过HashMap连续循环并避免出现ConcurrentModificationException错误?
我们使用 jBoss 日志记录并让它最终工作 - 现在我们遇到了问题,我们不想在每次出现错误时发送电子邮件。如果抛出定义的异常,我们只想发送一封电子邮件。例如 com.myproject.exceptions.fatal.ProjectFatalException
“jboss-logging.xml”中的默认定义如下所示:
<log4j-appender name="SMTP" class="org.apache.log4j.net.SMTPAppender">
<error-manager>
<only-once/>
</error-manager>
<level name="ERROR"/>
<properties>
<property name="to">admin@myhost.domain.com</property>
<property name="from">nobody@myhost.domain.com</property>
<property name="subject">JBoss Sever Errors</property>
<property name="SMTPHost">localhost</property>
<property name="bufferSize">10</property>
</properties>
<formatter>
<pattern-formatter pattern="%d %-5p [%c] (%t) %m%n"/>
</formatter>
</log4j-appender>
Run Code Online (Sandbox Code Playgroud)