Re: [osgi-dev] [SNMP4J] SNMP4J and OSGI

2014-09-15 Thread daniel Trump
Thanks for the reply.The bundle already exists, however I have not been able to 
work with 
it.http://mvnrepository.com/artifact/org.apache.servicemix.bundles/org.apache.servicemix.bundles.snmp4j




 Date: Sun, 14 Sep 2014 06:18:29 -0400
 From: mta...@redhat.com
 To: x5ra...@hotmail.com
 CC: snm...@agentpp.org
 Subject: Re: [SNMP4J] SNMP4J and OSGI
 
 So you can do it in with snmp4j jar but not under OSGI?
 So AFAIK your problem is not with snmp4j but with OSGI.
 
 It is simply a problem of converting whatever jar you are using to a bundle 
 - adding certain headers to the jar. This can usually be done automatically.
 See number 6 here or ask in their forum:
 http://www.osgi.org/Community/HomePage
 
 Mooli.
 
 - Original Message -
  Hello I'm very new in this,
  I'm developing and SNMP application with trap and request(sending OID and
  receiving result data).
  I have research in google for example but without success...
  I'm able to create a SNMP Trap normal Java programming.. however I can't do
  it in OSGI..
  I'm using the latest bundle a the normal commands are not there...
  Does any one is working with iT or can anyone send me more information about
  SNMP with OSGI?thanks
  

  ___
  SNMP4J mailing list
  snm...@agentpp.org
  https://oosnmp.net/mailman/listinfo/snmp4j
  
  ___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] [SNMP4J] SNMP4J and OSGI

2014-09-15 Thread Timothy Ward
Hi Daniel,

Some more detailed information would be helpful. What do you mean when you say 
that “the normal commands aren’t there”? How are you attempting to use the 
library? What exceptions are you seeing (if any)? Are you sure that your code 
is running?

Once we have a better understanding of what you’re doing we might be able to 
provide some advice and/or an understanding of what the problem is.

Best Regards,

Tim

On 15 Sep 2014, at 10:14, daniel Trump x5ra...@hotmail.com wrote:

 Thanks for the reply.
 The bundle already exists, however I have not been able to work with it.
 http://mvnrepository.com/artifact/org.apache.servicemix.bundles/org.apache.servicemix.bundles.snmp4j
 
 
 
 
  Date: Sun, 14 Sep 2014 06:18:29 -0400
  From: mta...@redhat.com
  To: x5ra...@hotmail.com
  CC: snm...@agentpp.org
  Subject: Re: [SNMP4J] SNMP4J and OSGI
  
  So you can do it in with snmp4j jar but not under OSGI?
  So AFAIK your problem is not with snmp4j but with OSGI.
  
  It is simply a problem of converting whatever jar you are using to a bundle 
  - adding certain headers to the jar. This can usually be done automatically.
  See number 6 here or ask in their forum:
  http://www.osgi.org/Community/HomePage
  
  Mooli.
  
  - Original Message -
   Hello I'm very new in this,
   I'm developing and SNMP application with trap and request(sending OID and
   receiving result data).
   I have research in google for example but without success...
   I'm able to create a SNMP Trap normal Java programming.. however I can't 
   do
   it in OSGI..
   I'm using the latest bundle a the normal commands are not there...
   Does any one is working with iT or can anyone send me more information 
   about
   SNMP with OSGI?thanks
   
   
   ___
   SNMP4J mailing list
   snm...@agentpp.org
   https://oosnmp.net/mailman/listinfo/snmp4j
   
 ___
 OSGi Developer Mail List
 osgi-dev@mail.osgi.org
 https://mail.osgi.org/mailman/listinfo/osgi-dev

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] [SNMP4J] SNMP4J and OSGI

