Skip to main content

Upgrade headaches.

8 replies [Last post]
bakarirum
Offline
Joined: 2005-07-07
Points: 0

This issue has been talked about before and I am sure I filed a complaint. However, I am going to address it again. I have NB6.0. I was using jmaki in a project. The latest release comes out and I update the IDE. Now my project doesn't work. I even went through and did the "update" under the frameworks tab of the project and let it update all the Yahoo resources. (I then manually deleted resources for widgets I do not use). Now, my page is not rendering properly. I have my page with a "css-tabbed" page (just know it is third party styling and javascript to present tabbed pages). Before the upgrade all was working. Now, the styling on my page is messed up and I cannnot see portions of my page. Our development is geared towards IE 6.0 as it is an intranet application, however if I pull up the page in Firefox, I get an error message that states: Unable to create an instance of jmaki.widgets.yahoo.dataTable.Widget. Enable logging for more details. I have logging enabled I think. I turned on debug=true in glue.js file. Now we have multiple people using my branch in CVS and I cannot just start this project over.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
bakarirum
Offline
Joined: 2005-07-07
Points: 0

I don't know what version of jMaki I had before. The yahoo.dataTable widget version is 2.4. I updated the jMaki plugin through NetBeans (which updates the server code) and that is when my problems started. I noticed that between some version you changed the use of the jmaki_uncompressed.js and jmaki.js files to now be jmaki-min.js and jmaki.js. In the first situation the jmaki.js file is the compressed version of the library that should be called and loaded through jmaki. In the second situation jmaki-min.js is now the one called and loaded through jmaki and the jmaki.js file is now the "uncompressed" one. So this is what happened, originally. After the upgrade, the JSP tag library was writing "jmaki-min.js" to the html document. Since my project was not upgraded the "new" jmaki formats that I noted above were not in my project workspace. So I went to the project properties in NetBeans to the Frameworks section and clicked Update jMaki resources. By doing so, all libraries in the project get updated and I get all the resources for every category of widgets that are imported for Yahoo. Thus, all the Yahoo and Dojo widgets are updated in my project. (I do not care to go down this road again of how this needs to be changed to update only the resources currently being used). I go back and check my widget.json file in my yahoo/dataTable folder and it is now pointing to version 2.5. I check my resources folder and the correct jmaki-min and jmaki js files are in place. I re-run my application and this is when I notice the error above. I would not have a problem posting my war file, but there is a lot of business specific logic in there and it would take a long time for anyone to change around to use on his/her machine. I can try to take my NB5.5 install and create a test application and import the project into NB6.0 and do those steps again to reproduce the error if you think it will help. The error the other poster gets is the initial error I got until I performed the steps above to get the correct jmaki.js and jmaki-min.js files.

aside: I do like the fact that you are zipping up the previous resource folder into the setup folder and saves off the settings so we can go back to those version or review them. That was a good decision on the team's part.

bakarirum
Offline
Joined: 2005-07-07
Points: 0

Carla,
I have figured out the heart of the problem. If I go through all the steps of updating jMaki and also updating the resources within the project, then I can get my project updated. However, since I am using a third party tool that also redefines the window.onload event, there is a problem. In IE, the piece using my third party code is not working. After recreating the steps in my project this morning, it works in Firefox. This is an internal application and we exclusively use IE, this will not work. I cannot create code to reproduce the problem. It only occurs in my "complicated" application. Part of the problem with trying to resolve this is IE's stubbornness when it comes to JavaScript debugging and death of execution when an error occurs. I am not sure how error handling is implemented in jMaki, but I have noticed that some errors are not propagated back out to the page and they get "lost" When they get lost, there is no way to tell where any glitches are. I will be happy to send you the WAR file, but it will take some time as I will have to remove the "data" access calls and replace them with hard-coded values. Yes, I am still frustrated, but I am pretty sure I can keep the new version of jMaki and go back to yahoo dataTable 2.4 version and it works. I wonder if the problem is the new "resizing" functionality that the table does after it loads where it resizes the columns based upon the width of the data in the columns.

carlavmott
Offline
Joined: 2005-02-10
Points: 0

I'm glad that you were able to get things to a point that showed it could work.

You are right that we changed the name of files from jmaki.js to jmaki-min.js. I even made those changes to the samples and just didn't think about how it would affect others. We discussed that change on the dev list but we didn't post something on the forum. In the future, we will post something so that users see that a change is coming and can voice an opinion.

I will look into the problem with error handling you described. Please file an issue so we can track it. One more thing you can try is to go into jmaki.js (I copy jmaki.js to jmaki-min.js to debug after saving off the compressed version). and set this.verboseDebug = false; to true and see if you get more info. I can't think of a reason why there would be an issue even though your 3rd party app redefines window.onload. I will have to ask Greg if he made any changes but he is getting married today and so will not hear from him for at least one week.

I think that you should be able to take the yahoo widget lib from your previous project into your upgraded project and not have any problems. the update to 2.5 happened pretty late in the release cycle and we were testing the new version of jMaki core with "old" yahoo for a while. You will have to bring over some bug fixes like the one I did for allowing tables to have a scroll bar. If you need help let me know.

Sorry for the frustration. Let's figure out a way to make things better in the future.

