Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » scout » Null Pointer Exception when accessing the properties of AbstractMySqlSqlService
Null Pointer Exception when accessing the properties of AbstractMySqlSqlService [message #984556] Wed, 14 November 2012 20:05 Go to next message
Jens Vogel is currently offline Jens Vogel
Messages: 2
Registered: November 2012
Junior Member
Hi, I installed the MySQL JDBC Driver from [1], activated the driver in the project properties and added a MySqlSqlService under server/Common Services/Sql Services following [2]. If I try to access the properties of that service I get the error attached in stacktrace.txt.

BTW: I worked the minicrm tutorial - with Derby all went fine. Now I want to get access to an additional MySQL-database.

Many thanks for your time!

Regards Jens

[1] http://marketplace.eclipse.org/content/jdbc-drivers-eclipse-scout#.UKP1n6W6y9s
[2] http://wiki.eclipse.org/Scout/Tutorial/3.8/Add_JDBC_Drivers_for_Eclipse_Scout
Re: Null Pointer Exception when accessing the properties of AbstractMySqlSqlService [message #985173 is a reply to message #984556] Thu, 15 November 2012 07:54 Go to previous messageGo to next message
Jeremie Bresson is currently offline Jeremie Bresson
Messages: 698
Registered: October 2011
Senior Member
You are experiencing difficulties in the Scout SDK. Can you indicate the version of your Eclipse and the platform? If you could also add a screenshot... This will allow us to try to reproduce your bug.

----

I do not know the property you want to set, but if the properties view is not working, you can set it in the code:

For example:

@Override
protected String getConfiguredJdbcMappingName() {
  return "jdbc:sqlserver://localhost:1433;databaseName=MY_DATABASE";
}


Correspond to the property: "Jdbc Driver Name"

Here as picture:

index.php/fa/12329/0/

It is an example with a Derby database, because I do not have MySQL installed in this project. Properties view and java code are synchronised the same way everywhere.


In Scout the Java code wins over the SDK tools. There is no temp file for the content of the property view or stuff like that.
Re: Null Pointer Exception when accessing the properties of AbstractMySqlSqlService [message #985327 is a reply to message #985173] Thu, 15 November 2012 10:05 Go to previous messageGo to next message
Jeremie Bresson is currently offline Jeremie Bresson
Messages: 698
Registered: October 2011
Senior Member
I could reproduce your bug:

Eclipse for Scout Developers
Version: Juno Service Release 1
Build id: 20120920-0800
Platform: win32

Code of DefaultMySqlSqlService:
import com.bsiag.scout.rt.server.jdbc.AbstractMySqlSqlService;
import org.eclipse.scout.service.IService2;

public class DefaultMySqlSqlService extends AbstractMySqlSqlService implements IService2{
}


See attached screenshot.

Could you file a bug?
Re: Null Pointer Exception when accessing the properties of AbstractMySqlSqlService [message #985358 is a reply to message #985327] Thu, 15 November 2012 10:34 Go to previous messageGo to next message
Jens Vogel is currently offline Jens Vogel
Messages: 2
Registered: November 2012
Junior Member
bug filed as https://bugs.eclipse.org/bugs/show_bug.cgi?id=394374
Re: Null Pointer Exception when accessing the properties of AbstractMySqlSqlService [message #985404 is a reply to message #985358] Thu, 15 November 2012 11:17 Go to previous messageGo to next message
Jeremie Bresson is currently offline Jeremie Bresson
Messages: 698
Registered: October 2011
Senior Member
Thank you.
Re: Null Pointer Exception when accessing the properties of AbstractMySqlSqlService [message #985681 is a reply to message #985358] Thu, 15 November 2012 16:46 Go to previous messageGo to next message
Jeremie Bresson is currently offline Jeremie Bresson
Messages: 698
Registered: October 2011
Senior Member
From what I have analysed from the stacktrace:

The problem occurs when the SDK try to compute the default value:
Quote:

at org.eclipse.scout.sdk.workspace.type.config.PropertyMethodSourceUtility.getMethodReturnValue(PropertyMethodSourceUtility.java:86)
at org.eclipse.scout.sdk.workspace.type.config.ConfigurationMethod.computeDefaultValue(ConfigurationMethod.java:88)


I think the problem is that I have no source for the com.bsiag.scout.rt.server.jdbc plugin...

I see two fix:
1) I see no reason why the source code is not provided for com.bsiag.scout.rt.server.jdbc

2) Fix the SDK: the properties view should not crash if something is null at:
org.eclipse.scout.sdk.workspace.type.config.PropertyMethodSourceUtility.getMethodReturnValue(PropertyMethodSourceUtility.java:86).
=> Should the fix in Bug 394374

[Updated on: Thu, 15 November 2012 16:47]

Report message to a moderator

Re: Null Pointer Exception when accessing the properties of AbstractMySqlSqlService [message #985845 is a reply to message #985681] Fri, 16 November 2012 11:09 Go to previous messageGo to next message
Jeremie Bresson is currently offline Jeremie Bresson
Messages: 698
Registered: October 2011
Senior Member
@Jens Vogel:
Until the fixes are submitted, I hope you know that you can edit the code directly:
index.php/fa/12360/0/

With CTRL+Space you can see all the getConfigured* methods that are available. They correspond to what the SDK should display in the properties view.

Re: Null Pointer Exception when accessing the properties of AbstractMySqlSqlService [message #985859 is a reply to message #985681] Fri, 16 November 2012 12:49 Go to previous messageGo to next message
Matthias Villiger is currently offline Matthias Villiger
Messages: 78
Registered: September 2011
Member
I changed the error handling on the properties view for 3.9.0 M4 (see bug 394374).

For Juno I suggest to create a new JDBC feature build including the sources. This has the following advantages:
1. the fix can be provided out of the release cylcle of Eclipse and will therefore be availablel before SR2
2. the sources of these features should be provided anyway (independent of this bug). I see no reason why the sources should be kept closed.
3. there is no risk to introduce a new/changed behaviour or other problem for Juno SR2

what are your opinions?

regards,
m
Re: Null Pointer Exception when accessing the properties of AbstractMySqlSqlService [message #985895 is a reply to message #985859] Fri, 16 November 2012 15:30 Go to previous messageGo to next message
Ken Lee is currently offline Ken Lee
Messages: 97
Registered: March 2012
Member
Quote:

For Juno I suggest to create a new JDBC feature build including the sources. This has the following advantages:
1. the fix can be provided out of the release cylcle of Eclipse and will therefore be availablel before SR2
2. the sources of these features should be provided anyway (independent of this bug). I see no reason why the sources should be kept closed.
3. there is no risk to introduce a new/changed behaviour or other problem for Juno SR2

what are your opinions?


Since providing the source bundles and features for the JDBC drivers for Eclipse Scout do solve the problem, I recommend that the patch should be applied for the Kepler release only and not for Juno if you think that we could risk changing the behavior.

I provided a new build of the JDBC driver at the Eclipse Marketplace that includes the source features and bundles.
To update to the latest build, click on the menu [Help]->[Check for Update] or [Help]->[Install New Software...] and add the URL http://tools.bsiag.com/marketplace/jdbc

Re: Null Pointer Exception when accessing the properties of AbstractMySqlSqlService [message #985909 is a reply to message #985895] Fri, 16 November 2012 16:03 Go to previous message
Jeremie Bresson is currently offline Jeremie Bresson
Messages: 698
Registered: October 2011
Senior Member
Ken Lee wrote on Fri, 16 November 2012 16:30
I provided a new build of the JDBC driver at the Eclipse Marketplace that includes the source features and bundles.
To update to the latest build, click on the menu [Help]->[Check for Update] or [Help]->[Install New Software...] and add the URL http://tools.bsiag.com/marketplace/jdbc


I installed the new version (see screenshot) and it works now with Juno-SR1. Thanks a lot.

-> That is my first point in #msg_985681


For the second point, I added a patch and a comment in bug 394374. For me getSource() can be null. Here the javadoc:
/**
 * Returns the source code associated with this element.
 * This extracts the substring from the source buffer containing this source
 * element. This corresponds to the source range that would be returned by
 * <code>getSourceRange</code>.
 * <p>
 * For class files, this returns the source of the entire compilation unit
 * associated with the class file (if there is one).
 * </p>
 *
 * @return the source code, or <code>null</code> if this element has no
 *   associated source code
 * @exception JavaModelException if an exception occurs while accessing its corresponding resource
 */
String getSource() throws JavaModelException;


My 4 lines patch add the null check. (This could be fixed in Juno).


.

[Updated on: Fri, 16 November 2012 16:06]

Report message to a moderator

Previous Topic:Refreshing the pages
Next Topic:Testing a scout application
Goto Forum:
  


Current Time: Thu Sep 18 15:45:35 GMT 2014

Powered by FUDForum. Page generated in 0.05601 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software