2014-09-15 Thread daniel Trump
Hi Tim, 
I'm trying yo implement a simple SNMP Trap based in this example:
http://www.techdive.in/snmp/snmp4j-trap-receiver
I'm using BNDtools, i have added the bundle to the building path, however most 
of the functions does not exist.
example:
   System.out.println(Trap Type =  + pdu.getType());  
System.out.println(Variable Bindings =  + pdu.getVariableBindings());  
int pduType = pdu.getType();  if ((pduType != PDU.TRAP)  (pduType != 
PDU.V1TRAP)  (pduType != PDU.REPORT)   (pduType != PDU.RESPONSE))  
{pdu.setErrorIndex(0);pdu.setErrorStatus(0);
pdu.setType(PDU.RESPONSE);StatusInformation statusInformation = new 
StatusInformation();StateReference ref = 
cmdRespEvent.getStateReference();

I try to use PDU, but it does not have.. and i have imported import 
org.snmp4j.*;
I have try to search for a example of SNMP4J trap or other in OSGI but without 
success..

From: tim.w...@paremus.com
Date: Mon, 15 Sep 2014 10:25:22 +0100
To: osgi-dev@mail.osgi.org
CC: snm...@agentpp.org
Subject: Re: [osgi-dev] [SNMP4J] SNMP4J and OSGI

Hi Daniel,
Some more detailed information would be helpful. What do you mean when you say 
that “the normal commands aren’t there”? How are you attempting to use the 
library? What exceptions are you seeing (if any)? Are you sure that your code 
is running?
Once we have a better understanding of what you’re doing we might be able to 
provide some advice and/or an understanding of what the problem is.
Best Regards,
Tim
On 15 Sep 2014, at 10:14, daniel Trump x5ra...@hotmail.com wrote:Thanks for 
the reply.The bundle already exists, however I have not been able to work with 
it.http://mvnrepository.com/artifact/org.apache.servicemix.bundles/org.apache.servicemix.bundles.snmp4j




 Date: Sun, 14 Sep 2014 06:18:29 -0400
 From: mta...@redhat.com
 To: x5ra...@hotmail.com
 CC: snm...@agentpp.org
 Subject: Re: [SNMP4J] SNMP4J and OSGI
 
 So you can do it in with snmp4j jar but not under OSGI?
 So AFAIK your problem is not with snmp4j but with OSGI.
 
 It is simply a problem of converting whatever jar you are using to a bundle 
 - adding certain headers to the jar. This can usually be done automatically.
 See number 6 here or ask in their forum:
 http://www.osgi.org/Community/HomePage
 
 Mooli.
 
 - Original Message -
  Hello I'm very new in this,
  I'm developing and SNMP application with trap and request(sending OID and
  receiving result data).
  I have research in google for example but without success...
  I'm able to create a SNMP Trap normal Java programming.. however I can't do
  it in OSGI..
  I'm using the latest bundle a the normal commands are not there...
  Does any one is working with iT or can anyone send me more information about
  SNMP with OSGI?thanks
  
  
  ___
  SNMP4J mailing list
  snm...@agentpp.org
  https://oosnmp.net/mailman/listinfo/snmp4j
  
___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev 
  ___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] [SNMP4J] SNMP4J and OSGI

2014-09-15 Thread Timothy Ward
Hi,

Would it be possible to see your bnd.bnd file? 

Also, is the SNMP4J bundle showing in your Bnd Bundle Path class path entry 
(see the example snapshot for how this should look)? 

If not then it may be that the bundle isn’t in a repository visible to 
bndtools. This does sound like a class path setup issue somewhere in Eclipse.



On 15 Sep 2014, at 11:18, daniel Trump x5ra...@hotmail.com wrote:

 Hi Tim, 
 
 I'm trying yo implement a simple SNMP Trap based in this example:
 
 http://www.techdive.in/snmp/snmp4j-trap-receiver
 
 I'm using BNDtools, i have added the bundle to the building path, however 
 most of the functions does not exist.
 
 example:
 