carla

bakarirum
Offline
Joined: 2005-07-07
Points: 0

I have tracked down the problem. If I use version 2.5 of the Yahoo! dataTable, there is a JavaScript(JS) error that is being thrown. I was able to add some try catches around the jMaki code and track the error all the way to the problem code. The jMaki error handling is redefining the onerror function. This is causing jMaki to catch the JS error and write the error to the document properly. However, since in IE if an error occurs, the JS stops executing, I could never see the error message being written to the document. The reason is because the error is occurring the in the window.onload event that is appended in jMaki. So during this method call, the JS blows up. jMaki writes the error to the document and the execution of the JS stops. Well my third party software's function which was wrapped up in the jMaki event's onload is never being executed and since some parts of the document are "hidden" we cannot see the error message. So this is why I see strange behavior in IE. Now back to the root of the problem.

The problem occurs in the actual creation of the widget in the component.js file for the dataTable.

_widget.dataTable = new YAHOO.widget.DataTable(wargs.uuid, _widget.columns, ds,
{
scrollable: scrollable, height:"8em",
selectionMode : "single",
caption:"",
paginated: paginated, // Enables built-in client-side pagination
paginator: { // Configurable options
containers: null, // Create container DIVs dynamically
currentPage: 1, // Show page 1
dropdownOptions: [10,25,50], // Show these in the rows-per-page dropdown
pageLinks: 0, // Show links to all pages
rowsPerPage: rowsPerPage // Show up to n-rows per page
}
});
]]>

This call throws a javascript error of "Invalid argument". This error message is being thrown from the Yahoo widget code. I did not track it down any further than this.

I am just brainstorming here, but could it be possible that the "required" data for the column/row definition has changed and since I just did an upgrade and did not change my widget call, I need to missing required attribute?

Here is my calling code:

value="{columns : [
{ label : 'Name', id : 'name' , width : '200px'},
{ label : 'Phone ', id : 'phone' , width : '200px'},
{ label : 'Company', id : 'company' , width : '200px'},
{ label : 'Title', id : 'title' , width : '200px'},
{ label : 'Email', id : 'email' , width : '200px'},
{ label : 'Remarks', id : 'remarks' , width : '350px'},
{ label : 'id', id : 'id' , width : '100px'}
], rows : [ ]
}"
subscribe="/table/results/contacts"
publish="/table/results/contacts"
/>

]]>

If I use the newest version of jMaki-min.js plus version 2.4 of the dataTable all is well. It happens when I use version 2.5 of the dataTable.

Is there anything else I can provide?

bakarirum
Offline
Joined: 2005-07-07
Points: 0

This post is more for informational purposes than anything.

I some point in the jMaki update process (from my experience I am guessing between NB plugin version 1.7 and 1.7.1) the file naming standards for the jMaki JavaScript files changed. They used to be jMaki.js and jMaki-uncompressed.js. The jMaki framework (namely the jsp tag library) would write out */resources/jMaki.js when importing the JavaScript file into the HTML document. This was because the jMaki.js file was the compressed file for quick downloads. With an update, the files were changed to jMaki-min.js and jMaki.js. The jMaki-min.js file is now the compressed file for quick downloads while the jMaki.js file is the uncompressed verbose file. The jsp tag library was changed to now write out */resources/jMaki-min.js. This all great and everything except in a larger shop in which we have multiple people working on one project and each person might be using a different version of jMaki.

We are using CVS to manage our source code (upgrading to SVN sometime this year). The problem occurs when people are merging changes. The jMaki.js file in one version is in the old format (compressed and used in jsp tag library) while the jMaki.js file in the other version is in the new format (uncompress and not used in jsp tab library). This will cause either a failure on the merge or an incorrect merge as it will see one file as just one long string and the other as a file with lots of different lines. Either way, there is a problem here. So the problem is not inherent to NetBeans or jMaki, but the problem arises due to the change within jMaki.

Therefore, when we decide to finally upgrade this application we will have to upgrade the whole department's jMaki version as well. We will have to keep everyone in sync and will have to "trick" the CVS merge process to handle the problems above. This is a very rigid requirement and not at all pleasing.

bakarirum
Offline
Joined: 2005-07-07
Points: 0

was finally able to get the debug messages..

now getting this (in firefox only, IE just doesn't display).

Error loading jmaki.widgets.yahoo.dataTable.Widget : id=ContactsDataTable
Script: undefined (line: 309).
Message: YAHOO is not defined
Error loading jmaki.widgets.yahoo.dataTable.Widget : id=ResultsDataTable
Script: undefined (line: 309).
Message: YAHOO is not defined

carlavmott
Offline
Joined: 2005-02-10
Points: 0

Hi bakarirum,

What version of jMaki were you using before the upgrade? In 1.1 we did update to Yahoo 2.5. Have you tried to inlcude all of Yahoo and get that running and then prune the parts of Yahoo that you don't need. Did you change any of the css files under the resources dir in your original app? Any way you can send me a war file? carla dot mott at sun dot com

Thanks,
Carla

dynamicmethods
Offline
Joined: 2008-01-13
Points: 0

I am also getting same issue ,jmaki.widgets.yahoo.dataTable does not able render.

jmaki is not defined
[Break on this error]