Skip to main content

A JAIN SLEE begginer's tutorial

25 replies [Last post]
eduardomartins
Offline
Joined: 2005-10-10
Points: 0

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
rakeshpachawajava
Offline
Joined: 2008-04-28
Points: 0

Dear Martins,

On running mvn install command, I am unable to get the output as described in the blog. the log in mobicents server is :
[b]
17:25:30,448 INFO [STDOUT] 17:25:30,448 INFO [EventRouterImpl] Deactivated ServiceID[hello-world SLEE Service#org.mobicents.slee.example#1.0-SNAPSHOT]
17:25:30,689 INFO [STDOUT] 17:25:30,689 INFO [DeploymentMBeanImpl] Uninstalling DU with id DeployableUnitID[3]
17:25:30,726 INFO [STDOUT] 17:25:30,725 INFO [SleeContainer] Uninstalled service ServiceID[hello-world SLEE Service#org.mobicents.slee.example#1.0-SNAPSHOT]
17:25:30,731 INFO [STDOUT] 17:25:30,731 INFO [SleeContainer] Uninstalled SBB SbbID[hello-world SBB#org.mobicents.slee.example#1.0-SNAPSHOT] on DU DeployableUnitID[3]
17:25:30,740 INFO [STDOUT] 17:25:30,740 INFO [DeploymentMBeanImpl] Uninstalled DU with id DeployableUnitID[3]
17:25:31,064 INFO [STDOUT] 17:25:31,063 INFO [DeploymentMBeanImpl] InstallingDU with URL file:/F:/jboss-4.2.2.GA/server/default/deploy/hello-world-du-1.0-SNAPSHOT.jar
17:25:31,156 INFO [STDOUT] 17:25:31,156 INFO [SleeContainer] Installed SBB SbbID[hello-world SBB#org.mobicents.slee.example#1.0-SNAPSHOT]
17:25:31,166 INFO [STDOUT] 17:25:31,166 INFO [SleeContainer] Installed Service ServiceID[hello-world SLEE Service#org.mobicents.slee.example#1.0-SNAPSHOT]. Root SBB is SbbID[hello-world SBB#org.mobicents.slee.example#1.0-SNAPSHOT]
17:25:31,173 INFO [STDOUT] 17:25:31,173 INFO [DeploymentMBeanImpl] Deployableunit with URL file:/F:/jboss-4.2.2.GA/server/default/deploy/hello-world-du-1.0-SNAPSHOT.jar deployed as DeployableUnitID[4]
17:25:31,431 INFO [STDOUT] 17:25:31,431 INFO [SleeContainer] Activated ServiceID[hello-world SLEE Service#org.mobicents.slee.example#1.0-SNAPSHOT]
17:25:31,455 ERROR [STDERR] 17 Jun, 2008 5:25:31 PM org.mobicents.slee.services.sip.proxy.ProxySbb startMBeanConfigurator
INFO: Building Configuration from ENV Entries
17:25:31,474 ERROR [STDERR] 17 Jun, 2008 5:25:31 PM org.mobicents.slee.services.sip.registrar.RegistrarSbb startMBeanConfigurator
INFO: Building Configuration from ENV Entries
17:25:31,522 INFO [RootSbb] service activated...
[/b]

after service activated, the cursor keeps on blinking and no other activity is going on.

Am I wrong somewhere?
Please guide me.

Thanks and Regards,
Rakesh Pachawa

eduardomartins
Offline
Joined: 2005-10-10
Points: 0

From the blog entry:

"The Sbb class itself you can open it in the source package of the eclipse project, with the name RootSbb, which includes the ServiceStartedEvent event handler:

public void onServiceStartedEvent(
javax.slee.serviceactivity.ServiceStartedEvent event,
ActivityContextInterface aci) {

try {
Context myEnv = (Context) new InitialContext().lookup("java:comp/env");
ServiceActivity sa = ((ServiceActivityFactory) myEnv
.lookup("slee/serviceactivity/factory")).getActivity();
if (sa.equals(aci.getActivity())) {
// it's this service that is starting
logger.info("service activated...");
}
// don't want to receive further events on this activity
aci.detach(this.sbbContext.getSbbLocalObject());

} catch (Exception e) {
logger.error("Can't handle service started event.", e);
}
}

The logic in this event handler looks ugly but it's simple, it retrieves the ServiceActivity of the service from it's JNDI environment, and compares it with the ServiceActivity where the event was fired. If matches it means it's our service that is being activated. Great, now we just need to print the message in the console and in fact it's already printing something, "service activated", so all you need to do is change that code to

logger.info("hello world!!!");"

So ... what you need to do is replace

logger.info("service activated...");

with

logger.info("hello world!!!");

rakeshpachawajava
Offline
Joined: 2008-04-28
Points: 0

Dear Martins,

Thank you.
But there are some STDERR's also on running the example.
Can you please tell me what to be done to overcome those errors.

Regards,
Rakesh Pachawa

eduardomartins
Offline
Joined: 2005-10-10
Points: 0

17:25:31,455 ERROR [STDERR] 17 Jun, 2008 5:25:31 PM org.mobicents.slee.services.sip.proxy.ProxySbb startMBeanConfigurator
INFO: Building Configuration from ENV Entries
17:25:31,474 ERROR [STDERR] 17 Jun, 2008 5:25:31 PM org.mobicents.slee.services.sip.registrar.RegistrarSbb startMBeanConfigurator
INFO: Building Configuration from ENV Entries

those ones are from sip-services example and are not really errors, but a logging configuration issue, ignore them...

rakeshpachawajava
Offline
Joined: 2008-04-28
Points: 0

Dear Martins,

Ok. Thank you.

Regards,
Rakesh Pachawa

rakeshpachawajava
Offline
Joined: 2008-04-28
Points: 0

Dear Martins,

Sorry, the complete message was not posted.

When I run the command mvn mobicents:eclipse in the mobicents home directory, the command is executing fine and is downloading the required jars, but for the same command in eclipse workspace, the error is creeping up.

Please guide me where could I have gone wrong.

Thanks and Regards,
Rakesh Pachawa.

eduardomartins
Offline
Joined: 2005-10-10
Points: 0

it's not on eclipse workspace, but on the hello-world directory

rakeshpachawajava
Offline
Joined: 2008-04-28
Points: 0

Dear Martins,

Thank you.

Regards,
Rakesh Pachawa

alessandro_stile
Offline
Joined: 2008-06-25
Points: 0

Dear Martins I like your tutorial but I'm looking for a jainslee tutorial to develop and deploy a simple Jainslee application on mobicents using eclpse and jainslee plugin, please could you help me?

yini
Offline
Joined: 2007-03-15
Points: 0

hi, I'm new to maven and mobicents, and now i'm playing around the sip presence service ,and I have a problem when mvn:mobicents:eclipse, the error log:
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.

GroupId: org.mobicents
ArtifactId: mobicents
Version: 1.2.0.BETA3-SNAPSHOT

Reason: Unable to download the artifact from any repository

org.mobicents:mobicents:pom:1.2.0.BETA3-SNAPSHOT

from the specified remote repositories:
central (http://repo1.maven.org/maven2)

[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.reactor.MavenExecutionException: Cannot find parent: org.mobicents:mobicents for project: org.mobicents.servers.sippresence:sip-presence-parent:pom:1.0.0.BETA2 for project org.mobicents.servers.sippresence:sip-presence-parent:pom:1.0.0.BETA2
at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:378)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:292)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.project.ProjectBuildingException: Cannot find parent: org.mobicents:mobicents for project: org.mobicents.servers.sippresence:sip-presence-parent:pom:1.0.0.BETA2 for project org.mobicents.servers.sippresence:sip-presence-parent:pom:1.0.0.BETA2
at org.apache.maven.project.DefaultMavenProjectBuilder.assembleLineage(DefaultMavenProjectBuilder.java:1370)
at org.apache.maven.project.DefaultMavenProjectBuilder.buildInternal(DefaultMavenProjectBuilder.java:821)
at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromSourceFileInternal(DefaultMavenProjectBuilder.java:506)
at org.apache.maven.project.DefaultMavenProjectBuilder.build(DefaultMavenProjectBuilder.java:198)
at org.apache.maven.DefaultMaven.getProject(DefaultMaven.java:583)
at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:461)
at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:365)
... 11 more
Caused by: org.apache.maven.project.ProjectBuildingException: POM 'org.mobicents:mobicents' not found in repository: Unable to download the artifact from any repository

org.mobicents:mobicents:pom:1.2.0.BETA3-SNAPSHOT

from the specified remote repositories:
central (http://repo1.maven.org/maven2)
for project org.mobicents:mobicents
at org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepository(DefaultMavenProjectBuilder.java:603)
at org.apache.maven.project.DefaultMavenProjectBuilder.assembleLineage(DefaultMavenProjectBuilder.java:1366)
... 17 more
Caused by: org.apache.maven.artifact.resolver.ArtifactNotFoundException: Unable to download the artifact from any repository

org.mobicents:mobicents:pom:1.2.0.BETA3-SNAPSHOT

from the specified remote repositories:
central (http://repo1.maven.org/maven2)

at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:212)
at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:74)
at org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepository(DefaultMavenProjectBuilder.java:556)
... 18 more
Caused by: org.apache.maven.wagon.ResourceDoesNotExistException: Unable to download the artifact from any repository
at org.apache.maven.artifact.manager.DefaultWagonManager.getArtifact(DefaultWagonManager.java:331)
at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:200)
... 20 more

I cannot down the mobicents 1.2.0-beta3-snapshot. So how can i download the snapshot?

Message was edited by: yini

eduardomartins
Offline
Joined: 2005-10-10
Points: 0

you are playing with an outdated version of the presence service, please update from the svn at http://mobicents.googlecode.com/svn/trunk/servers/sip-presence/

yini
Offline
Joined: 2007-03-15
Points: 0

OK, I'll try the latest version.
Another question:can the presence service work with IMS-COMMUNICATOR or other SIP phones?

eduardomartins
Offline
Joined: 2005-10-10
Points: 0

If you want to use a softphone that does not supports XCAP to store presence rules then all should be fine since the presence server will authorize subscriptions, but otherwise the current beta code was tested for Counterpath's Eyebeam, which does not uses standard XCAP URIs to store a user's pres-rules doc. If you want to try it with standard softphones please hack into class PresenceSubscriptionControl in ps-core/subscription-sbb/src/... and change

private static final boolean clientUAIsEyebeam = true;

to false.

In the future this won't be needed due to analysis of the sip user agent headers, but right now the sip stack version we use is removing those headers.

Let me know how it goes...

PS: you may want then to create a new post, since this one is related with the JAIN SLEE beginners tutorial :-)

ongobizarpitkukreti
Offline
Joined: 2008-05-26
Points: 0

Dear martins
I am getting following error when i have followed this step

[b]Maven will add a variable M2_REPO to Eclipse pointing to Maven2 local repository. Now change to hello-world directory and do

mvn mobicents:eclipse[/b]

[b][u]error is[/u][/b]

G:\Projects\Mobiloos\workspace\hello-world>mvn mobicents:eclipse
[INFO] Scanning for projects...
[INFO] Reactor build order:
[INFO] Unnamed - org.mobicents.slee.example:hello-world-parent:pom:1.0-SNAPSHO
T
[INFO] Unnamed - org.mobicents.slee.example:hello-world-sbb:jar:1.0-SNAPSHOT
[INFO] Unnamed - org.mobicents.slee.example:hello-world-du:pom:1.0-SNAPSHOT
[INFO] Searching repository for plugin with prefix: 'mobicents'.
[INFO] Cannot find mojo descriptor for: 'mobicents:eclipse' - Treating as non-ag
gregator.
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Plugin could not be found - check that the goal name is correct: Unable t
o download the artifact from any repository

Try downloading the file manually from the project website.

Then, install it using the command:
mvn install:install-file -DgroupId=org.mobicents.tools -DartifactId=maven-du
-plugin -Dversion=1.0.0.BETA2-SNAPSHOT -Dpackaging=maven-plugin -Dfile=/path/to/
file

Alternatively, if you host your own repository you can deploy the file there:
mvn deploy:deploy-file -DgroupId=org.mobicents.tools -DartifactId=maven-du-p
lugin -Dversion=1.0.0.BETA2-SNAPSHOT -Dpackaging=maven-plugin -Dfile=/path/to/fi
le -Durl=[url] -DrepositoryId=[id]

org.mobicents.tools:maven-du-plugin:maven-plugin:1.0.0.BETA2-SNAPSHOT

from the specified remote repositories:
central (http://repo1.maven.org/maven2)

org.mobicents.tools:maven-du-plugin:maven-plugin:1.0.0.BETA2-SNAPSHOT

from the specified remote repositories:
central (http://repo1.maven.org/maven2)

[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: < 1 second
[INFO] Finished at: Sat Jun 14 18:22:36 IST 2008
[INFO] Final Memory: 2M/4M
[INFO] ------------------------------------------------------------------------
please help me in this issue

Thanks
Regards
Arpit kukreti

Message was edited by: ongobizarpitkukreti

Message was edited by: ongobizarpitkukreti

eduardomartins
Offline
Joined: 2005-10-10
Points: 0

see my response above

rakeshpachawajava
Offline
Joined: 2008-04-28
Points: 0

Dear Martins,

I am encountering problems with [b]mvn mobicents:eclipse[/b] in second step as given in your blogspot. on running the command, the following error is creeping up.
[b]
F:\workspace>mvn mobicents:eclipse
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'mobicents'.
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] The plugin 'org.apache.maven.plugins:maven-mobicents-plugin' does not exi
st or no valid version could be found
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: < 1 second
[INFO] Finished at: Tue Jun 17 14:55:14 IST 2008
[INFO] Final Memory: 1M/4M
[INFO] ------------------------------------------------------------------------[/b]

while in mobicents directory mvn mobicents:eclipse is working.
It is downloading the required jars.

Could you please tell me where could i have stepped wrong.

Thanks and Regards,
Rakesh Pachawa

ongobizarpitkukreti
Offline
Joined: 2008-05-26
Points: 0

Dear martins
I am getting following error when i have followed this step

[b]Maven will add a variable M2_REPO to Eclipse pointing to Maven2 local repository. Now change to hello-world directory and do

mvn mobicents:eclipse[/b]

[b][u]error is[/u][/b]

G:\Projects\Mobiloos\workspace\hello-world>mvn mobicents:eclipse
[INFO] Scanning for projects...
[INFO] Reactor build order:
[INFO] Unnamed - org.mobicents.slee.example:hello-world-parent:pom:1.0-SNAPSHO
T
[INFO] Unnamed - org.mobicents.slee.example:hello-world-sbb:jar:1.0-SNAPSHOT
[INFO] Unnamed - org.mobicents.slee.example:hello-world-du:pom:1.0-SNAPSHOT
[INFO] Searching repository for plugin with prefix: 'mobicents'.
[INFO] Cannot find mojo descriptor for: 'mobicents:eclipse' - Treating as non-ag
gregator.
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Plugin could not be found - check that the goal name is correct: Unable t
o download the artifact from any repository

Try downloading the file manually from the project website.

Then, install it using the command:
mvn install:install-file -DgroupId=org.mobicents.tools -DartifactId=maven-du
-plugin -Dversion=1.0.0.BETA2-SNAPSHOT -Dpackaging=maven-plugin -Dfile=/path/to/
file

Alternatively, if you host your own repository you can deploy the file there:
mvn deploy:deploy-file -DgroupId=org.mobicents.tools -DartifactId=maven-du-p
lugin -Dversion=1.0.0.BETA2-SNAPSHOT -Dpackaging=maven-plugin -Dfile=/path/to/fi
le -Durl=[url] -DrepositoryId=[id]

org.mobicents.tools:maven-du-plugin:maven-plugin:1.0.0.BETA2-SNAPSHOT

from the specified remote repositories:
central (http://repo1.maven.org/maven2)

org.mobicents.tools:maven-du-plugin:maven-plugin:1.0.0.BETA2-SNAPSHOT

from the specified remote repositories:
central (http://repo1.maven.org/maven2)

[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: < 1 second
[INFO] Finished at: Sat Jun 14 18:22:36 IST 2008
[INFO] Final Memory: 2M/4M
[INFO] ------------------------------------------------------------------------
please help me in this issue

Thanks
Regards
Arpit kukreti

Message was edited by: ongobizarpitkukreti

Message was edited by: ongobizarpitkukreti

eduardomartins
Offline
Joined: 2005-10-10
Points: 0

Check you can reach http://snapshots.jboss.org in the computer you're running the tutorial, the BETA2 snapshot of the plugin is available at http://snapshots.jboss.org/maven2/org/mobicents/tools/maven-du-plugin/ and since the pom.xml of the example defines that repository as a place to look for snapshots Maven2 should get it from there...

ongobizarpitkukreti
Offline
Joined: 2008-05-26
Points: 0

hi
Thanks for help ,but i am getting an Error: [u][b]PROPFIND request failed on '/maven2/org/mobicents/tools/maven-du-plugin' [/b][/u]
when i am downloading 1.0.0.BETA2-SNAPSHOT from this url http://snapshots.jboss.org/maven2/org/mobicents/tools/maven-du-plugin/ thouugh SVN please guide me

Thanks
Regards
Arpit kukreti

eduardomartins
Offline
Joined: 2005-10-10
Points: 0

please paste here the content of the pom.xml at the hello-world directory

ongobizarpitkukreti
Offline
Joined: 2008-05-26
Points: 0

Hello martins,
This is the content there in the pom.xml file which is there at hello-world dir

4.0.0

pom

hello-world-parent
org.mobicents.slee.example
1.0-SNAPSHOT


sbb
du

default



mobicents-jainslee-server
org.mobicents
1.2.0.GA-SNAPSHOT
pom
import


maven-eclipse-plugin
org.mobicents.tools
1.0.0.BETA1-SNAPSHOT
false

org.apache.maven.plugins
maven-compiler-plugin

1.5
1.5
true

org.apache.maven.plugins
maven-jar-plugin




true


true






jboss
JBoss Repository
http://repository.jboss.org/maven2

false



jboss-snapshots
JBoss Snapshot Repository
http://snapshots.jboss.org/maven2

false


true


Thanks
Arpit kukreti

eduardomartins
Offline
Joined: 2005-10-10
Points: 0

The root pom of the example was missing the following content to be able to get plugins from Jboss repositories:

jboss
JBoss Plugin Repository
http://repository.jboss.org/maven2

false

jboss-snapshots
JBoss Snapshot Plugin Repository
http://snapshots.jboss.org/maven2

false


true

Please add that into the pom above or do the tutorial from the beggining, Maven should update the archetype code, let me know if there are any more issues.

ongobizarpitkukreti
Offline
Joined: 2008-05-26
Points: 0

Dsear martins
Really this tutorial is helpfol for me and thanks for artical.According to that acticat first thing we have to do is mvn archetype:generate -DarchetypeCatalog=local but when i am doing this in the commond prompt in windows
C:\>mvn archetype:generate -DarchetypeCatalog=local
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'archetype'.
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Default Project
[INFO] task-segment: [archetype:generate] (aggregator-style)
[INFO] ------------------------------------------------------------------------
[INFO] Preparing archetype:generate
[INFO] No goals needed for project - skipping
[INFO] Setting property: classpath.resource.loader.class => 'org.codehaus.plexu
.velocity.ContextClassLoaderResourceLoader'.
[INFO] Setting property: velocimacro.messages.on => 'false'.
[INFO] Setting property: resource.loader => 'classpath'.
[INFO] Setting property: resource.manager.logwhenfound => 'false'.
[INFO] [archetype:generate]
[INFO] Generating project in Interactive mode
[INFO] No archetype defined. Using maven-archetype-quickstart (org.apache.maven
archetypes:maven-archetype-quickstart:1.0)
Choose archetype:
Choose a number: :
Choose archetype:
Choose a number: :

wat should we need to enter the number ........and wat is this line ment for "introduce the number for jain-slee-basic-service"

please help me thanks
regards
Arpit

Dear martins
The above problem is solved

Thanks

Message was edited by: ongobizarpitkukreti

eduardomartins
Offline
Joined: 2005-10-10
Points: 0

You forgot to install the archetype accroding to http://groups.google.com/group/mobicents-public/web/jainslee-maven-arche... ?

aayush2008
Offline
Joined: 2008-04-16
Points: 0

Hi !

Thanks for this initiative..It will be pretty helpful. I read the first part of the tutorial..Its well written.

Warm Regards
Aayush