Giter Club home page Giter Club logo

jain-slee's Introduction

jain-slee's People

Contributors

abhayani avatar anatolysatanovskiy-mobius avatar croufay avatar deruelle avatar emmartins avatar fossabot avatar gitter-badger avatar ivelin avatar jaimecasero avatar leedark avatar satanatoly avatar sergeylee avatar tuijldert avatar waffle-iron avatar yulianoifa-mobius avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jain-slee's Issues

[Twiddle] Command failure - "--nsrc" argument not detected

Hi,

When invoking the following twiddle command I get the following error.
The --nsrc argument is provided but Twiddle compains.

./twiddle.sh trace -g --nsrc=SbbNotification[service=ServiceID[name=...],sbb=SbbID[name=...]] --name=error        
14:18:37,698 ERROR [Twiddle] Command failure
org.jboss.console.twiddle.command.CommandException: Operation "getTraceLevel" for command: "trace", found unexpected opt: --nsrc=SbbNotification[service=ServiceID[name=...],sbb=SbbID[name=...]]
        at org.mobicents.tools.twiddle.jslee.TraceCommand$GetLevelOperation.buildOperation(TraceCommand.java:383)
        at org.mobicents.tools.twiddle.jslee.TraceCommand.processArguments(TraceCommand.java:177)
        at org.mobicents.tools.twiddle.AbstractSleeCommand.execute(AbstractSleeCommand.java:114)
        at org.jboss.console.twiddle.Twiddle.main(Twiddle.java:306)

Regards
Tomasz Krzysztof Zieleniewski

[Usage] Display proper value of sample attribute, rather than MIN/MAX

