出于某种原因,我无法使用HTTPS进行CURL.一切都很好,直到我运行curl库的升级.现在,我在尝试执行CURL请求时遇到此响应: SSL CA证书问题(路径?访问权限?)
根据此处发布的有关相关问题的建议,我尝试执行以下操作:
禁用主机和对等方的验证
curl_setopt($cHandler, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($cHandler, CURLOPT_SSL_VERIFYPEER, true);
Run Code Online (Sandbox Code Playgroud)启用CURLOPT_SSL_VERIFYPEER并指向从http://curl.haxx.se/docs/caextract.html下载的cacert.pem
curl_setopt($cHandler, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($cHandler, CURLOPT_CAINFO, getcwd() . "/positiveSSL.ca-bundle");
Run Code Online (Sandbox Code Playgroud)我还尝试使用positiveSSL.ca-bundle做同样的事情,它是作为我尝试连接的服务器的捆绑CA证书提供的.
使用curl.cainfo=cacert.pem(在同一目录中的文件并通过apache访问)编辑php ini设置
重命名/etc/pki/nssdb为/etc/pki/nssdb.old
不幸的是,以上都没有能够解决我的问题,我经常遇到SSL CA证书(路径?访问权限?)消息的问题.
我首先不需要这个验证(我知道安全问题).
有人有任何其他建议吗?
UPDATE
在更新到最新的库并重新启动整个盒子之后,不仅仅是我正在做的apache似乎现在再次正在工作!
我有一个定义继承的实体,如下所示:
* @DiscriminatorColumn(name="type", type="string")
* @DiscriminatorMap({"text" = "TextAttribute", "boolean" = "BooleanAttribute", "numeric" = "NumericAttribute", "date" = "DateAttribute"})
Run Code Online (Sandbox Code Playgroud)
我想知道是否有可能为田地'类型'吸气?我知道我可以使用instanceof(在大多数情况下这就是我正在做的事情)但是很少有场景,$ item-> getType()会让我的生活变得如此简单.
我正在测试extjs 4,我偶然发现了一些东西,我似乎无法弄明白.
我有简单的对象关联:快照 - hasMany - >模型
现在,我正在尝试使用XTemplate在View组件中显示这种关联,所以我的XTemplate看起来像这样:
Ext.create('Ext.XTemplate',
'<tpl for=".">',
'<div class="snapshot" id="{id}">',
'<h1>{snapshot}</h1>',
'<p><span class="label">Created: </span>{dateString}</p>',
'<p><span class="label">Models</span></p>',
'<tpl for="models">',
'<p>{name} - {description}</p>',
'</tpl>',
'</div>',
'</tpl>',
'<div class="x-clear bottompad"></div>'
);
Run Code Online (Sandbox Code Playgroud)
我的JSON响应看起来像这样(只显示'快照'节点):
{
"id": 1,
"snapshot": "Snapshot 1",
"created": 1305806847000,
"models": [
{
"id": 1,
"name": "ABC",
"description": "A B C"
}, {
"id": 111,
"name": "ABCDD",
"description": "A B C XCXC"
}
]
}
Run Code Online (Sandbox Code Playgroud)
由于extjs 4引入了Model I的概念,我已经为Snapshot和Model创建了模型,并根据API文档创建了关联.
快照模型:
Ext.define('Snapshot', {
extend: 'Ext.data.Model',
fields: [
{name: 'id', type: …Run Code Online (Sandbox Code Playgroud) 我有一个问题,理解为什么@Context依赖注入返回$ Proxy(随机数)实例的集合而不是HttpServletRequest或HttpServletResponse.
我正在使用Glassfish 3.1.2.2及其版本的Jersey(Jersey:1.11.1),我的应用程序是作为EAR应用程序构建的.
我有简单的@Remote接口,我在那里注释我的方法和REST服务没有任何问题,但是当我尝试访问HttpServletRequest信息时,它只会导致问题.
我在会话bean中有注释的私有字段:
@Context
private HttpServletRequest request;
@Context
private HttpServletResponse response;
Run Code Online (Sandbox Code Playgroud)
并创建方法签名以包含@Context作为参数集:
@POST
@Path("authenticate")
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
@Produces(MediaType.APPLICATION_JSON)
public Response authenticate(@FormParam("username") String username, @FormParam("password") String password, @Context HttpServletRequest request, @Context HttpServletResponse response);
Run Code Online (Sandbox Code Playgroud)
当我尝试在条目之后调试方法时,我可以看到全局请求和响应对象为null,其中本地方法实例是$ ProxyXXX类型.
问题是我无法访问(或者我不确定)这些对象.根据网络上的教程,我们应该可以使用它们,但是当我尝试访问这些时,会被抛出:
WARNING: StandardWrapperValve[RestDataService]: PWC1406: Servlet.service() for servlet RestDataService threw exception
java.lang.IllegalStateException: No thread local value in scope for proxy of class $Proxy245
at com.sun.jersey.server.impl.ThreadLocalInvoker.invoke(ThreadLocalInvoker.java:93)
at $Proxy245.getContextPath(Unknown Source)
Run Code Online (Sandbox Code Playgroud)
这就是我试图调用这些(在这个例子中我只是调用getContextPath)
@Override
public Response authenticate(String username, String password, HttpServletRequest request, HttpServletResponse response) {
System.out.println("just a test: …Run Code Online (Sandbox Code Playgroud) 当我从聚合物网站上关于自定义事件创建和委派(https://www.polymer-project.org/articles/communication.html)的示例时,我遇到了奇怪的行为.当标签发生变化时,我有聚合物标签触发我的自定义事件,现在我正在尝试我的另一个自定义元素来监听事件并做出反应,但是有一些我很明显缺少的事情,因为事件没有从内部被拾取ready()函数.但是,如果我将它绑定到窗口,我可以看到它没有任何问题,所以第二双眼睛将被赞赏:)
这是在更改选项卡时触发事件的自定义元素:
<polymer-element name="pm-tabmenu">
<template>
<style>
:host {
display:block;
}
</style>
<paper-tabs selected="1" id="tabmenu">
<paper-tab id="pm-tabmenu-all" state="all">All</paper-tab>
<paper-tab id="pm-tabmenu-wip" state="wip">In Progress</paper-tab>
<paper-tab id="pm-tabmenu-finished" state="finished">Finished</paper-tab>
</paper-tabs>
</template>
<script>
Polymer({
ready: function () {
var tabs = this.$.tabmenu;
tabs.addEventListener('core-select', function (event) {
if (event.detail.isSelected) {
this.fire("pmtabmenuselect", {
state: event.detail.item.getAttribute('state')
});
alert(event.detail.item.getAttribute('state'));
}
});
}
});
</script>
</polymer-element>
Run Code Online (Sandbox Code Playgroud)
这就是我想要在另一个自定义元素中捕获事件的方式:
<polymer-element name="pm-list">
<template>
<style>
:host {
display:block;
}
</style>
<h1> Current filter: {{filter}}</h1>
</template>
<script>
window.addEventListener('pmtabmenuselect', function (e) {
alert("This does fire"); …Run Code Online (Sandbox Code Playgroud) 我用@Singleton,@ Schedudu和@Timeout注释创建了一个简单的例子来试试它们是否可以解决我的问题.
场景是这样的:EJB每5秒调用一次'check'函数,如果满足某些条件,它将创建单个动作计时器,以异步方式调用一些长时间运行的进程.(这是一种队列实现类型的东西).然后它继续检查,但是在长时间运行的过程中,它不会启动另一个.
下面是我提出的代码,但是这个解决方案不起作用,因为它看起来像我正在制作的异步调用实际上阻止了我的@Schedule方法.
@Singleton
@Startup
public class GenerationQueue {
private Logger logger = Logger.getLogger(GenerationQueue.class.getName());
private List<String> queue = new ArrayList<String>();
private boolean available = true;
@Resource
TimerService timerService;
@Schedule(persistent=true, minute="*", second="*/5", hour="*")
public void checkQueueState() {
logger.log(Level.INFO,"Queue state check: "+available+" size: "+queue.size()+", "+new Date());
if (available) {
timerService.createSingleActionTimer(new Date(), new TimerConfig(null, false));
}
}
@Timeout
private void generateReport(Timer timer) {
logger.info("!!--timeout invoked here "+new Date());
available = false;
try {
Thread.sleep(1000*60*2); // something that lasts for a bit
} …Run Code Online (Sandbox Code Playgroud) java ×2
php ×2
curl ×1
doctrine ×1
doctrine-orm ×1
extjs ×1
extjs4 ×1
glassfish ×1
glassfish-3 ×1
https ×1
inheritance ×1
javascript ×1
jersey ×1
model ×1
polymer ×1
schedule ×1
ssl ×1
timer ×1