System.out.println(Trap Type =  + pdu.getType());
   System.out.println(Variable Bindings =  + pdu.getVariableBindings());
   int pduType = pdu.getType();
   if ((pduType != PDU.TRAP)  (pduType != PDU.V1TRAP)  (pduType != 
 PDU.REPORT)
(pduType != PDU.RESPONSE))
   {
 pdu.setErrorIndex(0);
 pdu.setErrorStatus(0);
 pdu.setType(PDU.RESPONSE);
 StatusInformation statusInformation = new StatusInformation();
 StateReference ref = cmdRespEvent.getStateReference();
 
 
 I try to use PDU, but it does not have.. and i have imported import 
 org.snmp4j.*;
 
 I have try to search for a example of SNMP4J trap or other in OSGI but 
 without success..
 
 From: tim.w...@paremus.com
 Date: Mon, 15 Sep 2014 10:25:22 +0100
 To: osgi-dev@mail.osgi.org
 CC: snm...@agentpp.org
 Subject: Re: [osgi-dev] [SNMP4J] SNMP4J and OSGI
 
 Hi Daniel,
 
 Some more detailed information would be helpful. What do you mean when you 
 say that “the normal commands aren’t there”? How are you attempting to use 
 the library? What exceptions are you seeing (if any)? Are you sure that your 
 code is running?
 
 Once we have a better understanding of what you’re doing we might be able to 
 provide some advice and/or an understanding of what the problem is.
 
 Best Regards,
 
 Tim
 
 On 15 Sep 2014, at 10:14, daniel Trump x5ra...@hotmail.com wrote:
 
 Thanks for the reply.
 The bundle already exists, however I have not been able to work with it.
 http://mvnrepository.com/artifact/org.apache.servicemix.bundles/org.apache.servicemix.bundles.snmp4j
 
 
 
 
  Date: Sun, 14 Sep 2014 06:18:29 -0400
  From: mta...@redhat.com
  To: x5ra...@hotmail.com
  CC: snm...@agentpp.org
  Subject: Re: [SNMP4J] SNMP4J and OSGI
  
  So you can do it in with snmp4j jar but not under OSGI?
  So AFAIK your problem is not with snmp4j but with OSGI.
  
  It is simply a problem of converting whatever jar you are using to a bundle 
  - adding certain headers to the jar. This can usually be done automatically.
  See number 6 here or ask in their forum:
  http://www.osgi.org/Community/HomePage
  
  Mooli.
  
  - Original Message -
   Hello I'm very new in this,
   I'm developing and SNMP application with trap and request(sending OID and
   receiving result data).
   I have research in google for example but without success...
   I'm able to create a SNMP Trap normal Java programming.. however I can't 
   do
   it in OSGI..
   I'm using the latest bundle a the normal commands are not there...
   Does any one is working with iT or can anyone send me more information 
   about
   SNMP with OSGI?thanks
   
   
   ___
   SNMP4J mailing list
   snm...@agentpp.org
   https://oosnmp.net/mailman/listinfo/snmp4j
   
 ___
 OSGi Developer Mail List
 osgi-dev@mail.osgi.org
 https://mail.osgi.org/mailman/listinfo/osgi-dev
 
 
 ___ OSGi Developer Mail List 
 osgi-...@mail.osgi.orghttps://mail.osgi.org/mailman/listinfo/osgi-dev
 ___
 OSGi Developer Mail List
 osgi-dev@mail.osgi.org
 https://mail.osgi.org/mailman/listinfo/osgi-dev

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] [SNMP4J] SNMP4J and OSGI

2014-09-15 Thread chris . gray
Hi Daniel,

I can only say that I used snmp4j in an OSGi project a year or two ago and
I don't remember having any particular difficulties. I did make my own
bundle containing snmp4j and all its dependencies, either the servicemix
bundle didn't exist back then or I didn't find it.

