Hi Jarl,
Thanks for the detailed response.

I had disabled running the java plugin server through armonitor and set it up 
to listen on port 8000 for debuggers. The trouble was that the initialize 
function was called a long time before I could attach the dbugger using my IDE.

Fortunately we had a breakthrough late last night - it turned out that it was a 
mismatch in the name of the JDBC driver and the jar file we had indicated.

This morning we have a connection to the Database, and only need to modify the 
code to talk to DB2 instead of MSSQL

Thanks for all the help.

Best regards,

Jonas

-----Oprindelig meddelelse-----
Fra: Action Request System discussion list(ARSList) 
[mailto:arsl...@arslist.org] På vegne af Jarl Grøneng
Sendt: 30. juni 2009 18:44
Til: arslist@ARSLIST.ORG
Emne: Re: Java ARDBC

Can it be that the gettable return no tables, then you get a nullpointer?

Here is some information from Appajee on how to attach at debugger to a plugin:
----------------------
At this point, its debugger time!! :-)

Assuming you're using Eclipse as your Java IDE, following information may 
be useful in debugging your plug-in :

The java plugin server is typically started by the armonitor, which also starts 
all other ARSystem processes.  The armonitor starts all processes listed in a 
file <serverinstallfolder>/conf/armonitor.conf
or cfg.  So instead of the pain of restarting the whole ARServer while 
debugging or plugin development process, you can just comment out (put a # at 
the start of the line) the line that looks like below from your armonitor.conf 
file.
&quot;C:\Program Files\Java\jre1.6.0_03\bin\java&quot; -Xmx512m -classpath 
&quot;...whatever... arpluginsvr71.jar&quot; 
com.bmc.arsys.pluginsvr.ARPluginServerMain -x YourServerHere -i 
&quot;YourInstallDir&quot; -m

Restart server/the service.  So monitor won't start java plugin server anymore. 
 Now you can start the java plugin server from command line.
For that you would just copy the command line from the armonitor.cfg and use in 
the command prompt.
Now for debugging, we mostly use the jvm remote debugging mechanism.
You would add this jvm debugging options (below) to the java command line
         -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,suspend=n,server=y
to get the command line as:
&quot;C:\Program Files\Java\jre1.6.0_03\bin\java&quot; -Xmx512m 
-Xrunjdwp:transport=dt_socket,address=8000,suspend=n,server=y
-classpath &quot;...whatever... arpluginsvr71.jar&quot; 
com.bmc.arsys.pluginsvr.ARPluginServerMain -x YourHostNameHere -i 
&quot;YourInstallDir&quot; -m

To attach the Eclipse debugger to the process, it has to be told which machine 
the external program is running on and what port it can use to communicate with 
it. This information is entered through the Launcher dialog. Select from the 
main menu Run, Debug to open the Launcher dialog specific to debugging. Select 
Remote Java Application as the configuration type and click New. This 
configuration information will be used by the debugger to connect to the plugin 
server jvm. Enter the following configuration information:

Name: Java Plugin Server
Project: My Plugin Project
Connection Type: Standard (Socket Attach) Connection Properties: Host: 
localhost Connection Properties: Port: 8000

Setup breakpoints in your plugin as needed, and click Debug to start up the 
debugger. Key things here are matching up the host name and debug port (8000 in 
my example) between your Java command line and the eclipse debugger.

Hope that helps.

Appajee
----------------------


Regards,
Jarl

