Bug 751101

Summary: Runtime Error org.mozilla.javascript.UniqueTag cannot be cast to org.mozilla.javascript.Function
Product: [Community] Candlepin Reporter: Lukas Zapletal <lzap>
Component: candlepinAssignee: Bryan Kearney <bkearney>
Status: CLOSED DUPLICATE QA Contact: John Sefler <jsefler>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 0.5CC: dgoodwin
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Solaris   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-11-07 13:55:33 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Lukas Zapletal 2011-11-03 14:28:14 UTC
When registering rhsm against Katello proxy to Candlepin (loaded with a fake certificates from 

http://git.fedorahosted.org/git/?p=katello.git;a=tree;f=cli/test-system;h=528354cc813500ee274f21362827558255cf7dbe;hb=HEAD

I am having this strange error:

2011-11-03 09:04:01,734 [ERROR]  @managercli.py:66 - Runtime Error org.mozilla.javascript.UniqueTag cannot be cast to org.mozilla.javascript.Function at org.fedoraproject.candlepin.policy.js.JsRules.init:64
Traceback (most recent call last):
  File "/usr/share/rhsm/subscription_manager/managercli.py", line 713, in _do_command
    managerlib.unregister(self.cp, consumer)
  File "/usr/share/rhsm/subscription_manager/managerlib.py", line 782, in unregister
    uep.unregisterConsumer(consumer_uuid)
  File "/usr/lib/python2.6/site-packages/rhsm/connection.py", line 495, in unregisterConsumer
    return self.conn.request_delete(method)
  File "/usr/lib/python2.6/site-packages/rhsm/connection.py", line 267, in request_delete
    return self._request("DELETE", method)
  File "/usr/lib/python2.6/site-packages/rhsm/connection.py", line 222, in _request
    self.validateResponse(result)
  File "/usr/lib/python2.6/site-packages/rhsm/connection.py", line 242, in validateResponse
    raise RestlibException(response['status'], error_msg)
RestlibException: Runtime Error org.mozilla.javascript.UniqueTag cannot be cast to org.mozilla.javascript.Function at org.fedoraproject.candlepin.policy.js.JsRules.init:64

OS: EL 6.1

Comment 1 Lukas Zapletal 2011-11-04 08:59:33 UTC
java.lang.ClassCastException: org.mozilla.javascript.UniqueTag cannot be cast to org.mozilla.javascript.Function
        at org.fedoraproject.candlepin.policy.js.JsRules.init(JsRules.java:64)
        at org.fedoraproject.candlepin.policy.js.JsRules.reinitTo(JsRules.java:81)
        at org.fedoraproject.candlepin.policy.js.entitlement.AbstractEntitlementRules.preUnbind(AbstractEntitlementRules.java:387)
        at org.fedoraproject.candlepin.policy.EnforcerDispatcher.preUnbind(EnforcerDispatcher.java:84)
        at org.fedoraproject.candlepin.controller.CandlepinPoolManager.removeEntitlement(CandlepinPoolManager.java:609)
        at org.fedoraproject.candlepin.controller.CandlepinPoolManager$$EnhancerByGuice$$eea63b03.CGLIB$removeEntitlement$18(<generated>)
        at org.fedoraproject.candlepin.controller.CandlepinPoolManager$$EnhancerByGuice$$eea63b03$$FastClassByGuice$$dc89b06c.invoke(<generated>)
        at com.google.inject.internal.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
        at com.google.inject.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:64)
        at com.wideplay.warp.persist.jpa.JpaLocalTxnInterceptor.invoke(JpaLocalTxnInterceptor.java:58)
        at com.google.inject.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:64)
        at com.google.inject.InterceptorStackCallback.intercept(InterceptorStackCallback.java:44)
        at org.fedoraproject.candlepin.controller.CandlepinPoolManager$$EnhancerByGuice$$eea63b03.removeEntitlement(<generated>)
        at org.fedoraproject.candlepin.controller.CandlepinPoolManager.revokeEntitlement(CandlepinPoolManager.java:655)
        at org.fedoraproject.candlepin.controller.CandlepinPoolManager$$EnhancerByGuice$$eea63b03.CGLIB$revokeEntitlement$3(<generated>)

Comment 2 Devan Goodwin 2011-11-07 13:55:33 UTC
I believe this is a duplicate, the issue is an export file generated on an older version of Candlepin than the new one you are importing into. I think the import succeeds, but as soon as something tries to run the rules you get this error.


We don't yet know how to solve, but the workaround is to generate a new export on a newer candlepin.

Closing as a dupe.

*** This bug has been marked as a duplicate of bug 743968 ***