Have you successfully built and run other OSGi projects using external
libraries? Trying to figure out whether this is a problem with snmp4j or a
problem with using bndtools. Does it compile? When you try to run it, what
exactly does it tell you? etc..

Regards, Chris

 Hi Tim,
 I'm trying yo implement a simple SNMP Trap based in this example:
 http://www.techdive.in/snmp/snmp4j-trap-receiver
 I'm using BNDtools, i have added the bundle to the building path, however
 most of the functions does not exist.
 example:
System.out.println(Trap Type =  + pdu.getType());
 System.out.println(Variable Bindings =  + pdu.getVariableBindings());
  int pduType = pdu.getType();  if ((pduType != PDU.TRAP) 
 (pduType != PDU.V1TRAP)  (pduType != PDU.REPORT)   (pduType !=
 PDU.RESPONSE))  {pdu.setErrorIndex(0);
 pdu.setErrorStatus(0);pdu.setType(PDU.RESPONSE);
 StatusInformation statusInformation = new StatusInformation();
 StateReference ref = cmdRespEvent.getStateReference();

 I try to use PDU, but it does not have.. and i have imported import
 org.snmp4j.*;
 I have try to search for a example of SNMP4J trap or other in OSGI but
 without success..

 From: tim.w...@paremus.com
 Date: Mon, 15 Sep 2014 10:25:22 +0100
 To: osgi-dev@mail.osgi.org
 CC: snm...@agentpp.org
 Subject: Re: [osgi-dev] [SNMP4J] SNMP4J and OSGI

 Hi Daniel,
 Some more detailed information would be helpful. What do you mean when you
 say that “the normal commands aren’t there”? How are you attempting to use
 the library? What exceptions are you seeing (if any)? Are you sure that
 your code is running?
 Once we have a better understanding of what you’re doing we might be able
 to provide some advice and/or an understanding of what the problem is.
 Best Regards,
 Tim
 On 15 Sep 2014, at 10:14, daniel Trump x5ra...@hotmail.com wrote:Thanks
 for the reply.The bundle already exists, however I have not been able to
 work with
 it.http://mvnrepository.com/artifact/org.apache.servicemix.bundles/org.apache.servicemix.bundles.snmp4j




 Date: Sun, 14 Sep 2014 06:18:29 -0400
 From: mta...@redhat.com
 To: x5ra...@hotmail.com
 CC: snm...@agentpp.org
 Subject: Re: [SNMP4J] SNMP4J and OSGI

 So you can do it in with snmp4j jar but not under OSGI?
 So AFAIK your problem is not with snmp4j but with OSGI.

 It is simply a problem of converting whatever jar you are using to a
 bundle
 - adding certain headers to the jar. This can usually be done
 automatically.
 See number 6 here or ask in their forum:
 http://www.osgi.org/Community/HomePage

 Mooli.

 - Original Message -
  Hello I'm very new in this,
  I'm developing and SNMP application with trap and request(sending OID
 and
  receiving result data).
  I have research in google for example but without success...
  I'm able to create a SNMP Trap normal Java programming.. however I
 can't do
  it in OSGI..
  I'm using the latest bundle a the normal commands are not there...
  Does any one is working with iT or can anyone send me more information
 about
  SNMP with OSGI?thanks
 
 
  ___
  SNMP4J mailing list
  snm...@agentpp.org
  https://oosnmp.net/mailman/listinfo/snmp4j
 
 ___
 OSGi Developer Mail List
 osgi-dev@mail.osgi.org
 https://mail.osgi.org/mailman/listinfo/osgi-dev

 ___
 OSGi Developer Mail List
 osgi-dev@mail.osgi.org
 https://mail.osgi.org/mailman/listinfo/osgi-dev
 ___
 OSGi Developer Mail List
 osgi-dev@mail.osgi.org
 https://mail.osgi.org/mailman/listinfo/osgi-dev


___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev


Re: [osgi-dev] [SNMP4J] SNMP4J and OSGI