diff --git a/container/usage/src/main/java/org/mobicents/slee/runtime/usage/UsageParameter.java b/container/usage/src/main/java/org/mobicents/slee/runtime/usage/UsageParameter.java
index a5c2d99..ce946d0 100644
--- a/container/usage/src/main/java/org/mobicents/slee/runtime/usage/UsageParameter.java
+++ b/container/usage/src/main/java/org/mobicents/slee/runtime/usage/UsageParameter.java
@@ -47,6 +47,7 @@ public class UsageParameter implements Serializable {
// NOTE: it seems that javassit does some sort of magic here - cause with
// generated code and "long" tck passes ...
// private long value;

  •   private static final int NOT_INITIALIZED_VALUE=0;
    private BigDecimal value;
    private long min;
    private long max;
    

    @@ -78,6 +79,9 @@ public class UsageParameter implements Serializable {
    }

    public long getMin() {
    
  •           if(this.count == 0){
    
  •                   return NOT_INITIALIZED_VALUE;
    
  •           }
            return min;
    }
    

@@ -86,6 +90,9 @@ public class UsageParameter implements Serializable {
}

    public long getMax() {
  •           if(this.count == 0){
    
  •                   return NOT_INITIALIZED_VALUE;
    
  •           }
            return max;
    }
    

SLEE Console should configure RA Entity properties with Integer type

If you try configure RA Entity property with Integer type you get this exception:

Caused by: java.lang.IllegalArgumentException: Value is of type java.lang.String, required type is java.lang.Integer
at javax.slee.resource.ConfigProperties$Property.setValue(ConfigProperties.java:171)
at javax.slee.resource.ConfigProperties$Property.(ConfigProperties.java:133)
at org.mobicents.slee.container.management.console.server.PropertiesInfoUtils.toProperties(PropertiesInfoUtils.java:57)
at org.mobicents.slee.container.management.console.server.resources.ResourceServiceImpl.setResourceAdaptorEntityConfigurationProperties(ResourceServiceImpl.java:109)
...

Allow services to override classes offered from server(JBoss)

Current classloader structure doesnt allow services to override classes, even if they provide their own slee libs. For example a service may want to use a newer Hibernate version than the one provided by underlying server. Ideally, the service may define a list of packages detailing where the class loading order must be inverted, so classes provided from service are taken first...

[SBB Life cycle] Store and passivate SBB Entities

This issue is a new feature for SBB passivation in some use cases.

Now SBB passivation works only for sbbEntity when it is not null and its sbbObject is not null:

https://github.com/RestComm/jain-slee/blob/2.x/container/router/src/main/java/org/mobicents/slee/runtime/eventrouter/routingtask/EventRoutingTaskImpl.java#L540-L543

The solution is passivation of all SBB Entities in the transaction context if the sbbObject is not null.

...
sbbEntity.passivateAndReleaseSbbObject();

final Collection coll = txMgr.getTransactionContext().getData().keySet();
final SbbEntityID ongoingEntID = sbbEntity.getSbbEntityId();
TransactionalAction removeLoadedSBBAction = new TransactionalAction() {
    @Override
    public void execute() {
        for (Object obj : coll) {
            if (obj instanceof SbbEntityID) {
                if (!obj.equals(ongoingEntID)) {
                    SbbEntity currentEntity = (SbbEntity) txMgr.getTransactionContext().getData().get(obj);
                    if (currentEntity.getSbbObject() != null) {
                        currentEntity.passivateAndReleaseSbbObject();
                    }
                }
            }
        }
    }
};
txMgr.getTransactionContext().getBeforeCommitPriorityActions().add(removeLoadedSBBAction);
...

Graceful shutdown feature implementation

Gracefull shutdown feature allows shutdown SLEE without forcefull activities ending for supporting RAs.

When slee goes into graceful stopping mode it notifies supporting RAs as not to create new activities but allows current activities to be processed until standard stop procedure is called (with activities ending schedule).

The feature is triggered using JMX call.

Detail feature requirements as in TX case: https://telestax.zendesk.com/hc/en-us/requests/33478

Deploying sbbs with more than one profile-spec-ref without profile-spec-alias (JSLEE 1.1 spec)

When we try to deploy sbbs with more than one profile-spec-ref without profile-spec-alias we get this error:

2016-03-01 18:23:30,169 ERROR org.mobicents.slee.container.component.validator.SbbComponentValidator SbbID[name=MTCoreLogicSbb,vendor=pt.ptinovacao.sec,version=4.0.3] : violates section 3.1.8 of jSLEE 1.1 specification : Sbb descriptor declares profile spec reference more than once, alias: null

We discovered that we needed to define the “profile-spec-alias” inside the “profile-spec-ref” for the validator let it deploy,
but according to the jSLEE 1.1 specification the profile-spec-alias is deprecated so it shouldn’t give any error.

Obsolete branch

I accidentially pushed gfigiel-2.x-gracefulshutdown branch to the main restcomm repo instead of private fork. Please remove this branch as I do not have permission as it contains untested feature and can cause a mess.

Sorry for my mistake.

[tools] Add EclipSLEE plugin

EclipSLEE plugin requires more testing and bug fixing, but first issue is adding it to Release with support for JBoss 7.x/JSLEE 3.x.

[Twiddle] Add classes for getAttribute, setAttribute and invoke methods

Main problem appeared with usage.service command and after my changes in AbstractOperation:

https://github.com/RestComm/jain-slee/blob/2.x/tools/twiddle/cli/src/main/java/org/mobicents/tools/twiddle/op/AbstractOperation.java#L245-L252

if (this.operationName.substring(0, 3).equals("set")) {
    Attribute attr = new Attribute(this.operationName.substring(3), opArguments.get(0));
    conn.setAttribute(on, attr);
} else if (this.operationName.substring(0, 3).equals("get")) {
    operationResult = conn.getAttribute(on, this.operationName.substring(3));
} else {
    operationResult = conn.invoke(on, this.operationName, parms, sig);
}

SLEE Console should configure RA Entity properties with various type

Same problem as for issue #17 but related to Long properties. More generic fix/enhancement to SMC tool is required in order to support other java Types as well.

Caused by: java.lang.IllegalArgumentException: Value is of type java.lang.String, required type is java.lang.Long
at javax.slee.resource.ConfigProperties$Property.setValue(ConfigProperties.java:171)
at javax.slee.resource.ConfigProperties$Property.(ConfigProperties.java:133)
at org.mobicents.slee.container.management.console.server.PropertiesInfoUtils.toProperties(PropertiesInfoUtils.java:70)
at

[new console] Name Bindings value not properly HTML encoded

Our application uses uses the characters "<" and ">" when binding certain ACIs. The value of "Name Bindings" (under "Activites") in the GUI does not support encoding of these characters and the name is wrong.

Example: A binding named "Foo" is presented as "Foo" (unless you inspect the HTML).

Jain Slee context string constant have issue

From ticket 32845:
Jain Slee has issue with lookup into string constant

This code won't work:
AlarmFacility alarmFacility = (AlarmFacility) ctx.lookup(AlarmFacility.JNDI_NAME);

This code work:
javax.slee.facilities.AlarmFacility alarmfacility = (javax.slee.facilities.AlarmFacility)ctx.lookup("slee/facilities/alarm");

There is a potential infinite loop on classloading

https://github.com/RestComm/jain-slee/blob/master/container/components/components/src/main/java/org/mobicents/slee/container/component/deployment/classloading/URLClassLoaderDomainImpl.java#L115

We may change that into...

`
private static final ReentrantLock GLOBAL_LOCK = new ReentrantLock();
private static final long WAIT_FOR_LOCK = 10;
private static final long MAX_WAIT_FOR_LOCK = 10000;
private static final long MAX_ATTEMPTS = MAX_WAIT_FOR_LOCK / WAIT_FOR_LOCK;

    /**
     * Tries to acquire lock for a given time.
     * 
     * @return false if lock is already held by curretn thread. This means
     * no release is necessary on this iteration.
     * @throws IllegalMonitorStateException if lock was not acquired
     */
private boolean acquireGlobalLock() {
            boolean acquired = false;
    if (GLOBAL_LOCK.isHeldByCurrentThread()) {
        acquired = false;
    } else {
                int attempts = 0;
                try {
                    //prevent an infinite loop by limiting the acquire attempts
                    while (!acquired && attempts < MAX_ATTEMPTS) {
                            acquired = GLOBAL_LOCK.tryLock(WAIT_FOR_LOCK, TimeUnit.MILLISECONDS);
                            attempts = attempts + 1;
                    }
                } catch (InterruptedException ex) {
                    if (logger.isDebugEnabled()) {
                            logger.debug("Interrupted while acquiring.", ex);                    
                    }
                }
                if (!acquired) {
                    //throw a runtime exception so error is reported upstream
                    throw new IllegalMonitorStateException("Unable to acquire global lock.");
                }
            }
    return acquired;
}

`

Slee create multiple transaction in the same thread

Slee create multiple transaction in the same thread and caught error exception:

20:35:44,230 ERROR AFPSbbImpl Exception
javax.transaction.NotSupportedException: BaseTransaction.checkTransactionState - [com.arjuna.ats.internal.jta.transaction.arjunacore.alreadyassociated] [com.arjuna.ats.internal.jta.transaction.arjunacore.alreadyassociated] thread is already associated with a transaction!
at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.begin(BaseTransaction.java:80)
at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.begin(BaseTransactionManagerDelegate.java:65)
at org.mobicents.slee.runtime.transaction.SleeTransactionManagerImpl.beginSleeTransaction(SleeTransactionManagerImpl.java:251)
at org.mobicents.slee.runtime.transaction.SleeTransactionManagerImpl.beginSleeTransaction(SleeTransactionManagerImpl.java:61)
at com.kalsym.afp.DatabasePool$1.executeSimple(DatabasePool.java:40)
at org.mobicents.slee.resource.jdbc.task.simple.SimpleJdbcTask.execute(SimpleJdbcTask.java:19)
at org.mobicents.slee.resource.jdbc.JdbcResourceAdaptor$1.run(JdbcResourceAdaptor.java:387)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
20:35:44,230 WARN arjLoggerI18N [com.arjuna.ats.arjuna.coordinator.BasicAction_40] - Abort called on already aborted atomic action 7f000001:cbe5:569f7592:724

Resource adaptors configuration change exception

From ticket 32923:

We are trying to change the RA entity configuration properties using GUI interface (this example is for HttpServletRA mobicents-slee-ra-http-servlet-DU-6.1.5.GA-TelScale, but the same problem we have also with other RAs - ex. SIP RA);

15:15:39:209 [INFO] Entity HttpServletRA activated
15:15:58:701 [INFO] Entity HttpServletRA deactivated
15:16:40:709 [ERROR] the property HTTP_REQUEST_TIMEOUT has null value
Check the JAIN SLEE logs for more detailed information about this error.

[Twiddle] Profile attribute setting problem.

This problem causes when attribute value has braces and is not quotation.

For example:
this command is setting wrong value

./twiddle.sh profile.edit MyTable MyProfile --set --name=Info --value=0{2,3}[1-9][0-9][0-9]{9,10}

but this command works well

./twiddle.sh profile.edit MyTable MyProfile --set --name=Info --value="0{2,3}[1-9][0-9][0-9]{9,10}"

[Profiles] getting correct fieldName from method of ProfileCMP interface

The problem caused when method is like getXYabc, where first and second character of fieldName is upper case.

ConcreteProfileEntityGenerator.java : generateClasses()

String fieldName = Introspector.decapitalize(method.getName().replaceFirst("get", ""));
...
ProfileAttribute profileAttribute = (ProfileAttribute)this.profileComponent.getProfileAttributes().get(fieldName);

[deployer] Migrate Deployer module into SLEE Container Extension

For JSLEE 2.x (based on JBoss 5.1.0.GA) we have Deployer module for deploying SLEE applications.
For JSLEE 3.0 (based on JBoss 7.x) we have Deployment Processors in SLEE extension.
So we need to implement Deployer module code into Deployment Processors.

[build] Finish the building of SLEE Container Extension and Modules for JBoss 7

We have several TODO and FIXME comments in build module.
So we should try to finish (or investigate) all this stuff.

Also I want to test current solution with simple JSLEE examples (test applications). Then I will create issues for test applications.
Also I want to migrate old SLEE Console. Then I will create issues for all tools.

Support separator ";" in twiddle command to fill profile array type

From ticket 33014:
At this time, an array type is only filled by manual set from JMX.
We need to add this feature in twiddle because some customers use twiddle to automate the create profile process.
Example:
profile.edit CallControl mobile.user -s --name=userPhone separator=; --value=”something;other stuff;something else”

jainslee tool twiddle.sh can't create profile

Confirm twiddle can't create profile.

Reproduce:
./twiddle.sh -slocalhost:1099 profile -c --table-name=tele-table --profile-spec=ProfileSpecificationID[name=AddressProfileSpec,vendor=javax.slee,version=1.1]

./twiddle.sh -slocalhost:1099 profile -c --table-name=tele-table --profile-name=profile_demo

./twiddle.sh -slocalhost:1099 profile.edit tele-table demo10 -d

and get table or profile not exits.
after some time, profile removed from jainslee due to timeout:
14:46:42,180 WARN arjLoggerI18N [com.arjuna.ats.arjuna.coordinator.TransactionReaper_18] - TransactionReaper::check timeout for TX 7f000101:bf7b:56bae987:be in state RUN
14:46:42,181 WARN arjLoggerI18N [com.arjuna.ats.arjuna.coordinator.TransactionReaper_7] - TransactionReaper::doCancellations worker Thread[Thread-10,5,jboss] successfully canceled TX 7f000101:bf7b:56bae987:be

BR,
TN

Create file naming convention to ensure proper DU deployment order

Sometimes a solutino is based on multiple DUs which complex dependency network. There is a natural ordering in SLEE being baseLibs->RAs->libs->sbb . Although integrator have the pssibility to influence the deployment order using JBoss features (deplay.last alphabeticalOrder), it would be great to enforce a certain order by suggesting a file name convention. This would require to configure the Jboss built-in comparator and adding new suffixes to support specific slee extensions, instead of current all "jar" files
.sra->.slib->.sbb (try to use S as in SLEE to differenciate other EE artifacts

Size limit? when firing SLEE events

public void fireEvent(Object event, EventTypeID eventType, ExternalActivityHandle handle, Address address)

When invoking this method with an Object event with a serialized size > 1k, the receiving end throws an exception:

java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedMethodAccessor290.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.mobicents.slee.container.rmi.RMIServerImpl.invoke(RMIServerImpl.java:94)
at sun.reflect.GeneratedMethodAccessor281.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)
at sun.rmi.transport.Transport$1.run(Transport.java:159)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.rmi.RemoteException: Failed to fire event due to:; nested exception is:
java.io.StreamCorruptedException: invalid type code: 00
at org.mobicents.slee.connector.remote.RemoteSleeConnectionServiceImpl.fireEvent(RemoteSleeConnectionServiceImpl.java:101)
... 17 more
Caused by: java.io.StreamCorruptedException: invalid type code: 00
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1355)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1946)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1870)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1752)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350)
at org.mobicents.slee.connector.remote.RemoteEventWrapper.getEvent(RemoteEventWrapper.java:71)
at org.mobicents.slee.connector.remote.RemoteSleeConnectionServiceImpl.fireEvent(RemoteSleeConnectionServiceImpl.java:98)

