我从ESLint收到此错误:
error Parsing error: The keyword 'const' is reserved
Run Code Online (Sandbox Code Playgroud)
从这段代码:
const express = require('express');
const app = express();
const _ = require('underscore');
Run Code Online (Sandbox Code Playgroud)
我已经尝试删除node_modules
并重新安装所有npm软件包(如此处所示),但无济于事.
我正在尝试使用util-constant for ioc但是我收到以下错误消息:
cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'util:constant'.
所有的spring 3.1.1 dist jar都在我的类路径中,我能够在进行包含使用util:constant标记的更改之前成功运行我的程序.
这是我的ioc xml文件:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:tool="http://www.springframework.org/schema/tool"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd">
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<value>classpath:config.properties</value>
</property>
</bean>
<bean id="main" class="pikefin.Main">
<property name="executorSample" ref="executorSample"/>
</bean>
<bean id="executorSample" class="pikefin.ExecutorSample">
<constructor-arg ref="threadPoolExecutor" />
</bean>
<bean id="threadPoolExecutor" class="java.util.concurrent.ThreadPoolExecutor">
<constructor-arg index="0" value="2"/>
<constructor-arg index="1" value="2"/>
<constructor-arg index="2" value="10"/>
<constructor-arg index="3"><util:constant static-field="java.util.concurrent.TimeUnit.SECONDS"/></constructor-arg>
<constructor-arg index="4" ref="arrayBlockingPool"/>
</bean>
<bean id="arrayBlockingPool" class="java.util.concurrent.ArrayBlockingQueue">
<constructor-arg value="5"/>
</bean>
</beans>
Run Code Online (Sandbox Code Playgroud) 我有一个ant构建脚本,它有一个相当复杂的<exec>
命令,有许多<arg>
标签,我正在尝试进行故障排除.我想知道在构建它之后是否可以查看整个命令行; 要么在eclipse调试器中,要么可以将其转储到文件中.
这是我正在处理的事情:
<exec executable='"@{sdk}/bin/mxmlc.exe"' failonerror="true" >
<arg line='-load-config "@{sdk}/frameworks/flex-config.xml"'/>
<!-- Flex Build Path -->
<!-- Source path -->
<!-- Main source folder: -->
<arg line='-compiler.source-path "@{project-dir}/src"'/>
<!-- Additional source folders outside of the main source folder: -->
<arg line='-compiler.source-path "@{project-dir}/inc/swf"'/>
<arg line='-compiler.source-path "@{project-dir}/inc/images"'/>
<!-- Output folder: -->
<arg line='-output "@{output}"'/>
<!-- Library path -->
<!-- Build path libraries: -->
<arg line='-compiler.library-path "@{libs}"'/>
<arg line='-compiler.library-path "@{sdk}/frameworks/libs"'/>
<arg line='-compiler.library-path "@{sdk}/frameworks/locale/en_US"'/>
<arg line='-compiler.library-path "${dcradswcs.flex.path}/libs"'/>
<arg line='-compiler.library-path "${dcradswcs.flex.path}/locale"'/>
<arg …
Run Code Online (Sandbox Code Playgroud) 我正在逐步完成本教程:http: //www.eclipse.org/webtools/community/tutorials/BottomUpAxis2WebService/bu_tutorial.html
我正在尝试选择axis2 Web Service方面(步骤6),但我在eclipse中收到此错误消息:"Axis2 Web Services Core 1.1需要动态Web模块,版本匹配表达式为"2.2,2.3,2.4,2.5"
更新:我已经下载并安装了axis2 1.5.4然后在eclipse中我进入了"windows-> preferences-> web services-> axis2 preferences".在"axis2 runtime"选项卡下,我指定了axis2位置.出现"已成功加载Axis2运行时"消息.
我不知道为什么会说"Axis2 Web Services Core 1.1".eclipse wtp是否与axis2 1.1捆绑在一起,或者是整个轴版本#的轴芯是否有单独的版本#?
我正在尝试设置一个简单的spring应用程序,我得到以下异常.这是在eclipse indigo中独立运行的.
Exception in thread "main" org.springframework.beans.factory.BeanDefinitionStoreException: Line 2 in XML document from class path resource [context.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'beans'.
org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'beans'.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:318)
Run Code Online (Sandbox Code Playgroud)
这是我的代码的初始部分:
public static void main(String[] args) {
try {
BeanFactory beanfactory = new ClassPathXmlApplicationContext(
"context.xml");
FirstBean bean = (FirstBean) beanfactory.getBean("show");
Run Code Online (Sandbox Code Playgroud)
这是我的context.xml文件:
<?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:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
<bean id="anotherBean" …
Run Code Online (Sandbox Code Playgroud) 我在tomcat(版本7)中使用dbcp连接池,并且我的代码中有某个连接泄漏.在很短的时间之后,对新连接的请求将返回以下异常:
"无法获取连接,池错误超时等待空闲对象"
我回过头来看看我的代码,看起来所有的连接都被正确关闭了(并不是每个人都说这个......).
为了调试这个,我在context.xml中添加了以下属性:
logAbandoned="true" removeAbandoned="true" removeAbandonedTimeout="300"
Run Code Online (Sandbox Code Playgroud)
所以资源标签现在看起来像这样:
<Resource name="jdbc/findata" auth="Container" type="javax.sql.DataSource"
maxActive="20" maxIdle="5" maxWait="10000"
username="root" password="xxxxxx" driverClassName="com.mysql.jdbc.Driver"
logAbandoned="true" removeAbandoned="true" removeAbandonedTimeout="300"
url="jdbc:mysql://localhost:3306/findata"/>
Run Code Online (Sandbox Code Playgroud)
然后我重新启动了tomcat并开始点击网页,直到出现错误消息(在浏览器窗口中).但是我还没有弄清楚"logAbandoned"属性在哪里写信息.我正在寻找
/usr/share/apache-tomcat-7.0.11/logs
Run Code Online (Sandbox Code Playgroud)
但是那里唯一最近修改过的日志文件就是
localhost_access_log.2011-04-18.txt
Run Code Online (Sandbox Code Playgroud)
非常感谢任何帮助.
我有一个mysql表,其中有超过3000万条记录最初与myisam一起存储.这是表格的描述:
我将针对此表运行以下查询,通常需要大约30秒才能完成.我每次都会更改@eid以避免数据库或磁盘缓存.
select count(fact_data.id)
from fact_data
where fact_data.entity_id=@eid
and fact_data.metric_id=1
Run Code Online (Sandbox Code Playgroud)
然后我将此表转换为innoDB而不进行任何其他更改,之后相同的查询现在每次运行查询时返回一秒钟.即使我随机设置@eid以避免缓存,查询也会在一秒钟内返回.
我一直在研究这两种存储类型之间的差异,试图解释性能的显着改善,但却未能提出任何建议.事实上,我读到的大部分内容都表明Myisam应该更快.
我正在运行的查询是针对本地数据库的,在测试时没有其他进程访问数据库.
我正在使用以下函数来计算文件的校验和:
public static void generateChecksums(String strInputFile, String strCSVFile) {
ArrayList<String[]> outputList = new ArrayList<String[]>();
try {
MessageDigest m = MessageDigest.getInstance("MD5");
File aFile = new File(strInputFile);
InputStream is = new FileInputStream(aFile);
System.out.println(Calendar.getInstance().getTime().toString() +
" Processing Checksum: " + strInputFile);
double dLength = aFile.length();
try {
is = new DigestInputStream(is, m);
// read stream to EOF as normal...
int nTmp;
double dCount = 0;
String returned_content="";
while ((nTmp = is.read()) != -1) {
dCount++;
if (dCount % 600000000 == 0) {
System.out.println(". …
Run Code Online (Sandbox Code Playgroud) 在eclipse中开发java guis(例如swing)时,是否有内置功能(或插件)允许用户监控所有被触发的事件?
我正在尝试从此页面设置spring AOP示例:
http://www.javabeat.net/articles/51-introduction-to-springs-aspect-oriented-programminga-4.html
我正在使用Eclipse Indigo作为我的开发环境.
在这些方面:
public class LogAfterThrowsAdvice implements ThrowsAdvice{
public class LogAfterReturningAdvice implements AfterReturningAdvice{
public class LogBeforeCallAdvice implements MethodBeforeAdvice {
Run Code Online (Sandbox Code Playgroud)
我收到的消息是:
org.aopalliance.aop.Advice类型无法解析.它是从所需的.class文件间接引用的
我从这里下载了org.aopalliance包:
http://sourceforge.net/projects/aopalliance/
jar文件是aopalliance-alpha1.jar.它不包含路径org.aopalliance.aop.我想知道我是否应该使用不同的aopalliance jar文件?