2014-09-15 Thread Bernd Eckenfels
Hello Daniel,

it is hard to follow your error description, you might want to publish
your whole (simplified!) project so we can check.

I just did a test with maven-bundle-plugin and it compiles fine
against the servicemix bunle. The resulting manifest looks like:

Manifest-Version: 1.0
Bnd-LastModified: 1410814947739
Build-Jdk: 1.8.0_11
Built-By: Eckenfel
Bundle-Description: Just a dummy to test compile with snmp4j bundle.
Bundle-ManifestVersion: 2
Bundle-Name: net.eckenfels.test.snmp4osgi :: compiletest
Bundle-SymbolicName: net.eckenfels.test.snmp4osgi.compiletest
Bundle-Version: 0.1.0.SNAPSHOT
Created-By: Apache Maven Bundle Plugin
Export-Package: net.eckenfels.test.snmp4osgi.compiletest;version=0.1.0.
 SNAPSHOT
Import-Package: org.snmp4j;resolution:=optional;version=[2.3,3)
Tool: Bnd-2.1.0.20130426-122213

You can find the complete maven project on github:

https://github.com/ecki/sandbox-snmp4osgi

Please take the time and do the same for your question. You might even
see that producing a minimal sample which reproduces the problem often
is enough to help yourself.

Greetings
Bernd


Am Mon, 15 Sep 2014 09:14:17 +
schrieb daniel Trump x5ra...@hotmail.com:

 Thanks for the reply.The bundle already exists, however I have not
 been able to work with
 it.http://mvnrepository.com/artifact/org.apache.servicemix.bundles/org.apache.servicemix.bundles.snmp4j
 
 
 
 
  Date: Sun, 14 Sep 2014 06:18:29 -0400
  From: mta...@redhat.com
  To: x5ra...@hotmail.com
  CC: snm...@agentpp.org
  Subject: Re: [SNMP4J] SNMP4J and OSGI
  
  So you can do it in with snmp4j jar but not under OSGI?
  So AFAIK your problem is not with snmp4j but with OSGI.
  
  It is simply a problem of converting whatever jar you are using to
  a bundle 
  - adding certain headers to the jar. This can usually be done
  automatically. See number 6 here or ask in their forum:
  http://www.osgi.org/Community/HomePage
  
  Mooli.
  
  - Original Message -
   Hello I'm very new in this,
   I'm developing and SNMP application with trap and request(sending
   OID and receiving result data).
   I have research in google for example but without success...
   I'm able to create a SNMP Trap normal Java programming.. however
   I can't do it in OSGI..
   I'm using the latest bundle a the normal commands are not there...
   Does any one is working with iT or can anyone send me more
   information about SNMP with OSGI?thanks
   
   
   ___
   SNMP4J mailing list
   snm...@agentpp.org
   https://oosnmp.net/mailman/listinfo/snmp4j
   
 
___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev


Re: [osgi-dev] [SNMP4J] SNMP4J and OSGI

