小编And*_*rdi的帖子

Response.redirect引发"线程被中止"

当我需要从DB中删除对象时,我调用了一个VB.NET代码.在Page_load上,我检查它是否没有回发(以防止手动刷新),并且在删除对象后,我使用Response.redirect重定向到调用者页面.此时我的代码提出了一个问题

异常:EXCEPTION OCCURS在File_delete.aspx.vb中行号:34错误消息:正在中止线程.

并且,在事件查看器上,我可以看到aspnet_wp.exe崩溃:

aspnet_wp.exe(PID:1532)意外停止.

有关详细信息,请参阅http://go.microsoft.com/fwlink/events.asp上的"帮助和支持中心" .

目前尚不清楚为什么这只发生在这里,因为我也使用response.redirect来查看文件,而不仅仅是删除它.

vb.net iis

43
推荐指数
3
解决办法
5万
查看次数

无法在iPhone设备上加载nib

我正在尝试测试我正在iPhone上开发的应用.为此,我在Xcode上将目标从Simulator更改为Device.应用程序已正确上载到设备并且可以正常运行.显示主视图,但如果我尝试打开辅助视图,应用程序崩溃.

在iPhone日志上(我安装了iPhone配置实用程序以查看控制台[是从iPhone查看日志的唯一方法吗?])我可以看到此错误:

Could not load NIB in bundle
Run Code Online (Sandbox Code Playgroud)

但是,在模拟器上它工作正常.怎么了?有任何想法吗?

iphone ios4

25
推荐指数
6
解决办法
4万
查看次数

关闭后连接仍然空闲

我有一个C#客户端应用程序需要每15分钟检查一次Postgres数据库上的表.问题是我需要将此客户端安装到或多或少200个客户端,因此我需要在查询后关闭数据库连接.

我使用.Close()方法但是,如果我检查Postgres DB上的pg_stat_activity表,我可以看到连接仍处于IDLE状态.我该如何解决这个问题?是否有可能完全关闭连接?

谢谢,安德烈

c# postgresql npgsql

15
推荐指数
1
解决办法
5779
查看次数

如何在延迟后从一个活动重定向到另一个活动

我正在开发一个Android应用程序.在此应用程序中,我希望在4秒后自动从一个活动转换到另一个活动.没有按钮,我不知道怎么做.

android

13
推荐指数
1
解决办法
3万
查看次数

关于Spring应用程序的单点登录

我正在Linux服务器上使用Tomcat下的Web应用程序,所有客户端都在Windows域下.我需要从请求中获取用户帐户,以便为我的应用程序分配正确的角色.总而言之,我只需要检索用户帐户,因为不需要身份验证.

什么是更容易的框架或解决方案呢?Jaas可能是解决方案吗?

请问你能帮帮我吗?

谢谢,
安德烈

java spring spring-security

8
推荐指数
1
解决办法
2万
查看次数

Spring 3.1.1和Cache配置问题

我正在测试Spring缓存,这是我的上下文文件

<beans xmlns="http://www.springframework.org/schema/beans" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:cache="http://www.springframework.org/schema/cache"
    xsi:schemaLocation=
    "http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache.xsd">

    <cache:annotation-driven cache-manager="simpleCacheManager"/>

    <bean id="simpleCacheManager" class="org.springframework.cache.support.SimpleCacheManager">
        <property name="caches">
            <set>
                <bean class="org.springframework.cache.concurrent.ConcurrentCacheFactoryBean">
                    <property name="name" value="alfresco"/>
                </bean> 
                <bean class="org.springframework.cache.concurrent.ConcurrentCacheFactoryBean">
                    <property name="name" value="alfresco_article"/>
                </bean> 
                <bean class="org.springframework.cache.concurrent.ConcurrentCacheFactoryBean">
                    <property name="name" value="alfresco_action"/>
                </bean>
            </set>
        </property>
    </bean>
Run Code Online (Sandbox Code Playgroud)

我添加了所有必需的库但是,我无法验证库,因为Eclipse仍然告诉我AOPAlliance.jar和org.springframework.context-3.1.1.RELEASE.jar缺失.

错误是:

在此行找到多个注释:找不到类org.springframework.cache.concurrent.ConcurrentCacheFactoryBean.

已解决更改为org.springframework.cache.concurrent.ConcurrentMapCacheFactoryBean

但是,调用url会发生这种情况:

org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [configuration-context.xml]; nested exception is java.lang.NoClassDefFoundError: org/springframework/aop/config/AopNamespaceUtils
    org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:894)
    org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

root cause

org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from …
Run Code Online (Sandbox Code Playgroud)

java eclipse spring caching java-ee

8
推荐指数
1
解决办法
6944
查看次数

来自摄像头的可可捕获帧

我正在实施一个软件来从网络摄像头获取视频.我在Apple Dev中看过MyRecorder示例,它运行正常.

我尝试使用以下代码添加一个按钮从视频拍摄快照:

- (IBAction)addFrame:(id)sender
{
    CVImageBufferRef imageBuffer;
    @synchronized (self) {
        imageBuffer = CVBufferRetain(mCurrentImageBuffer);
    }
    if (imageBuffer) { 
    [ bla bla bla ]     
    }
}
Run Code Online (Sandbox Code Playgroud)

