我对网络上的Spring和Java都很新,但是周末我一直在努力解决这个问题.将所有配置组合在一起并使Spring在IntelliJ上使用gradle本身就是一个挑战.
我正在尝试在Spring中实现我的另一个项目,以便我可以更好地理解如何使用它.
我整个上午都收到了这个错误,我在Spring上经历了很多参考和指南,但我无法看到问题所在.
引起:org.springframework.beans.factory.BeanCreationException:无法自动装配字段:private demo.models.company.CompanyService demo.models.company.CompanyController.companyService; 嵌套异常是org.springframework.beans.factory.BeanCreationException:在URL [jar:file:/Users/user/Documents/Project/demo/build/libs/demo-0.1.0]中定义了名为'companyServiceImpl'的bean创建错误. jar!/demo/models/company/CompanyServiceImpl.class]:bean的初始化失败; 嵌套异常是java.lang.NoClassDefFoundError:org/aspectj/util/PartialOrder $ PartialComparable
我的服务 -
public interface CompanyService {
public Company create(Company company);
public Company delete(Long id) throws CompanyNotFoundException;
public List<Company> findAll();
public Company update(Company company) throws CompanyNotFoundException;
public Company findById(Long id);
}
Run Code Online (Sandbox Code Playgroud)
我的实施 -
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import demo.exceptions.CompanyNotFoundException;
import javax.annotation.Resource;
import java.util.List;
@Service
public class CompanyServiceImpl implements CompanyService {
@Resource
private CompanyRepository companyRepository;
.....
}
Run Code Online (Sandbox Code Playgroud)
我的控制器 -
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.List;
@Controller …Run Code Online (Sandbox Code Playgroud) 我已经在一个流浪汉机器中提到了一个带有elasticsearch的graylog2服务器,并且我有正确版本的ElasticSearch.
我还根据教程为Graylog2和ElasticSearch添加了正确的选项.
ERROR: Could not successfully connect to ElasticSearch. Check that your cluster state is not RED and that ElasticSearch is running properly.
Need help?
* Official documentation: http://support.torch.sh/help/kb
* Mailing list: http://support.torch.sh/help/kb/general/forums-mailing-list
* Issue tracker: http://support.torch.sh/help/kb/general/issue-trackers
* Commercial support: http://www.torch.sh/
But we also got some specific help pages that might help you in this case:
* http://support.torch.sh/help/kb/graylog2-server/configuring-and-tuning-elasticsearch-for-graylog2-v0200
Terminating. :(
Run Code Online (Sandbox Code Playgroud)
我运行时仍然遇到错误:
sudo java -jar /opt/graylog2-server/graylog2-server.jar --debug
Run Code Online (Sandbox Code Playgroud)
我还检查过ElasticSearch运行正常 -
central@central:~$ curl -XGET 'http://127.0.0.1:9200/_cluster/health?pretty=true'
{
"cluster_name" …Run Code Online (Sandbox Code Playgroud) 我是否可以使用Amazon PHP SDK根据消息ID从SQS队列中获取消息?我是否只需要获取队列中的所有消息,然后在服务器上对其进行过滤?
我的服务器收到一个带有队列消息ID的SNS发起的请求,我不得不从SQS的一系列消息中过滤出该消息。
我有一个生成Box div的指令.
<box index=0></box>
<box index=1></box>
Run Code Online (Sandbox Code Playgroud)
app.controller('BoxController', ['$scope', function ($scope) {
$scope.boxIndex = false;
}]);
app.directive('box', function () {
return {
restrict: 'E',
templateUrl: '/partials/_box.html',
link: function (scope, element, attrs) {
scope.boxIndex = attrs.index;
}
}
});
Run Code Online (Sandbox Code Playgroud)
<div class="box{{boxIndex}}"></div>
Run Code Online (Sandbox Code Playgroud)
我得到了输出
<div class="box1"></div>
<div class="box1"></div>
Run Code Online (Sandbox Code Playgroud)
代替
<div class="box0"></div>
<div class="box1"></div>
Run Code Online (Sandbox Code Playgroud)
我还应该做些什么来使两个实例分开吗?
Python 有没有办法做到
new_list = [x for x in items]
Run Code Online (Sandbox Code Playgroud)
(列表理解)字典?就像是
new_dict = [x=>y for x, y in items.iteritems()]
Run Code Online (Sandbox Code Playgroud)
这样我得到
{x: y}
Run Code Online (Sandbox Code Playgroud) 经过很长一段时间的项目后,我再次与C合作,并试图了解可变功能.基本上,我希望能够将多个字符串传递给函数.
#include<stdarg.h>
int main(int argc, const char * argv[])
{
test_function(2,"test","test2");
test_function(4,"test3","test4","test5","test6");
return 0;
}
void test_function(int args, ...)
{
va_list ap;
va_start(ap, args);
int i;
for(i=0;i<args;i++)
{
printf("Argument:%s\n",va_arg(ap, char*));
}
va_end(ap);
}
Run Code Online (Sandbox Code Playgroud)
我在test_function周围出现错误 - 'test_function'的冲突类型
谁能指出我的错误?
amazon-sqs ×1
angularjs ×1
c ×1
dictionary ×1
graylog2 ×1
hibernate ×1
java ×1
javascript ×1
python ×1
spring ×1