2014-09-15 Thread daniel Trump
THanks to all..the problem was in the bndTool, I have tested the same code in 
other eclipse installation and it works.problem resolved.

 Date: Mon, 15 Sep 2014 14:30:44 +0100
 From: chris.g...@kiffer.be
 To: osgi-dev@mail.osgi.org
 Subject: Re: [osgi-dev] [SNMP4J] SNMP4J and OSGI
 
 Hi Daniel,
 
 I can only say that I used snmp4j in an OSGi project a year or two ago and
 I don't remember having any particular difficulties. I did make my own
 bundle containing snmp4j and all its dependencies, either the servicemix
 bundle didn't exist back then or I didn't find it.
 
 Have you successfully built and run other OSGi projects using external
 libraries? Trying to figure out whether this is a problem with snmp4j or a
 problem with using bndtools. Does it compile? When you try to run it, what
 exactly does it tell you? etc..
 
 Regards, Chris
 
  Hi Tim,
  I'm trying yo implement a simple SNMP Trap based in this example:
  http://www.techdive.in/snmp/snmp4j-trap-receiver
  I'm using BNDtools, i have added the bundle to the building path, however
  most of the functions does not exist.
  example:
 System.out.println(Trap Type =  + pdu.getType());
  System.out.println(Variable Bindings =  + pdu.getVariableBindings());
   int pduType = pdu.getType();  if ((pduType != PDU.TRAP) 
  (pduType != PDU.V1TRAP)  (pduType != PDU.REPORT)   (pduType !=
  PDU.RESPONSE))  {pdu.setErrorIndex(0);
  pdu.setErrorStatus(0);pdu.setType(PDU.RESPONSE);
  StatusInformation statusInformation = new StatusInformation();
  StateReference ref = cmdRespEvent.getStateReference();
 
  I try to use PDU, but it does not have.. and i have imported import
  org.snmp4j.*;
  I have try to search for a example of SNMP4J trap or other in OSGI but
  without success..
 
  From: tim.w...@paremus.com
  Date: Mon, 15 Sep 2014 10:25:22 +0100
  To: osgi-dev@mail.osgi.org
  CC: snm...@agentpp.org
  Subject: Re: [osgi-dev] [SNMP4J] SNMP4J and OSGI
 
  Hi Daniel,
  Some more detailed information would be helpful. What do you mean when you
  say that “the normal commands aren’t there”? How are you attempting to use
  the library? What exceptions are you seeing (if any)? Are you sure that
  your code is running?
  Once we have a better understanding of what you’re doing we might be able
  to provide some advice and/or an understanding of what the problem is.
  Best Regards,
  Tim
  On 15 Sep 2014, at 10:14, daniel Trump x5ra...@hotmail.com wrote:Thanks
  for the reply.The bundle already exists, however I have not been able to
  work with
  it.http://mvnrepository.com/artifact/org.apache.servicemix.bundles/org.apache.servicemix.bundles.snmp4j
 
 
 
 
  Date: Sun, 14 Sep 2014 06:18:29 -0400
  From: mta...@redhat.com
  To: x5ra...@hotmail.com
  CC: snm...@agentpp.org
  Subject: Re: [SNMP4J] SNMP4J and OSGI
 
  So you can do it in with snmp4j jar but not under OSGI?
  So AFAIK your problem is not with snmp4j but with OSGI.
 
  It is simply a problem of converting whatever jar you are using to a
  bundle
  - adding certain headers to the jar. This can usually be done
  automatically.
  See number 6 here or ask in their forum:
  http://www.osgi.org/Community/HomePage
 
  Mooli.
 
  - Original Message -
   Hello I'm very new in this,
   I'm developing and SNMP application with trap and request(sending OID
  and
   receiving result data).
   I have research in google for example but without success...
   I'm able to create a SNMP Trap normal Java programming.. however I
  can't do
   it in OSGI..
   I'm using the latest bundle a the normal commands are not there...
   Does any one is working with iT or can anyone send me more information
  about
   SNMP with OSGI?thanks
  
  
   ___
   SNMP4J mailing list
   snm...@agentpp.org
   https://oosnmp.net/mailman/listinfo/snmp4j
  
  ___
  OSGi Developer Mail List
  osgi-dev@mail.osgi.org
  https://mail.osgi.org/mailman/listinfo/osgi-dev
 
  ___
  OSGi Developer Mail List
  osgi-dev@mail.osgi.org
  https://mail.osgi.org/mailman/listinfo/osgi-dev
  ___
  OSGi Developer Mail List
  osgi-dev@mail.osgi.org
  https://mail.osgi.org/mailman/listinfo/osgi-dev
 
 
 ___
 OSGi Developer Mail List
 osgi-dev@mail.osgi.org
 https://mail.osgi.org/mailman/listinfo/osgi-dev
  ___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev