You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by "Lou Amodeo (JIRA)" <tu...@ws.apache.org> on 2007/01/12 16:22:27 UTC

[jira] Commented: (TUSCANY-1046) NPE in MemoryStore.insertRecord() when @SCOPE("CONVERSATION")

    [ https://issues.apache.org/jira/browse/TUSCANY-1046?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12464218 ] 

Lou Amodeo commented on TUSCANY-1046:
-------------------------------------

The ConversationalScopeContaier.getInstance() is not returning a conversationID.   There is an assertion in getConversationId() that for some reason does not surface an exception in the integration test environment or its being written to a log file I am not aware of. 

[INFO] [tuscany-itest:test {execution: test}]
[INFO] Executing tests...
Laa: getConversationId ==> null
Laa: Conversational Scope Container:getInstance():conversationID ==>null

@Override
    public Object getInstance(AtomicComponent component) throws TargetResolutionException {

        String conversationId = getConversationId();

        System.out.println("Laa: Conversational Scope Container:getInstance():conversationID ==>" + conversationId);

        try {
            workContext.setCurrentAtomicComponent(component);
            Object instance = nonDurableStore.readRecord(component, conversationId);
            if (instance != null) {
                if (component.getMaxIdleTime() > 0) {
                    // update expiration
                    long expire = System.currentTimeMillis() + component.getMaxIdleTime();
                    nonDurableStore.updateRecord(component, conversationId, instance, expire);
                }
            } else {
                instance = component.createInstance();
                long expire = calculateExpiration(component);
                nonDurableStore.insertRecord(component, conversationId, instance, expire);
                component.init(instance);
            }
            return instance;
        } catch (StoreReadException e) {
            throw new TargetResolutionException("Error retrieving target instance", e);
        } catch (StoreWriteException e) {
            throw new TargetResolutionException("Error persisting target instance", e);
        } finally {
            workContext.setCurrentAtomicComponent(null);
        }


> NPE in MemoryStore.insertRecord()  when @SCOPE("CONVERSATION")
> --------------------------------------------------------------
>
>                 Key: TUSCANY-1046
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1046
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SCA Integration Tests
>            Reporter: Lou Amodeo
>         Attachments: test-CallBackSetCallbackConv.zip
>
>
> r494421
> test-CallBackSetCallbackConv
> - This test attempts to use @Scope("CONVERSATION").  Upon launch of test case using integration test environment the 
>   following NPE occurs.     
> -------------------------------------------------------------------------------
> Test set: org.apache.tuscany.sca.test.CallBackSetCallbackConvITest
> -------------------------------------------------------------------------------
> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.02 sec <<< FAILURE!
> testCallBackSetCallback(org.apache.tuscany.sca.test.CallBackSetCallbackConvITest)  Time elapsed: 0.01 sec  <<< ERROR!
> java.lang.NullPointerException
> 	at java.util.concurrent.ConcurrentHashMap.hash(ConcurrentHashMap.java:172)
> 	at java.util.concurrent.ConcurrentHashMap.containsKey(ConcurrentHashMap.java:760)
> 	at org.apache.tuscany.core.services.store.memory.MemoryStore.insertRecord(MemoryStore.java:110)
> 	at org.apache.tuscany.core.component.scope.ConversationalScopeContainer.getInstance(ConversationalScopeContainer.java:92)
> 	at org.apache.tuscany.core.implementation.PojoAtomicComponent.getTargetInstance(PojoAtomicComponent.java:122)
> 	at org.apache.tuscany.core.implementation.java.JavaTargetInvoker.getInstance(JavaTargetInvoker.java:127)
> 	at org.apache.tuscany.core.implementation.java.JavaTargetInvoker.invokeTarget(JavaTargetInvoker.java:75)
> 	at org.apache.tuscany.spi.extension.TargetInvokerExtension.invoke(TargetInvokerExtension.java:67)
> 	at org.apache.tuscany.core.wire.InvokerInterceptor.invoke(InvokerInterceptor.java:44)
> 	at org.apache.tuscany.spi.wire.AbstractInboundInvocationHandler.invoke(AbstractInboundInvocationHandler.java:45)
> 	at org.apache.tuscany.core.wire.jdk.JDKInboundInvocationHandler.invoke(JDKInboundInvocationHandler.java:122)
> 	at $Proxy22.run(Unknown Source)
> 	at org.apache.tuscany.sca.test.CallBackSetCallbackConvITest.testCallBackSetCallback(CallBackSetCallbackConvITest.java:12)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org