但是mCurrentImageBuffer总是空的.如何从我的网络摄像头获取当前帧并放入mCurrentImageBuffer?

我试过用

(void)captureOutput:(QTCaptureOutput *)captureOutput 
                    didOutputVideoFrame:(CVImageBufferRef)videoFrame 
                    withSampleBuffer:(QTSampleBuffer *)sampleBuffer 
                    fromConnection:(QTCaptureConnection *)connection
{
    CVImageBufferRef imageBufferToRelease;

    CVBufferRetain(videoFrame);

    @synchronized (self) {
        imageBufferToRelease = mCurrentImageBuffer;
        mCurrentImageBuffer = videoFrame;
    }
    CVBufferRelease(imageBufferToRelease);  
} 
Run Code Online (Sandbox Code Playgroud)

但它永远不会被召唤.我怎样才能决定何时调用captureOutput委托方法?任何的想法?

谢谢,安德烈

macos cocoa video-capture objective-c

7
推荐指数
1
解决办法
8426
查看次数

使用Spring4找不到MappingJacksonHttpMessageConverter

我将我的Spring框架从3.x迁移到4.2.RELEASE但是,当我启动jUnit时,我收到此错误:

Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from URL [file:src/test/resources/applicationContext.xml]; nested exception is java.lang.NoClassDefFoundError: org/springframework/http/converter/json/MappingJacksonHttpMessageConverter  
Run Code Online (Sandbox Code Playgroud)

我从4.1版开始在互联网上阅读.它不再受支持了; 我检查过,新版本在应用程序类路径上可用(我导入了spring-web依赖项).(Spring 4和Rest WS集成)

看来春天还在寻找老版本的Converter.它可能取决于我在我的应用程序上下文中的一些东西,但问题是,我如何"告诉Spring"使用新版本?

- 更新
我评论道

<mvc:annotation-driven />
Run Code Online (Sandbox Code Playgroud)

它似乎工作正常但是......为什么?

java spring spring-4

7
推荐指数
1
解决办法
1万
查看次数

使用MockMvc获取httpServletRequest属性

我有一个非常简单的控制器以这种方式定义:

@RequestMapping(value = "/api/test", method = RequestMethod.GET, produces = "application/json")
public @ResponseBody Object getObject(HttpServletRequest req, HttpServletResponse res) {
    Object userId = req.getAttribute("userId");
    if (userId == null){
        res.setStatus(HttpStatus.BAD_REQUEST.value());
    }
    [....]
}
Run Code Online (Sandbox Code Playgroud)

我尝试以许多不同的方式使用MockMvc调用,但是,我无法提供属性"userId".

例如,有了它,它不起作用:

MockHttpSession mockHttpSession = new MockHttpSession(); 
mockHttpSession.setAttribute("userId", "TESTUSER");             
mockMvc.perform(get("/api/test").session(mockHttpSession)).andExpect(status().is(200)).andReturn(); 
Run Code Online (Sandbox Code Playgroud)

我也试过这个,但没有成功:

MvcResult result = mockMvc.perform(get("/api/test").with(new RequestPostProcessor() {
     public MockHttpServletRequest postProcessRequest(MockHttpServletRequest request) {
           request.setParameter("userId", "testUserId");
           request.setRemoteUser("TESTUSER");
           return request;
     }
})).andExpect(status().is(200)).andReturn(); 
Run Code Online (Sandbox Code Playgroud)

在这种情况下,我可以设置RemoteUser但不能在HttpServletRequest上设置Attributes映射.

任何线索?

java junit spring spring-mvc mockmvc

7
推荐指数
1
解决办法
6180
查看次数

hide()vs hide("slow")

我需要隐藏一个div,使用此代码它可以正常工作:

    var idObj = $(this).attr('key');
var valH = $(this).attr('hideval');
var valS = $(this).attr('showval');

if ($('div[name='+idObj+']').attr('isdisplay') == 'no') {
    $('div[name='+idObj+']').children().show("slow");
    $('div[name='+idObj+']').attr('isdisplay','yes');
    var divTitle = $('div[name='+idObj+']').children().first();
    var divArrow = $(this).children().first();
    //.attr('src',prefixImg+valH);

    //divTitle.show();
    //divArrow.show();
    $(this).children().first().attr('src',prefixImg+valH);
} else {

    var divTitle = $('div[name='+idObj+']').children().first();
    var divArrow = $('div[name='+idObj+']').children().last();
    //.attr('src',prefixImg+valS);

    $('div[name='+idObj+']').children().hide();
    $('div[name='+idObj+']').attr('isdisplay','no');

    divTitle.show();
    divArrow.show();
    $(this).children().first().attr('src',prefixImg+valS);
}
Run Code Online (Sandbox Code Playgroud)

隐藏了我的div,并显示了重新打开div的标题和箭头.但是如果我尝试使用hide("slow"),当div关闭时divTitle和divArrow就不会出现.使用hide(1000)的相同问题.

隐藏有没有"慢"参数之间有区别吗?

谢谢,安德烈

html javascript jquery

6
推荐指数
2
解决办法
1544
查看次数