Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash After Connect to HBase #40

Closed
yepher opened this issue May 20, 2013 · 4 comments
Closed

Crash After Connect to HBase #40

yepher opened this issue May 20, 2013 · 4 comments

Comments

@yepher
Copy link

yepher commented May 20, 2013

Each time I run h-rider (643010b ) it crashes with the following console output:

[target (master)]$ java -jar h-rider-1.0.7.0.jar
2013-05-20 14:21:51,680 INFO [AWT-EventQueue-0] RunnableAction : Action 'compare-versions' started.
2013-05-20 14:21:53,053 ERROR [compare-versions] Window : Failed to retrieve update information from the URL: https://raw.github.com/NiceSystems/hrider/master/update.properties
java.lang.NullPointerException
at java.util.regex.Matcher.getTextLength(Matcher.java:1140)
at java.util.regex.Matcher.reset(Matcher.java:291)
at java.util.regex.Matcher.(Matcher.java:211)
at java.util.regex.Pattern.matcher(Pattern.java:888)
at java.util.regex.Pattern.split(Pattern.java:997)
at java.util.regex.Pattern.split(Pattern.java:1059)
at hrider.system.Version.(Version.java:43)
at hrider.system.Version.compare(Version.java:37)
at hrider.ui.forms.Window.compareVersions(Window.java:333)
at hrider.ui.forms.Window.access$1200(Window.java:59)
at hrider.ui.forms.Window$6.run(Window.java:241)
at hrider.actions.RunnableAction.run(RunnableAction.java:132)
at java.lang.Thread.run(Thread.java:680)
2013-05-20 14:21:53,056 INFO [compare-versions] RunnableAction : Action 'compare-versions' completed.
2013-05-20 14:22:00,089 INFO [AWT-EventQueue-0] RunnableAction : Action '127.0.0.1' started.
2013-05-20 14:22:00.294 java[94227:7007] Unable to load realm info from SCDynamicStore
2013-05-20 14:22:00,637 INFO [127.0.0.1] RunnableAction : Action '127.0.0.1' completed.
2013-05-20 14:22:01,215 INFO [AWT-EventQueue-0] JavaPackage : Loading classes from package 'hrider.converters'
2013-05-20 14:22:01,216 INFO [AWT-EventQueue-0] JavaPackage : Loading classes from jar '/Users/chris/Software/hrider/target/Users/chris/Software/hrider/target/h-rider-1.0.7.0.jar'
2013-05-20 14:22:01,217 INFO [AWT-EventQueue-0] JavaPackage : Loading classes from folder '/Users/chris/Software/hrider/target/Users/chris/Software/hrider/target/converters/classes'
Exception in thread "AWT-EventQueue-0" java.lang.ExceptionInInitializerError
at hrider.data.ColumnQualifier.(ColumnQualifier.java:32)
at hrider.ui.views.DesignerView.initializeColumnsTable(DesignerView.java:1273)
at hrider.ui.views.DesignerView.(DesignerView.java:167)
at hrider.ui.forms.Window.loadView(Window.java:439)
at hrider.ui.forms.Window.loadViews(Window.java:421)
at hrider.ui.forms.Window.createAndShowGUI(Window.java:271)
at hrider.ui.forms.Window.access$1300(Window.java:59)
at hrider.ui.forms.Window$7.run(Window.java:256)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:708)
at java.awt.EventQueue.access$400(EventQueue.java:82)
at java.awt.EventQueue$2.run(EventQueue.java:669)
at java.awt.EventQueue$2.run(EventQueue.java:667)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:678)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Caused by: java.lang.IllegalArgumentException: converter cannot be null
at hrider.data.ColumnType.(ColumnType.java:60)
at hrider.data.ColumnType.(ColumnType.java:55)
at hrider.data.ColumnType.(ColumnType.java:33)
... 22 more

@yepher
Copy link
Author

yepher commented May 20, 2013

I debugged this a little. It looks like the logic is not good in: hrider.io.PathHelper.normalise(String). Line 214 It is stripping off the leading "/" of the path which makes it not valid.

I added some code here "https://github.com/yepher/hrider.git" that gets the project to work for me.

@icher-g
Copy link

icher-g commented May 21, 2013

Hi,

The first issue only happens if you run h-rider from within the development environment. In any case I fixed the code.

In regards to the second issue, it was done on purpose because the preceding slash caused custom converters not to be found/loaded. What issue did you have with the PathHelper?

@yepher
Copy link
Author

yepher commented May 21, 2013

Here is what I see in hrider.io.PathHelper.normalise(String) which does not quite seem to work on my machine:

The initial path is:
/Users/john/Software/hrider/target/classes/hrider/converters/

It startsWith '/' so it is converted to "file:/Users/john/Software/hrider/target/classes/hrider/converters/"

Then this is called

URI uri = new URI(normalizedPath); 

which converts it back to "/Users/john/Software/hrider/target/classes/hrider/converters/"

The path starts with "/" so it is converted to: "Users/john/Software/hrider/target/classes/hrider/converters/"

This is eventually passed back to JavaPackage::getClasses(...) which has code like this:

logger.debug("Resource URL: %s", url.toString());
            logger.debug("Normalized path: %s", filePath);

            if (filePath.endsWith(".jar")) {
                classes.addAll(getClassesFromJar(loader, new File(filePath), packageName));
            }
            else {
                classes.addAll(getClassesFromFolder(loader, new File(filePath), packageName));
            }
        }

new File("Users/john/Software/hrider/target/classes/hrider/converters/") fails because it does not have the leading "/".

@icher-g
Copy link

icher-g commented May 22, 2013

Thanks Chris,

The normalize path method uses URI class to replace internet related characters such as %20 etc.
The URI class in its turn always adds a slash to the beginning of the path even though there wasn't any (not completely true because the slash is added when the 'file:/' string is appended to the path). So I removed the slash and it worked perfectly on Windows but apparently it doesn't work on linux.

In any case I added a check so if the path was originally started with the slash it won't be removed.

I open another issue as a bug with a more appropriate description.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants