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

Hibernate bundle not getting initialized #2

Open
madhandennis opened this issue Jan 9, 2014 · 6 comments
Open

Hibernate bundle not getting initialized #2

madhandennis opened this issue Jan 9, 2014 · 6 comments

Comments

@madhandennis
Copy link
Contributor

Hi,

Thanks for this awesome code base. However I would like to check if you have encountered any issues when integrating the hibernate bundle with this? I have been trying to, however hibernate does not seem to get run and so getSessionFactory always returns null.

Any pointers would be appreciated :)

Thanks

Best Regards,
Madhan

@chanced
Copy link

chanced commented Jan 16, 2014

Any luck with this? I think we are running into it too

@madhandennis
Copy link
Contributor Author

Hi,

Yes its quite a simple fix. Just edit the file https://github.com/twilio/wiztowar/blob/master/src/main/java/com/twilio/wiztowar/DWAdapter.java and add the line:

bootstrap.runWithBundles(configuration, environment);

just before the dwService.run(configuration, environment); statement. Its at around line 117. So the code has to look like this:

            environment.start();
            bootstrap.runWithBundles(configuration, environment);
            dwService.run(configuration, environment);
            addHealthChecks(environment);
            final ServletContext servletContext = ServletContextCallback.getServletContext();

Now hibernate and any other bundle will get properly initialized and work fine :)

@chanced
Copy link

chanced commented Jan 16, 2014

You may very well be my new favorite person. Testing now.

-- 
Chance Dinkins

From: Madhan Dennis Madhan Dennis
Reply: twilio/wiztowar [email protected]
Date: January 16, 2014 at 4:43:26 AM
To: twilio/wiztowar [email protected]
Subject:  Re: [wiztowar] Hibernate bundle not getting initialized (#2)
Hi,

Yes its quite a simple fix. Just edit the file https://github.com/twilio/wiztowar/blob/master/src/main/java/com/twilio/wiztowar/DWAdapter.java and add the line:

bootstrap.runWithBundles(configuration, environment);

just before the dwService.run(configuration, environment); statement. Its at around line 117. So the code has to look like this:

        environment.start();
        bootstrap.runWithBundles(configuration, environment);
        dwService.run(configuration, environment);
        addHealthChecks(environment);
        final ServletContext servletContext = ServletContextCallback.getServletContext();

Now hibernate and any other bundle will get properly initialized and work fine :)


Reply to this email directly or view it on GitHub.

@chanced
Copy link

chanced commented Jan 16, 2014

It’s looking promising.

To test, go to /service/messages
-- 
Chance Dinkins

From: Madhan Dennis Madhan Dennis
Reply: twilio/wiztowar [email protected]
Date: January 16, 2014 at 4:43:26 AM
To: twilio/wiztowar [email protected]
Subject:  Re: [wiztowar] Hibernate bundle not getting initialized (#2)
Hi,

Yes its quite a simple fix. Just edit the file https://github.com/twilio/wiztowar/blob/master/src/main/java/com/twilio/wiztowar/DWAdapter.java and add the line:

bootstrap.runWithBundles(configuration, environment);

just before the dwService.run(configuration, environment); statement. Its at around line 117. So the code has to look like this:

        environment.start();
        bootstrap.runWithBundles(configuration, environment);
        dwService.run(configuration, environment);
        addHealthChecks(environment);
        final ServletContext servletContext = ServletContextCallback.getServletContext();

Now hibernate and any other bundle will get properly initialized and work fine :)


Reply to this email directly or view it on GitHub.

@chanced
Copy link

chanced commented Jan 22, 2014

Hah, I was coming back to post this as well. I ran into a problem on cluster mode loading the config too. I'll put in another PR for it

@madhandennis
Copy link
Contributor Author

What kinda problem? And what cluster mode are you referring to?

ChristerF added a commit that referenced this issue May 7, 2014
Ensuring that bundled get initialized properly. Fix for issue #2
ChristerF added a commit that referenced this issue May 27, 2014
* 'master' of github.com:twilio/wiztowar:
  Ensuring that bundled get initialized properly. Fix for issue #2
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