The Sender gets this exception

Caused by: java.rmi.RemoteException: Failed to fire event due to:; nested exception is:
java.io.StreamCorruptedException: invalid type code: 00
at org.mobicents.slee.connector.remote.RemoteSleeConnectionServiceImpl.fireEvent(RemoteSleeConnectionServiceImpl.java:101) [:2.7.0.FINAL]
at sun.reflect.GeneratedMethodAccessor290.invoke(Unknown Source) [:1.6.0_26]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_26]
at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_26]
at org.mobicents.slee.container.rmi.RMIServerImpl.invoke(RMIServerImpl.java:94) [:2.7.0.FINAL]
at sun.reflect.GeneratedMethodAccessor281.invoke(Unknown Source) [:1.6.0_26]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_26]
at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_26]
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305) [:1.6.0_26]
at sun.rmi.transport.Transport$1.run(Transport.java:159) [:1.6.0_26]
at java.security.AccessController.doPrivileged(Native Method) [:1.6.0_26]
at sun.rmi.transport.Transport.serviceCall(Transport.java:155) [:1.6.0_26]
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535) [:1.6.0_26]
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790) [:1.6.0_26]
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649) [:1.6.0_26]
... 3 more
Caused by: java.io.StreamCorruptedException: invalid type code: 00
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1355) [:1.6.0_26]
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1946) [:1.6.0_26]
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1870) [:1.6.0_26]
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1752) [:1.6.0_26]
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328) [:1.6.0_26]
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350) [:1.6.0_26]
at org.mobicents.slee.connector.remote.RemoteEventWrapper.getEvent(RemoteEventWrapper.java:71) [:2.7.0.FINAL]
at org.mobicents.slee.connector.remote.RemoteSleeConnectionServiceImpl.fireEvent(RemoteSleeConnectionServiceImpl.java:98) [:2.7.0.FINAL]
... 17 more

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.