It's all about the answers!

Ask a question

Running custom source scanners on the server


Kristof Van Sever (11812) | asked Dec 04 '13, 10:28 a.m.
 Hi guys,

I made a source code scanner the way described in https://jazz.net/wiki/bin/view/Main/ExtendDependencyParser using a similar way as I'd make an Advisor/Participant. I also put it on the server in the same way (Made the plugin, put it in a feature, then put it in a site, then built the site, and put it in the server with a reference to the feature and file in a .ini file in the server conf, then reset ccm and restarted the server) 

The building of the plugin works perfectly. The problem I have however, is that the custom source code scanner doesn't show up in the source code scanners when trying to link it to a 
language definition.

Am I missing something here, or doing something wrong?

Thanks,

Kristof

Accepted answer


permanent link
Daniel Bruce (9135) | answered Dec 05 '13, 11:03 a.m.
JAZZ DEVELOPER
Hi Kristof,

Here are the steps we used in the lab to test the scanner extension mechanism.  Can you compare them and see if your procedure is the same or the equivalent?  If it differs you may want to use these steps to see if it resolves your problem.

From the Eclipse client:
1.  Create a feature project and add the plugin to the feature.xml.
2.  Create an update site project and add the feature to the site.xml.   It's better to use the UI to add the feature instead of modifying the site.xml manually.
3.  Open the site.xml and click on Build All.
4.  Verify that your feature and plugin are generated in the update site project.
5.  Export this update site project to a zip file.

On the Server:
1.  Go to the Admin Console and reset the server so it will reprovision on next restart.
2.  Copy and extract the zip file to the <install_dir>/server/conf/ccm/sites directory.
3.  Verify that in the <install_dir>/server/conf/ccm/sites directory, you have a new directory that have the following folders and files:   features, plugins, site.xml.
4.  Go to <install_dir>/server/conf/ccm/provision_profiles directory.
5.  Make a copy of any existing ini file.
6.  Edit the new ini file and change the url to point to the directory directory, and the featureid to your feature.
7.  Restart the server.
Kristof Van Sever selected this answer as the correct answer

Comments
Kristof Van Sever commented Dec 05 '13, 12:27 p.m.

Hi Daniel


This is what I did, except that I put the  feature folder in <install_dir>/server and had the .ini on

url=file:../PHPScanner
featureid=PHPScannerFeature


Daniel Bruce commented Dec 06 '13, 5:44 a.m.
JAZZ DEVELOPER

Hi Kristof,

I was able to add your scanner to a RTC 4.0.3 server running locally on my laptop and have it show up in the scanner selection dialog.  However it took me two attempts. My first attempt failed to show up in the selection dialog because when I added the plugin.xml file to the scanner plugin project, I failed to add the plugin.xml file to the build.properties file so it was not added to the plugin jar.  Verify that your plugin jar in the update site plugins folder has a plugin.xml file.


Kristof Van Sever commented Dec 09 '13, 6:00 a.m.

Hi Daniel,


I made a new Plugin, exactly following the deployment the way you explained it and making sure the plugin.xml was there. It however still does not appear in the list. I uploaded a zip of the plugin's export to https://www.dropbox.com/s/jh53ffvuwuxvcvt/TestPHPScanner.zip if you'd be so kind to take a look at it

Thanks,

Kristof 


Daniel Bruce commented Dec 09 '13, 9:46 p.m.
JAZZ DEVELOPER

Hi Kristof,

When I tried to install your update site on my server I got this error in the ccm.log:  2013-12-09 21:27:56,121 [http-bio-9443-exec-50 @@ 21:27 dan /ccm/service/com.ibm.team.enterprise.metadata.scanner.common.service.IMetadataScannerService] ERROR se.metadata.scanner.service.MetadataScannerFactory  - The com.kristof.testphpscanner scanner failed to register.  Namespace must be absolute

You original namespace was "http://www.example.com/newscanner/"  which worked for me but your namespace for the zip you uploaded to dropbox is "TestPHPScanner.scanner1".  Try adding "http://" to the beginning of the namespace and redeploy. 


Kristof Van Sever commented Dec 10 '13, 7:22 a.m.

Hi Daniel,


I changed the namespace (and added the label, which I had forgotten) and it ended up in the list! So this little "hello world" works now (apart from an Unhandled event loop exception that appears in the Eclipse error log when adding the Scanner to the language definition.

Thanks a bunch for your repeated help, it's very, very, very appreciated!

One other answer



permanent link
Daniel Bruce (9135) | answered Dec 04 '13, 2:59 p.m.
JAZZ DEVELOPER
Hi Kristof,

Can you paste your scanner extension point from plugin.xml?  Also are you trying to add the scanner to a zOS or IBM i language definiton?

Dan

Comments
Kristof Van Sever commented Dec 05 '13, 3:11 a.m.

Hi Daniel,


Since I'm experimenting with the technology now to learn more about it, I'm interested in adding scanners to both zOS and i series definitions. And if possible I'd like to be able to add own definitions (for example for regular PC architectures) although I'm not sure whether that's possible. 

My entire plugin.xml information is in a following comment


Kristof Van Sever commented Dec 05 '13, 3:14 a.m.
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>   <extension  point="com.ibm.team.enterprise.metadata.scanners">
<scanner category="all"             class="phpscanner.PHPScanner"
excludeFiles="*.properties,*.xml,.*"             id="com.sample.scanner"
label="New Scanner"  namespace="http://www.example.com/newscanner/"
propertyProviderClass="phpscanner.PHPPropertyProvider"
type="general">
scanner>
   </extension>
</plugin>

Daniel Bruce commented Dec 05 '13, 9:41 a.m.
JAZZ DEVELOPER

Hi Kristoff,

I asked about the language definition types just to make sure you have the category set correctly i.e. "zos", "ibmi", or "all".  It looks good in your example.  Can you verify that you pasted the XML correctly?  The end scanner tag is missing  "</".  Is this a typo in the copy and paste?  If not then it is an error in the plugin.xml and may be preventing the extension from showing up in the scanner selection dialog.


Kristof Van Sever commented Dec 05 '13, 9:55 a.m.

Hi Daniel. This was indeed a small copy/paste typo. I had to truncate spaces/tabs a bit so it would fit within the forum character limit and it got removed along. I made a pastebin with the code I use in my plugin.



The ini file I use for the server itself has

url=file:../PHPScanner
featureid=PHPScannerFeature

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.