2009/6/30 Jonas Stumph Stevnsvig <jonas.stumph.stevns...@bec.dk>:
> **
> Hi listers
>
> As some of you may have noticed - I've been battling to get some ARDBC 
> connections up and running. After plenty of reading and advice, and 
> considerable problems with our C developer tools, I've decided to 
> switch to Java. I started off by downloading the 7.1 Java ARDBC/filter 
> plugin sample from http://developer.bmc.com/communities/docs/DOC-2548 
> . Unfortunately I cannot get the code to work as intended. I have 
> tried with several different JDBC drivers, and the  result is always the same:
>
> Here is the plugin
> <plugin>
>                         <name>JdbcDataSourceDBIX</name>
>                         <type>ARDBC</type>
>                         <code>JAVA</code>
>                         <filename>C:/Program Files/BMC 
> Software/ARSystem/Arserver/api/javaplugins/BECplugins/arapi.jar</filen
> ame>
>
> <classname>com.bmc.arsys.plugins.jdbc.JdbcDataSource</classname>
>                         <!-- <pathelement type="location">C:/Program 
> Files/BMC 
> Software/ARSystem/Arserver/api/javaplugins/JDBCdrivers/jtds.jar</pathe
> lement>
> -->
>                         <pathelement
> type="location">C:/Programmer/IBM/SQLLIB/TOOLS/db2jdbcext.jar</pathele
> ment>
>                         <userDefined>
>                                 <url>jdbc:db2:TD99</url>
>                                 <!--
> <driver>net.sourceforge.jtds.jdbc.Driver</driver> -->
>
> <driver>COM.ibm.db2.jdbc.app.DB2Driver</driver>
>                                 <user>XXXX</user>
>                                 <password>yyyy</password>
>
>                         </userDefined>
>                 </plugin>
>
> The thread quits with a nullPointerException, when the getTables 
> method is called, which leads me to think that there is something 
> going wrong in the initialize function. Unfortunately initialize is 
> called so soon after starting the server, that i cannot connect the 
> debugger fast enough to debug it.
> Here is a snippet from the logs which puzzles me:
>
> 2009-06-30 09:23:31,695 INFO  [main] com.bmc.arsys.pluginsvr.plugins.g 
> (?:?)
> - No static init routine found, skipping init call - 
> JdbcDataSourceDBIX 2009-06-30 09:23:31,695 DEBUG [main] 
> com.bmc.arsys.pluginsvr.plugins.g (?:?)
> - Failed  found init plugin JdbcDataSourceDBIX 2009-06-30 09:23:31,695 
> INFO  [main] com.bmc.arsys.pluginsvr.plugins.g (?:?)
> - Done  to call init plugin JdbcDataSourceDBIX
>
> Is it looking for an init routine? I can't seem to find any references 
> in the API documentation, other than the initialize method!? Or is it 
> skipping the method it found?
>
> I have not modified the code found on the bmc developer site, and as 
> far as I can see others have used it successfully - what am I doing wrong?
>
>
> And here the logs for that attempt:
>
> 2009-06-30 09:23:31,054 INFO  [main] com.bmc.arsys.pluginsvr.f (?:?) - 
> Loading the Configuration File 
> ::file:/C:/Program%20Files/BMC%20Software/ARSystem/pluginsvr/pluginsvr
> _config.xml 2009-06-30 09:23:31,070 ERROR [main] 
> com.bmc.arsys.pluginsvr.f (?:?) - Java plug-in server does not support 
> C plug-ins. Contact Customer Support for details.
> 2009-06-30 09:23:31,070 DEBUG [main] com.bmc.arsys.pluginsvr.f (?:?) - 
> Plugin Accessible Configured Values:
> 2009-06-30 09:23:31,070 DEBUG [main] com.bmc.arsys.pluginsvr.f (?:?) - 
> port
> 9999
> 2009-06-30 09:23:31,070 DEBUG [main] com.bmc.arsys.pluginsvr.f (?:?) - 
> numCoreThreads 5 2009-06-30 09:23:31,211 WARN  [main] 
> org.apache.commons.configuration.ConfigurationFactory$FileConfiguratio
> nFactory
> (ConfigurationFactory.java:530) - Could not load optional 
> configuration arsys_api.xml 2009-06-30 09:23:31,304 DEBUG [main] 
> com.bmc.arsys.pluginsvr.c.a (?:?) -
> os.name: Windows 2003
> 2009-06-30 09:23:31,304 DEBUG [main] com.bmc.arsys.pluginsvr.c.a (?:?) 
> -
> os.arch: x86
> 2009-06-30 09:23:31,304 DEBUG [main] com.bmc.arsys.pluginsvr.c.a (?:?) 
> -
> java.vendor: Sun Microsystems Inc.
> 2009-06-30 09:23:31,304 DEBUG [main] com.bmc.arsys.pluginsvr.c.a (?:?) 
> - Constructor ARPluginServerEncryptionInfo 2009-06-30 09:23:31,648 
> INFO  [main] com.bmc.arsys.pluginsvr.plugins.g (?:?)
> - Loading all Java Plugins and Plugin sets 2009-06-30 09:23:31,648 
> INFO  [main] com.bmc.arsys.pluginsvr.plugins.g (?:?)
> - Attempting to load Java Plugin JdbcDataSourceDBIX 2009-06-30 
> 09:23:31,648 INFO  [main] com.bmc.arsys.pluginsvr.plugins.g (?:?)
> - Number of URLs for plugin JdbcDataSourceDBIX is 2 2009-06-30 
> 09:23:31,664 INFO  [main] com.bmc.arsys.pluginsvr.plugins.g (?:?)
> - URL1:
> file:/C:/Program%20Files/BMC%20Software/ARSystem/Arserver/api/javaplug
> ins/BECplugins/arapi.jar 2009-06-30 09:23:31,664 INFO  [main] 
> com.bmc.arsys.pluginsvr.plugins.g (?:?)
> - URL2: file:/C:/Programmer/IBM/SQLLIB/TOOLS/db2jdbcext.jar
> 2009-06-30 09:23:31,695 INFO  [main] com.bmc.arsys.pluginsvr.plugins.g 
> (?:?)
> - No static init routine found, skipping init call - 
> JdbcDataSourceDBIX 2009-06-30 09:23:31,695 DEBUG [main] 
> com.bmc.arsys.pluginsvr.plugins.g (?:?)
> - Failed  found init plugin JdbcDataSourceDBIX 2009-06-30 09:23:31,695 
> INFO  [main] com.bmc.arsys.pluginsvr.plugins.g (?:?)
> - Done  to call init plugin JdbcDataSourceDBIX 2009-06-30 09:23:31,695 
> INFO  [main] com.bmc.arsys.pluginsvr.plugins.g (?:?)
> - Successfully loaded Java Plugin JdbcDataSourceDBIX 2009-06-30 
> 09:23:31,695 INFO  [main] com.bmc.arsys.pluginsvr.d.a (?:?) -
> ARPluginSvrThreadPoolExecutor: coreT:5 maxT:10 
> ThreadAliveIdleInSecond:0 2009-06-30 09:23:31,711 INFO  [main] 
> com.bmc.arsys.pluginsvr.d.b (?:?) - Java plug-in server is 
> initializing all plug-ins for 5 core threads. Please wait ...
> 2009-06-30 09:23:31,711 INFO  [pool-2-thread-5] 
> com.bmc.arsys.pluginsvr.d.b
> (?:?) - Will iniPlugins for thread: 16 Thread[pool-2-thread-5,5,main] 
> 2009-06-30 09:23:31,711 INFO  [pool-2-thread-4] 
> com.bmc.arsys.pluginsvr.d.b
> (?:?) - Will iniPlugins for thread: 15 Thread[pool-2-thread-4,5,main] 
> 2009-06-30 09:23:31,711 INFO  [pool-2-thread-3] 
> com.bmc.arsys.pluginsvr.d.b
> (?:?) - Will iniPlugins for thread: 14 Thread[pool-2-thread-3,5,main] 
> 2009-06-30 09:23:31,726 INFO  [pool-2-thread-2] 
> com.bmc.arsys.pluginsvr.d.b
> (?:?) - Will iniPlugins for thread: 13 Thread[pool-2-thread-2,5,main] 
> 2009-06-30 09:23:31,726 INFO  [pool-2-thread-1] 
> com.bmc.arsys.pluginsvr.d.b
> (?:?) - Will iniPlugins for thread: 12 Thread[pool-2-thread-1,5,main] 
> 2009-06-30 09:23:31,742 INFO  [pool-2-thread-5] 
> com.bmc.arsys.pluginsvr.plugins.g (?:?) - Attempting to Create an 
> instance of the plugin JdbcDataSourceDBIX 2009-06-30 09:23:31,742 INFO  
> [pool-2-thread-5] com.bmc.arsys.pluginsvr.plugins.ARPluginContext 
> (?:?) -
> <JdbcDataSourceDBIX>initialize()
> 2009-06-30 09:23:31,742 INFO  [pool-2-thread-5] 
> com.bmc.arsys.pluginsvr.plugins.g (?:?) - Thread 16 successfully 
> created an instance of JdbcDataSourceDBIX 2009-06-30 09:23:31,742 INFO  
> [pool-2-thread-5] com.bmc.arsys.pluginsvr.d.b
> (?:?) - Done iniPlugins for thread: 16 2009-06-30 09:23:31,742 INFO  
> [pool-2-thread-1] com.bmc.arsys.pluginsvr.plugins.g (?:?) - Attempting 
> to Create an instance of the plugin JdbcDataSourceDBIX 2009-06-30 
> 09:23:31,742 INFO  [pool-2-thread-1] 
> com.bmc.arsys.pluginsvr.plugins.ARPluginContext (?:?) -
> <JdbcDataSourceDBIX>initialize()
> 2009-06-30 09:23:31,742 INFO  [pool-2-thread-1] 
> com.bmc.arsys.pluginsvr.plugins.g (?:?) - Thread 12 successfully 
> created an instance of JdbcDataSourceDBIX 2009-06-30 09:23:31,742 INFO  
> [pool-2-thread-1] com.bmc.arsys.pluginsvr.d.b
> (?:?) - Done iniPlugins for thread: 12 2009-06-30 09:23:31,742 INFO  
> [pool-2-thread-2] com.bmc.arsys.pluginsvr.plugins.g (?:?) - Attempting 
> to Create an instance of the plugin JdbcDataSourceDBIX 2009-06-30 
> 09:23:31,742 INFO  [pool-2-thread-2] 
> com.bmc.arsys.pluginsvr.plugins.ARPluginContext (?:?) -
> <JdbcDataSourceDBIX>initialize()
> 2009-06-30 09:23:31,742 INFO  [pool-2-thread-2] 
> com.bmc.arsys.pluginsvr.plugins.g (?:?) - Thread 13 successfully 
> created an instance of JdbcDataSourceDBIX 2009-06-30 09:23:31,742 INFO  
> [pool-2-thread-2] com.bmc.arsys.pluginsvr.d.b
> (?:?) - Done iniPlugins for thread: 13 2009-06-30 09:23:31,742 INFO  
> [pool-2-thread-3] com.bmc.arsys.pluginsvr.plugins.g (?:?) - Attempting 
> to Create an instance of the plugin JdbcDataSourceDBIX 2009-06-30 
> 09:23:31,742 INFO  [pool-2-thread-3] 
> com.bmc.arsys.pluginsvr.plugins.ARPluginContext (?:?) -
> <JdbcDataSourceDBIX>initialize()
> 2009-06-30 09:23:31,757 INFO  [pool-2-thread-3] 
> com.bmc.arsys.pluginsvr.plugins.g (?:?) - Thread 14 successfully 
> created an instance of JdbcDataSourceDBIX 2009-06-30 09:23:31,757 INFO  
> [pool-2-thread-3] com.bmc.arsys.pluginsvr.d.b
> (?:?) - Done iniPlugins for thread: 14 2009-06-30 09:23:31,757 INFO  
> [pool-2-thread-4] com.bmc.arsys.pluginsvr.plugins.g (?:?) - Attempting 
> to Create an instance of the plugin JdbcDataSourceDBIX 2009-06-30 
> 09:23:31,757 INFO  [pool-2-thread-4] 
> com.bmc.arsys.pluginsvr.plugins.ARPluginContext (?:?) -
> <JdbcDataSourceDBIX>initialize()
> 2009-06-30 09:23:31,757 INFO  [pool-2-thread-4] 
> com.bmc.arsys.pluginsvr.plugins.g (?:?) - Thread 15 successfully 
> created an instance of JdbcDataSourceDBIX 2009-06-30 09:23:31,757 INFO  
> [pool-2-thread-4] com.bmc.arsys.pluginsvr.d.b
> (?:?) - Done iniPlugins for thread: 15 2009-06-30 09:23:31,757 INFO  
> [pool-2-thread-4] com.bmc.arsys.pluginsvr.d.b
> (?:?) - Java plug-in server has initialized plug-ins for all 5 core threads.
> The server is ready to receive RPC calls.
> 2009-06-30 09:23:31,820 INFO  [main]
> com.bmc.arsys.pluginsvr.ARPluginServerMain (?:?) - AR System Plugin 
> Server Version 7.5.00 Patch 001 200903100038
>
> I'm running ARS 7.5 on win2k3
>
> Any help is much appreciated.
>
> best regards,
>
>
>
> Jonas Stumph Stevnsvig
> Remedy Developer
> BEC Competence Centre
> Phone  (+45) 46 38 20 08
> Mobile  (+45) 61 56 20 08
> jonas.stumph.stevns...@bec.dk
> becrem...@bec.dk
>
>
> _Platinum Sponsor: rmisoluti...@verizon.net ARSlist: "Where the 
> Answers Are"_

_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org Platinum 
Sponsor:rmisoluti...@verizon.net ARSlist: "Where the Answers Are"

_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
Platinum Sponsor:rmisoluti...@verizon.net ARSlist: "Where the Answers Are"

Reply via email to