[jitsi-dev] Using mail.jar and mysql-connector in a plugin


#1

Hello,

I have been trying to work out how to use the mysql-connector as well
as mail.jar in a jitsi plugin.

I can’t seem to use com.mysql.jdbc.Driver and with mail.jar classes as
soon as I try to use Transport.send an exception occurs.

The plugins can compile and I don’t seem to be getting any errors like
ClassNotFound Exception. I’ve tried a few things to get it to work but
must be missing a step somewhere.

So I was wondering what the correct solution is.

Thanks
Brendan


#2

Hey Brendon,

How are you currently using them? What's the error you are getting?

Emil

--sent from my mobile

···

On Feb 3, 2012 6:54 AM, "Brendan Nilsson" <brendan.nilsson@gmail.com> wrote:

Hello,

I have been trying to work out how to use the mysql-connector as well
as mail.jar in a jitsi plugin.

I can’t seem to use com.mysql.jdbc.Driver and with mail.jar classes as
soon as I try to use Transport.send an exception occurs.

The plugins can compile and I don’t seem to be getting any errors like
ClassNotFound Exception. I’ve tried a few things to get it to work but
must be missing a step somewhere.

So I was wondering what the correct solution is.

Thanks
Brendan


#3

Thanks for the reply,

Basically what I have done is add mail.jar as well as the connector's
jar file to src\lib\installer-exclude I have also added all imports to
the manifest file and added them to the felix.client.run.properties
file under org.osgi.framework.system.packages.extra. The source
compiles and doesn't report any missing classes or class not found
exceptions. It just doesn't seem to be able to use the
com.mysql.jdbc.Driver or transport.send.

I'm sure I am missing something simple, I'm just not sure what the
correct process is.

Thanks.

···

On Fri, Feb 3, 2012 at 4:57 PM, Emil Ivov <emcho@jitsi.org> wrote:

Hey Brendon,

How are you currently using them? What's the error you are getting?

Emil

--sent from my mobile

On Feb 3, 2012 6:54 AM, "Brendan Nilsson" <brendan.nilsson@gmail.com> wrote:

Hello,

I have been trying to work out how to use the mysql-connector as well
as mail.jar in a jitsi plugin.

I can’t seem to use com.mysql.jdbc.Driver and with mail.jar classes as
soon as I try to use Transport.send an exception occurs.

The plugins can compile and I don’t seem to be getting any errors like
ClassNotFound Exception. I’ve tried a few things to get it to work but
must be missing a step somewhere.

So I was wondering what the correct solution is.

Thanks
Brendan


#4

Hey

Basically what I have done is add mail.jar as well as the connector's
jar file to src\lib\installer-exclude

Okay so far, but how do you deploy them from there? The installer-exclude
folder is only used as the classpath during compilation. Most of the jars
lying there are modified (e.g. extended with a manifest) and then stored in
sc-bundles. Others get embedded in their respective plugin-jar.

I have also added all imports to the manifest file

Did you extend mail.jar and mysql-connector with a manifest file stating
their exports, or which manifest are you talking about?

and added them to the felix.client.run.properties
file under org.osgi.framework.system.packages.extra.

That sounds a bit confusing. You should either add the jars to an
appropriate runlevel if you extended them with a manifest-file OR add them
to the extra-packages. But to add them to the extra-packages, they need to
be on the classpath. The installer-exclude folder is not on the classpath
(or it might be when started from ant, but definitely not in the release
version).

The source
compiles and doesn't report any missing classes or class not found
exceptions. It just doesn't seem to be able to use the
com.mysql.jdbc.Driver or transport.send.

Have you tried debugging your code in an IDE? Where does it not behave as
expected?

I'm sure I am missing something simple, I'm just not sure what the
correct process is.

Actually, it might not be so simple if the jdbc thingy tries to load classes
through JNDI...

Regards,
Ingo