You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@isis.apache.org by Erik de Hair <e....@pocos.nl> on 2016/04/29 15:31:50 UTC

Starting app with AppManifest (1.12.1)

Hi,

When trying to run our application with org.apache.isis.WebServer using 
an AppManifest I get the following error:

15:07:14,497  [IsisWicketApplication main       ERROR]  Failed to initialize
com.google.inject.CreationException: Unable to create injector, see the 
following errors:

1) A binding to org.apache.isis.applib.AppManifest was already 
configured at 
org.apache.isis.core.runtime.runner.IsisInjectModule.configure(IsisInjectModule.java:107).
   at webapp.PortalApplication$1.configure(PortalApplication.java:94) 
(via modules: com.google.inject.util.Modules$OverrideModule -> 
webapp.PortalApplication$1)

1 error
     at 
com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:466)
     at 
com.google.inject.internal.InternalInjectorCreator.initializeStatically(InternalInjectorCreator.java:155)
     at 
com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:107)
     at com.google.inject.Guice.createInjector(Guice.java:96)
     at com.google.inject.Guice.createInjector(Guice.java:73)
     at com.google.inject.Guice.createInjector(Guice.java:62)
     at 
org.apache.isis.viewer.wicket.viewer.IsisWicketApplication.init(IsisWicketApplication.java:262)
     at webapp.PortalApplication.init(PortalApplication.java:104)
     at org.apache.wicket.Application.initApplication(Application.java:823)


ThenewIsisWicketModule-method of our PortalApplication:

@Override
protectedModule newIsisWicketModule()
{
    finalModule isisDefaults =super.newIsisWicketModule();

    finalModule resellerPortalOverrides =newAbstractModule()
    {
       @Override
       protected voidconfigure()
       {
          bind(PageClassList.class).to(PortalPageClassList.class);
          bind(String.class).annotatedWith(Names.named("applicationName")).toInstance("ITCO Portal");
          bind(String.class).annotatedWith(Names.named("applicationCss")).toInstance("css/application.css");
          bind(String.class).annotatedWith(Names.named("applicationJs")).toInstance("scripts/application.js");
          bind(String.class).annotatedWith(Names.named("welcomeMessage")).toInstance(readLines("welcome.html"));
          bind(String.class).annotatedWith(Names.named("aboutMessage")).toInstance(readLines("about.html"));
          bind(String.class).annotatedWith(Names.named("brandLogoHeader")).toInstance("/portal/images/Pocos-Logo-Powering-portal.png");
          bind(String.class).annotatedWith(Names.named("brandLogoSignin")).toInstance("/portal/images/Pocos-Logo-Powering-portal.png");
          bind(InputStream.class).annotatedWith(Names.named("metaInfManifest")).toProvider(Providers.of(getServletContext().getResourceAsStream("/META-INF/MANIFEST.MF")));
          bind(ComponentFactoryRegistrar.class).to(PortalComponentFactoryRegistrar.class);
          bind(AppManifest.class).to(PortalModuleAppManifest.class);
       }
    };

    returnModules.override(isisDefaults).with(resellerPortalOverrides);
}

Did I forget something?

Erik



Re: Starting app with AppManifest (1.12.1)

Posted by Dan Haywood <da...@haywood-associates.co.uk>.
On 2 May 2016 12:49, "Erik de Hair" <e....@pocos.nl> wrote:
>
> Hi Dan,
>
> While trying to create a simple app I found out the problem was in my
code. I had a method with @PostConstruct where a field (with @Injected)
being called was null. Shouldn't an injected field be set before the
PostConstruct-method is called?
>

Yes, they should, and I believe this works. I just added a quick
@PostConstruct methods to the SimpleObjects domain service in the simpleapp
archetype, and I can see that the RepositoryService is correctly injected.

Possible reason for null.. if might be that there's a superclass that also
has this field, meaning that the subclass field isn't injected into... I
think I once saw this.
Otherwise, not sure, is the service injected subsequently/at all? Need a
rest case app to reproduce problem, I think.

> I can go on for now because I solved this in another way.
>
> But now I've got another problem. I'm running the app in prototyping mode
using WebServer-class. It starts without context-path set and I can't open
any page. Should the context path be configured somewhere?
>

Hmm, perhaps. I guess I'm not sure, actually. In the simpleapp archetype it
serves up the index.html, swagger-ui/index.html and application.css files
directly from their respective directories under src/main/webapp, are none
of these being served fire you either?

Again, think I need a test case app to reproduce.  Also, would be
worthwhile doing a directory-wise diff of your current app vs that
generated by the simpleapp archetype.

HTH,
Dan

> Erik
>
>
> On 04/29/2016 04:11 PM, Dan Haywood wrote:
>>
>> Bit difficult to say without seeing the reason for the
NullPointerException.
>>
>> You might want to use the current simpleapp archetype to generate a blank
>> webapp, and then do a merge over.  Steve Cameron did something similar
>> recently, didn't seem to take him long...
>>
>>
>>
>> On 29 April 2016 at 14:53, Erik de Hair <e....@pocos.nl> wrote:
>>
>>> Hi Dan,
>>>
>>> On 04/29/2016 03:35 PM, Dan Haywood wrote:
>>>
>>>> remove the line:
>>>>
>>>>    bind(AppManifest.class).to(PortalModuleAppManifest.class);
>>>>
>>>> from the PortalApplication... I think the error says its already
>>>> configured, probably because the isis.appManifest property is set in
>>>> isis.properties (or equivalently specified as -m flag to
o.a.i.WebServer).
>>>>
>>>> If that's the case, it might be a documentation issue that needs
fixing.
>>>>
>>> Removing the line and setting the manifest property in isis.properties
>>> does work but now I get another exception:
>>>
>>> 15:50:23,239  [IsisWicketApplication main       ERROR]  Failed to
>>> initialize
>>> com.google.inject.ProvisionException: Unable to provision, see the
>>> following errors:
>>>
>>> 1) Error in custom provider,
>>>
org.apache.isis.core.runtime.system.transaction.IsisTransactionManagerException:
>>> java.lang.NullPointerException
>>>    at
>>>
org.apache.isis.core.runtime.runner.IsisInjectModule.provideIsisSystem(IsisInjectModule.java:127)
>>>    at
>>>
org.apache.isis.core.runtime.runner.IsisInjectModule.provideIsisSystem(IsisInjectModule.java:127)
>>>    while locating org.apache.isis.core.runtime.system.IsisSystem
>>>      for field at
>>>
org.apache.isis.viewer.wicket.viewer.IsisWicketApplication.isisSystem(IsisWicketApplication.java:149)
>>>    while locating webapp.PortalApplication
>>>
>>> 1 error
>>>      at
>>>
com.google.inject.internal.Errors.throwProvisionExceptionIfErrorsExist(Errors.java:482)
>>>      at
>>>
com.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:67)
>>>      at
>>>
com.google.inject.internal.InjectorImpl.injectMembers(InjectorImpl.java:984)
>>>      at
>>>
org.apache.isis.viewer.wicket.viewer.IsisWicketApplication.init(IsisWicketApplication.java:264)
>>>      at webapp.PortalApplication.init(PortalApplication.java:102)
>>>
>>>
>>>> let me know...
>>>>
>>>> Dan
>>>>
>>>>
>>>> On 29 April 2016 at 14:31, Erik de Hair <e....@pocos.nl> wrote:
>>>>
>>>> Hi,
>>>>>
>>>>> When trying to run our application with org.apache.isis.WebServer
using
>>>>> an
>>>>> AppManifest I get the following error:
>>>>>
>>>>> 15:07:14,497  [IsisWicketApplication main       ERROR]  Failed to
>>>>> initialize
>>>>> com.google.inject.CreationException: Unable to create injector, see
the
>>>>> following errors:
>>>>>
>>>>> 1) A binding to org.apache.isis.applib.AppManifest was already
configured
>>>>> at
>>>>>
>>>>>
org.apache.isis.core.runtime.runner.IsisInjectModule.configure(IsisInjectModule.java:107).
>>>>>     at webapp.PortalApplication$1.configure(PortalApplication.java:94)
>>>>> (via
>>>>> modules: com.google.inject.util.Modules$OverrideModule ->
>>>>> webapp.PortalApplication$1)
>>>>>
>>>>> 1 error
>>>>>       at
>>>>>
>>>>>
com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:466)
>>>>>       at
>>>>>
>>>>>
com.google.inject.internal.InternalInjectorCreator.initializeStatically(InternalInjectorCreator.java:155)
>>>>>       at
>>>>>
>>>>>
com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:107)
>>>>>       at com.google.inject.Guice.createInjector(Guice.java:96)
>>>>>       at com.google.inject.Guice.createInjector(Guice.java:73)
>>>>>       at com.google.inject.Guice.createInjector(Guice.java:62)
>>>>>       at
>>>>>
>>>>>
org.apache.isis.viewer.wicket.viewer.IsisWicketApplication.init(IsisWicketApplication.java:262)
>>>>>       at webapp.PortalApplication.init(PortalApplication.java:104)
>>>>>       at
>>>>> org.apache.wicket.Application.initApplication(Application.java:823)
>>>>>
>>>>>
>>>>> ThenewIsisWicketModule-method of our PortalApplication:
>>>>>
>>>>> @Override
>>>>> protectedModule newIsisWicketModule()
>>>>> {
>>>>>      finalModule isisDefaults =super.newIsisWicketModule();
>>>>>
>>>>>      finalModule resellerPortalOverrides =newAbstractModule()
>>>>>      {
>>>>>         @Override
>>>>>         protected voidconfigure()
>>>>>         {
>>>>>            bind(PageClassList.class).to(PortalPageClassList.class);
>>>>>
>>>>>
>>>>>
bind(String.class).annotatedWith(Names.named("applicationName")).toInstance("ITCO
>>>>> Portal");
>>>>>
>>>>>
>>>>>
bind(String.class).annotatedWith(Names.named("applicationCss")).toInstance("css/application.css");
>>>>>
>>>>>
>>>>>
bind(String.class).annotatedWith(Names.named("applicationJs")).toInstance("scripts/application.js");
>>>>>
>>>>>
>>>>>
bind(String.class).annotatedWith(Names.named("welcomeMessage")).toInstance(readLines("welcome.html"));
>>>>>
>>>>>
>>>>>
bind(String.class).annotatedWith(Names.named("aboutMessage")).toInstance(readLines("about.html"));
>>>>>
>>>>>
>>>>>
bind(String.class).annotatedWith(Names.named("brandLogoHeader")).toInstance("/portal/images/Pocos-Logo-Powering-portal.png");
>>>>>
>>>>>
>>>>>
bind(String.class).annotatedWith(Names.named("brandLogoSignin")).toInstance("/portal/images/Pocos-Logo-Powering-portal.png");
>>>>>
>>>>>
>>>>>
bind(InputStream.class).annotatedWith(Names.named("metaInfManifest")).toProvider(Providers.of(getServletContext().getResourceAsStream("/META-INF/MANIFEST.MF")));
>>>>>
>>>>>
>>>>>
bind(ComponentFactoryRegistrar.class).to(PortalComponentFactoryRegistrar.class);
>>>>>            bind(AppManifest.class).to(PortalModuleAppManifest.class);
>>>>>         }
>>>>>      };
>>>>>
>>>>>
 returnModules.override(isisDefaults).with(resellerPortalOverrides);
>>>>> }
>>>>>
>>>>> Did I forget something?
>>>>>
>>>>> Erik
>>>>>
>>>>>
>>>>>
>>>>>
>

Re: Starting app with AppManifest (1.12.1)

Posted by Erik de Hair <e....@pocos.nl>.
Hi Dan,

Thanks for the extra explanation.

On 05/05/2016 09:29 AM, Dan Haywood wrote:
> Hi Erik,
> If the AppManifest is present then it overrides/replaces the isis.services
> key in the configuration file.
>
> The general idea is to provide an empty module class at the base package of
> your app. Include this class in the list returned from getModules(). The
> framework uses the package of this module class to identify where in the
> classpath to go searching.
>
> You'll see that all the isisaddons use this approach.
>
> The framework itself uses this for the applib services, but there is also a
> hard coded list of additional packages that are for internally implemented
> services. From memory that hardcoded last is a constant field of
> AppManifest interface.
>
> In addition to all that, you can also specify additional service classes in
> the AppManifest 's getServices() method.  The intended usage of this is for
> integ tests and demos to subclass the app' s normal production AppManifest,
> eg to stub out/mock external services.
>
> The solution to your bootstrap problem is a bit of lateral thinking... just
> define a module for your quartz stuff, but in the app module. So long as
> that module's package matches (or is in a parent package of) the service
> you want to pick up over in the webapp module, you should be good.
I created a module and the services are loading now. Added some domain 
event subscriber to manage security from the main app. All working now.
>
> HTH
> Dan
> On 4 May 2016 2:43 pm, "Erik de Hair" <e....@pocos.nl> wrote:
>
> Hi again :-)
>
> Something's not clear to me. Since using the AppManifest some services are
> not automatically registered. After adding them to the AppManifest they
> were. Other services though, were registered like in older Apache Isis
> versions. Did anything change? I can't find it in the
> docs/release/migration notes.
>
> And I have a service in the webapp for registering Quartz-jobs
> (dependencies only added in the webapp). Because of the above issue it's
> not registered and doesn't show up in the main menu. The app-module doesn't
> have a dependency on the web app (and it can't be added because of circular
> annotation processing problems). How can I add a service from the webapp to
> the AppManifest or at least make sure it is loaded?
>
> Erik
>


Re: Starting app with AppManifest (1.12.1)

Posted by Dan Haywood <da...@haywood-associates.co.uk>.
Hi Erik,
If the AppManifest is present then it overrides/replaces the isis.services
key in the configuration file.

The general idea is to provide an empty module class at the base package of
your app. Include this class in the list returned from getModules(). The
framework uses the package of this module class to identify where in the
classpath to go searching.

You'll see that all the isisaddons use this approach.

The framework itself uses this for the applib services, but there is also a
hard coded list of additional packages that are for internally implemented
services. From memory that hardcoded last is a constant field of
AppManifest interface.

In addition to all that, you can also specify additional service classes in
the AppManifest 's getServices() method.  The intended usage of this is for
integ tests and demos to subclass the app' s normal production AppManifest,
eg to stub out/mock external services.

The solution to your bootstrap problem is a bit of lateral thinking... just
define a module for your quartz stuff, but in the app module. So long as
that module's package matches (or is in a parent package of) the service
you want to pick up over in the webapp module, you should be good.

HTH
Dan
On 4 May 2016 2:43 pm, "Erik de Hair" <e....@pocos.nl> wrote:

Hi again :-)

Something's not clear to me. Since using the AppManifest some services are
not automatically registered. After adding them to the AppManifest they
were. Other services though, were registered like in older Apache Isis
versions. Did anything change? I can't find it in the
docs/release/migration notes.

And I have a service in the webapp for registering Quartz-jobs
(dependencies only added in the webapp). Because of the above issue it's
not registered and doesn't show up in the main menu. The app-module doesn't
have a dependency on the web app (and it can't be added because of circular
annotation processing problems). How can I add a service from the webapp to
the AppManifest or at least make sure it is loaded?

Erik

Re: Starting app with AppManifest (1.12.1)

Posted by Erik de Hair <e....@pocos.nl>.
Hi again :-)

Something's not clear to me. Since using the AppManifest some services 
are not automatically registered. After adding them to the AppManifest 
they were. Other services though, were registered like in older Apache 
Isis versions. Did anything change? I can't find it in the 
docs/release/migration notes.

And I have a service in the webapp for registering Quartz-jobs 
(dependencies only added in the webapp). Because of the above issue it's 
not registered and doesn't show up in the main menu. The app-module 
doesn't have a dependency on the web app (and it can't be added because 
of circular annotation processing problems). How can I add a service 
from the webapp to the AppManifest or at least make sure it is loaded?

Erik

Re: Starting app with AppManifest (1.12.1)

Posted by Dan Haywood <da...@haywood-associates.co.uk>.
Glad to hear it, Erik.

Cheers, Dan
On 4 May 2016 9:59 am, "Erik de Hair" <e....@pocos.nl> wrote:

> Aaargh, to many changes at a time... I added a resource filter to the
> maven config for host-dependent configs that prevented the html-files to be
> exported to the target-dir. Finally, I've got it running now!
>
> The 'setting up IntelliJ'-docs are clear and correct!
>
> On 05/03/2016 09:48 AM, Dan Haywood wrote:
>
>> Check that the run configuration specifies that correct working
>> directory... from memory is MODULE_DIR, but it should be clear enough to
>> see in the docs/screencasts.
>>
>> Dan.
>> On 3 May 2016 08:44, "Erik de Hair" <e....@pocos.nl> wrote:
>>
>> Hi,
>>>
>>> The problem had nothing to do with lack of a context path. I had a
>>> dependency conflict between servlet-api 2.5 (dependency of axis2) and
>>> servlet-api 3.x (dependency of org.apache.isis.WebServer).
>>>
>>> The application is running now but I still have some troubles.
>>>
>>> I've got some Wicket problems running the app from IntelliJ with
>>> WebServer
>>> class I get the following error:
>>>
>>> org.apache.wicket.markup.MarkupNotFoundException: Failed to find markup
>>> file associated. SearchBarPanel: [SearchBarPanel [Component id =
>>> searchBar]]
>>>      at
>>>
>>> org.apache.wicket.markup.html.panel.AssociatedMarkupSourcingStrategy.getMarkup(AssociatedMarkupSourcingStrategy.java:97)
>>>      at
>>> org.apache.wicket.MarkupContainer.getMarkup(MarkupContainer.java:451)
>>>      at org.apache.wicket.Component.getMarkup(Component.java:756)
>>>      at
>>>
>>> org.apache.wicket.markup.html.panel.DefaultMarkupSourcingStrategy.getMarkup(DefaultMarkupSourcingStrategy.java:82)
>>>      at
>>> org.apache.wicket.MarkupContainer.getMarkup(MarkupContainer.java:451)
>>>      at org.apache.wicket.Component.getMarkup(Component.java:756)
>>>
>>> I couldn't get the app running from Eclipse using the launch files and
>>> WebServer-class because 'class org.apache.isis.WebServer is not found'.
>>> So
>>> I don't know if it's an issue of using IntelliJ (configuration needed?).
>>> It
>>> looks like (using IntelliJ) the resources from the webapp are not
>>> loaded: I
>>> also get a 404 on some css-file for a custom wicket-page in the same app
>>> (that has nothing to do with Apache Isis).
>>>
>>> I've also noticed that injected services are sometimes not injected so
>>> calls for these services result in nullpointer exceptions. Adding some
>>> service to the AppManifest did help at some point but at others the same
>>> service wasn't injected.
>>>
>>> I will check the documentation again for setting up a project in IntelliJ
>>> but may be you can give me some hints for solving this.
>>>
>>> Thanks,
>>> Erik
>>>
>>>
>>> On 05/02/2016 01:48 PM, Erik de Hair wrote:
>>>
>>> Hi Dan,
>>>>
>>>> While trying to create a simple app I found out the problem was in my
>>>> code. I had a method with @PostConstruct where a field (with @Injected)
>>>> being called was null. Shouldn't an injected field be set before the
>>>> PostConstruct-method is called?
>>>>
>>>> I can go on for now because I solved this in another way.
>>>>
>>>> But now I've got another problem. I'm running the app in prototyping
>>>> mode
>>>> using WebServer-class. It starts without context-path set and I can't
>>>> open
>>>> any page. Should the context path be configured somewhere?
>>>>
>>>> Erik
>>>>
>>>> On 04/29/2016 04:11 PM, Dan Haywood wrote:
>>>>
>>>> Bit difficult to say without seeing the reason for the
>>>>> NullPointerException.
>>>>>
>>>>> You might want to use the current simpleapp archetype to generate a
>>>>> blank
>>>>> webapp, and then do a merge over.  Steve Cameron did something similar
>>>>> recently, didn't seem to take him long...
>>>>>
>>>>>
>>>>>
>>>>> On 29 April 2016 at 14:53, Erik de Hair <e....@pocos.nl> wrote:
>>>>>
>>>>> Hi Dan,
>>>>>
>>>>>> On 04/29/2016 03:35 PM, Dan Haywood wrote:
>>>>>>
>>>>>> remove the line:
>>>>>>
>>>>>>> bind(AppManifest.class).to(PortalModuleAppManifest.class);
>>>>>>>
>>>>>>> from the PortalApplication... I think the error says its already
>>>>>>> configured, probably because the isis.appManifest property is set in
>>>>>>> isis.properties (or equivalently specified as -m flag to
>>>>>>> o.a.i.WebServer).
>>>>>>>
>>>>>>> If that's the case, it might be a documentation issue that needs
>>>>>>> fixing.
>>>>>>>
>>>>>>> Removing the line and setting the manifest property in
>>>>>>> isis.properties
>>>>>>>
>>>>>> does work but now I get another exception:
>>>>>>
>>>>>> 15:50:23,239  [IsisWicketApplication main       ERROR]  Failed to
>>>>>> initialize
>>>>>> com.google.inject.ProvisionException: Unable to provision, see the
>>>>>> following errors:
>>>>>>
>>>>>> 1) Error in custom provider,
>>>>>>
>>>>>> org.apache.isis.core.runtime.system.transaction.IsisTransactionManagerException:
>>>>>>
>>>>>> java.lang.NullPointerException
>>>>>>     at
>>>>>>
>>>>>> org.apache.isis.core.runtime.runner.IsisInjectModule.provideIsisSystem(IsisInjectModule.java:127)
>>>>>>
>>>>>>     at
>>>>>>
>>>>>> org.apache.isis.core.runtime.runner.IsisInjectModule.provideIsisSystem(IsisInjectModule.java:127)
>>>>>>
>>>>>>     while locating org.apache.isis.core.runtime.system.IsisSystem
>>>>>>       for field at
>>>>>>
>>>>>> org.apache.isis.viewer.wicket.viewer.IsisWicketApplication.isisSystem(IsisWicketApplication.java:149)
>>>>>>
>>>>>>     while locating webapp.PortalApplication
>>>>>>
>>>>>> 1 error
>>>>>>       at
>>>>>>
>>>>>> com.google.inject.internal.Errors.throwProvisionExceptionIfErrorsExist(Errors.java:482)
>>>>>>
>>>>>>       at
>>>>>>
>>>>>> com.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:67)
>>>>>>
>>>>>>       at
>>>>>>
>>>>>> com.google.inject.internal.InjectorImpl.injectMembers(InjectorImpl.java:984)
>>>>>>
>>>>>>       at
>>>>>>
>>>>>> org.apache.isis.viewer.wicket.viewer.IsisWicketApplication.init(IsisWicketApplication.java:264)
>>>>>>
>>>>>>       at webapp.PortalApplication.init(PortalApplication.java:102)
>>>>>>
>>>>>>
>>>>>> let me know...
>>>>>>
>>>>>>> Dan
>>>>>>>
>>>>>>>
>>>>>>> On 29 April 2016 at 14:31, Erik de Hair <e....@pocos.nl> wrote:
>>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> When trying to run our application with org.apache.isis.WebServer
>>>>>>>> using
>>>>>>>> an
>>>>>>>> AppManifest I get the following error:
>>>>>>>>
>>>>>>>> 15:07:14,497  [IsisWicketApplication main       ERROR] Failed to
>>>>>>>> initialize
>>>>>>>> com.google.inject.CreationException: Unable to create injector, see
>>>>>>>> the
>>>>>>>> following errors:
>>>>>>>>
>>>>>>>> 1) A binding to org.apache.isis.applib.AppManifest was already
>>>>>>>> configured
>>>>>>>> at
>>>>>>>>
>>>>>>>>
>>>>>>>> org.apache.isis.core.runtime.runner.IsisInjectModule.configure(IsisInjectModule.java:107).
>>>>>>>>
>>>>>>>>      at
>>>>>>>> webapp.PortalApplication$1.configure(PortalApplication.java:94)
>>>>>>>> (via
>>>>>>>> modules: com.google.inject.util.Modules$OverrideModule ->
>>>>>>>> webapp.PortalApplication$1)
>>>>>>>>
>>>>>>>> 1 error
>>>>>>>>        at
>>>>>>>>
>>>>>>>>
>>>>>>>> com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:466)
>>>>>>>>
>>>>>>>>        at
>>>>>>>>
>>>>>>>>
>>>>>>>> com.google.inject.internal.InternalInjectorCreator.initializeStatically(InternalInjectorCreator.java:155)
>>>>>>>>
>>>>>>>>        at
>>>>>>>>
>>>>>>>>
>>>>>>>> com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:107)
>>>>>>>>
>>>>>>>>        at com.google.inject.Guice.createInjector(Guice.java:96)
>>>>>>>>        at com.google.inject.Guice.createInjector(Guice.java:73)
>>>>>>>>        at com.google.inject.Guice.createInjector(Guice.java:62)
>>>>>>>>        at
>>>>>>>>
>>>>>>>>
>>>>>>>> org.apache.isis.viewer.wicket.viewer.IsisWicketApplication.init(IsisWicketApplication.java:262)
>>>>>>>>
>>>>>>>>        at webapp.PortalApplication.init(PortalApplication.java:104)
>>>>>>>>        at
>>>>>>>> org.apache.wicket.Application.initApplication(Application.java:823)
>>>>>>>>
>>>>>>>>
>>>>>>>> ThenewIsisWicketModule-method of our PortalApplication:
>>>>>>>>
>>>>>>>> @Override
>>>>>>>> protectedModule newIsisWicketModule()
>>>>>>>> {
>>>>>>>>       finalModule isisDefaults =super.newIsisWicketModule();
>>>>>>>>
>>>>>>>>       finalModule resellerPortalOverrides =newAbstractModule()
>>>>>>>>       {
>>>>>>>>          @Override
>>>>>>>>          protected voidconfigure()
>>>>>>>>          {
>>>>>>>> bind(PageClassList.class).to(PortalPageClassList.class);
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> bind(String.class).annotatedWith(Names.named("applicationName")).toInstance("ITCO
>>>>>>>>
>>>>>>>> Portal");
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> bind(String.class).annotatedWith(Names.named("applicationCss")).toInstance("css/application.css");
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> bind(String.class).annotatedWith(Names.named("applicationJs")).toInstance("scripts/application.js");
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> bind(String.class).annotatedWith(Names.named("welcomeMessage")).toInstance(readLines("welcome.html"));
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> bind(String.class).annotatedWith(Names.named("aboutMessage")).toInstance(readLines("about.html"));
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> bind(String.class).annotatedWith(Names.named("brandLogoHeader")).toInstance("/portal/images/Pocos-Logo-Powering-portal.png");
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> bind(String.class).annotatedWith(Names.named("brandLogoSignin")).toInstance("/portal/images/Pocos-Logo-Powering-portal.png");
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> bind(InputStream.class).annotatedWith(Names.named("metaInfManifest")).toProvider(Providers.of(getServletContext().getResourceAsStream("/META-INF/MANIFEST.MF")));
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> bind(ComponentFactoryRegistrar.class).to(PortalComponentFactoryRegistrar.class);
>>>>>>>>
>>>>>>>> bind(AppManifest.class).to(PortalModuleAppManifest.class);
>>>>>>>>          }
>>>>>>>>       };
>>>>>>>>
>>>>>>>> returnModules.override(isisDefaults).with(resellerPortalOverrides);
>>>>>>>> }
>>>>>>>>
>>>>>>>> Did I forget something?
>>>>>>>>
>>>>>>>> Erik
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>

Re: Starting app with AppManifest (1.12.1)

Posted by Erik de Hair <e....@pocos.nl>.
Aaargh, to many changes at a time... I added a resource filter to the 
maven config for host-dependent configs that prevented the html-files to 
be exported to the target-dir. Finally, I've got it running now!

The 'setting up IntelliJ'-docs are clear and correct!

On 05/03/2016 09:48 AM, Dan Haywood wrote:
> Check that the run configuration specifies that correct working
> directory... from memory is MODULE_DIR, but it should be clear enough to
> see in the docs/screencasts.
>
> Dan.
> On 3 May 2016 08:44, "Erik de Hair" <e....@pocos.nl> wrote:
>
>> Hi,
>>
>> The problem had nothing to do with lack of a context path. I had a
>> dependency conflict between servlet-api 2.5 (dependency of axis2) and
>> servlet-api 3.x (dependency of org.apache.isis.WebServer).
>>
>> The application is running now but I still have some troubles.
>>
>> I've got some Wicket problems running the app from IntelliJ with WebServer
>> class I get the following error:
>>
>> org.apache.wicket.markup.MarkupNotFoundException: Failed to find markup
>> file associated. SearchBarPanel: [SearchBarPanel [Component id = searchBar]]
>>      at
>> org.apache.wicket.markup.html.panel.AssociatedMarkupSourcingStrategy.getMarkup(AssociatedMarkupSourcingStrategy.java:97)
>>      at
>> org.apache.wicket.MarkupContainer.getMarkup(MarkupContainer.java:451)
>>      at org.apache.wicket.Component.getMarkup(Component.java:756)
>>      at
>> org.apache.wicket.markup.html.panel.DefaultMarkupSourcingStrategy.getMarkup(DefaultMarkupSourcingStrategy.java:82)
>>      at
>> org.apache.wicket.MarkupContainer.getMarkup(MarkupContainer.java:451)
>>      at org.apache.wicket.Component.getMarkup(Component.java:756)
>>
>> I couldn't get the app running from Eclipse using the launch files and
>> WebServer-class because 'class org.apache.isis.WebServer is not found'. So
>> I don't know if it's an issue of using IntelliJ (configuration needed?). It
>> looks like (using IntelliJ) the resources from the webapp are not loaded: I
>> also get a 404 on some css-file for a custom wicket-page in the same app
>> (that has nothing to do with Apache Isis).
>>
>> I've also noticed that injected services are sometimes not injected so
>> calls for these services result in nullpointer exceptions. Adding some
>> service to the AppManifest did help at some point but at others the same
>> service wasn't injected.
>>
>> I will check the documentation again for setting up a project in IntelliJ
>> but may be you can give me some hints for solving this.
>>
>> Thanks,
>> Erik
>>
>>
>> On 05/02/2016 01:48 PM, Erik de Hair wrote:
>>
>>> Hi Dan,
>>>
>>> While trying to create a simple app I found out the problem was in my
>>> code. I had a method with @PostConstruct where a field (with @Injected)
>>> being called was null. Shouldn't an injected field be set before the
>>> PostConstruct-method is called?
>>>
>>> I can go on for now because I solved this in another way.
>>>
>>> But now I've got another problem. I'm running the app in prototyping mode
>>> using WebServer-class. It starts without context-path set and I can't open
>>> any page. Should the context path be configured somewhere?
>>>
>>> Erik
>>>
>>> On 04/29/2016 04:11 PM, Dan Haywood wrote:
>>>
>>>> Bit difficult to say without seeing the reason for the
>>>> NullPointerException.
>>>>
>>>> You might want to use the current simpleapp archetype to generate a blank
>>>> webapp, and then do a merge over.  Steve Cameron did something similar
>>>> recently, didn't seem to take him long...
>>>>
>>>>
>>>>
>>>> On 29 April 2016 at 14:53, Erik de Hair <e....@pocos.nl> wrote:
>>>>
>>>> Hi Dan,
>>>>> On 04/29/2016 03:35 PM, Dan Haywood wrote:
>>>>>
>>>>> remove the line:
>>>>>> bind(AppManifest.class).to(PortalModuleAppManifest.class);
>>>>>>
>>>>>> from the PortalApplication... I think the error says its already
>>>>>> configured, probably because the isis.appManifest property is set in
>>>>>> isis.properties (or equivalently specified as -m flag to
>>>>>> o.a.i.WebServer).
>>>>>>
>>>>>> If that's the case, it might be a documentation issue that needs
>>>>>> fixing.
>>>>>>
>>>>>> Removing the line and setting the manifest property in isis.properties
>>>>> does work but now I get another exception:
>>>>>
>>>>> 15:50:23,239  [IsisWicketApplication main       ERROR]  Failed to
>>>>> initialize
>>>>> com.google.inject.ProvisionException: Unable to provision, see the
>>>>> following errors:
>>>>>
>>>>> 1) Error in custom provider,
>>>>> org.apache.isis.core.runtime.system.transaction.IsisTransactionManagerException:
>>>>>
>>>>> java.lang.NullPointerException
>>>>>     at
>>>>> org.apache.isis.core.runtime.runner.IsisInjectModule.provideIsisSystem(IsisInjectModule.java:127)
>>>>>
>>>>>     at
>>>>> org.apache.isis.core.runtime.runner.IsisInjectModule.provideIsisSystem(IsisInjectModule.java:127)
>>>>>
>>>>>     while locating org.apache.isis.core.runtime.system.IsisSystem
>>>>>       for field at
>>>>> org.apache.isis.viewer.wicket.viewer.IsisWicketApplication.isisSystem(IsisWicketApplication.java:149)
>>>>>
>>>>>     while locating webapp.PortalApplication
>>>>>
>>>>> 1 error
>>>>>       at
>>>>> com.google.inject.internal.Errors.throwProvisionExceptionIfErrorsExist(Errors.java:482)
>>>>>
>>>>>       at
>>>>> com.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:67)
>>>>>
>>>>>       at
>>>>> com.google.inject.internal.InjectorImpl.injectMembers(InjectorImpl.java:984)
>>>>>
>>>>>       at
>>>>> org.apache.isis.viewer.wicket.viewer.IsisWicketApplication.init(IsisWicketApplication.java:264)
>>>>>
>>>>>       at webapp.PortalApplication.init(PortalApplication.java:102)
>>>>>
>>>>>
>>>>> let me know...
>>>>>> Dan
>>>>>>
>>>>>>
>>>>>> On 29 April 2016 at 14:31, Erik de Hair <e....@pocos.nl> wrote:
>>>>>>
>>>>>> Hi,
>>>>>>
>>>>>>> When trying to run our application with org.apache.isis.WebServer
>>>>>>> using
>>>>>>> an
>>>>>>> AppManifest I get the following error:
>>>>>>>
>>>>>>> 15:07:14,497  [IsisWicketApplication main       ERROR] Failed to
>>>>>>> initialize
>>>>>>> com.google.inject.CreationException: Unable to create injector, see
>>>>>>> the
>>>>>>> following errors:
>>>>>>>
>>>>>>> 1) A binding to org.apache.isis.applib.AppManifest was already
>>>>>>> configured
>>>>>>> at
>>>>>>>
>>>>>>> org.apache.isis.core.runtime.runner.IsisInjectModule.configure(IsisInjectModule.java:107).
>>>>>>>
>>>>>>>      at webapp.PortalApplication$1.configure(PortalApplication.java:94)
>>>>>>> (via
>>>>>>> modules: com.google.inject.util.Modules$OverrideModule ->
>>>>>>> webapp.PortalApplication$1)
>>>>>>>
>>>>>>> 1 error
>>>>>>>        at
>>>>>>>
>>>>>>> com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:466)
>>>>>>>
>>>>>>>        at
>>>>>>>
>>>>>>> com.google.inject.internal.InternalInjectorCreator.initializeStatically(InternalInjectorCreator.java:155)
>>>>>>>
>>>>>>>        at
>>>>>>>
>>>>>>> com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:107)
>>>>>>>
>>>>>>>        at com.google.inject.Guice.createInjector(Guice.java:96)
>>>>>>>        at com.google.inject.Guice.createInjector(Guice.java:73)
>>>>>>>        at com.google.inject.Guice.createInjector(Guice.java:62)
>>>>>>>        at
>>>>>>>
>>>>>>> org.apache.isis.viewer.wicket.viewer.IsisWicketApplication.init(IsisWicketApplication.java:262)
>>>>>>>
>>>>>>>        at webapp.PortalApplication.init(PortalApplication.java:104)
>>>>>>>        at
>>>>>>> org.apache.wicket.Application.initApplication(Application.java:823)
>>>>>>>
>>>>>>>
>>>>>>> ThenewIsisWicketModule-method of our PortalApplication:
>>>>>>>
>>>>>>> @Override
>>>>>>> protectedModule newIsisWicketModule()
>>>>>>> {
>>>>>>>       finalModule isisDefaults =super.newIsisWicketModule();
>>>>>>>
>>>>>>>       finalModule resellerPortalOverrides =newAbstractModule()
>>>>>>>       {
>>>>>>>          @Override
>>>>>>>          protected voidconfigure()
>>>>>>>          {
>>>>>>> bind(PageClassList.class).to(PortalPageClassList.class);
>>>>>>>
>>>>>>>
>>>>>>> bind(String.class).annotatedWith(Names.named("applicationName")).toInstance("ITCO
>>>>>>>
>>>>>>> Portal");
>>>>>>>
>>>>>>>
>>>>>>> bind(String.class).annotatedWith(Names.named("applicationCss")).toInstance("css/application.css");
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> bind(String.class).annotatedWith(Names.named("applicationJs")).toInstance("scripts/application.js");
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> bind(String.class).annotatedWith(Names.named("welcomeMessage")).toInstance(readLines("welcome.html"));
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> bind(String.class).annotatedWith(Names.named("aboutMessage")).toInstance(readLines("about.html"));
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> bind(String.class).annotatedWith(Names.named("brandLogoHeader")).toInstance("/portal/images/Pocos-Logo-Powering-portal.png");
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> bind(String.class).annotatedWith(Names.named("brandLogoSignin")).toInstance("/portal/images/Pocos-Logo-Powering-portal.png");
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> bind(InputStream.class).annotatedWith(Names.named("metaInfManifest")).toProvider(Providers.of(getServletContext().getResourceAsStream("/META-INF/MANIFEST.MF")));
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> bind(ComponentFactoryRegistrar.class).to(PortalComponentFactoryRegistrar.class);
>>>>>>>
>>>>>>> bind(AppManifest.class).to(PortalModuleAppManifest.class);
>>>>>>>          }
>>>>>>>       };
>>>>>>>
>>>>>>> returnModules.override(isisDefaults).with(resellerPortalOverrides);
>>>>>>> }
>>>>>>>
>>>>>>> Did I forget something?
>>>>>>>
>>>>>>> Erik
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>


Re: Starting app with AppManifest (1.12.1)

Posted by Dan Haywood <da...@haywood-associates.co.uk>.
Check that the run configuration specifies that correct working
directory... from memory is MODULE_DIR, but it should be clear enough to
see in the docs/screencasts.

Dan.
On 3 May 2016 08:44, "Erik de Hair" <e....@pocos.nl> wrote:

> Hi,
>
> The problem had nothing to do with lack of a context path. I had a
> dependency conflict between servlet-api 2.5 (dependency of axis2) and
> servlet-api 3.x (dependency of org.apache.isis.WebServer).
>
> The application is running now but I still have some troubles.
>
> I've got some Wicket problems running the app from IntelliJ with WebServer
> class I get the following error:
>
> org.apache.wicket.markup.MarkupNotFoundException: Failed to find markup
> file associated. SearchBarPanel: [SearchBarPanel [Component id = searchBar]]
>     at
> org.apache.wicket.markup.html.panel.AssociatedMarkupSourcingStrategy.getMarkup(AssociatedMarkupSourcingStrategy.java:97)
>     at
> org.apache.wicket.MarkupContainer.getMarkup(MarkupContainer.java:451)
>     at org.apache.wicket.Component.getMarkup(Component.java:756)
>     at
> org.apache.wicket.markup.html.panel.DefaultMarkupSourcingStrategy.getMarkup(DefaultMarkupSourcingStrategy.java:82)
>     at
> org.apache.wicket.MarkupContainer.getMarkup(MarkupContainer.java:451)
>     at org.apache.wicket.Component.getMarkup(Component.java:756)
>
> I couldn't get the app running from Eclipse using the launch files and
> WebServer-class because 'class org.apache.isis.WebServer is not found'. So
> I don't know if it's an issue of using IntelliJ (configuration needed?). It
> looks like (using IntelliJ) the resources from the webapp are not loaded: I
> also get a 404 on some css-file for a custom wicket-page in the same app
> (that has nothing to do with Apache Isis).
>
> I've also noticed that injected services are sometimes not injected so
> calls for these services result in nullpointer exceptions. Adding some
> service to the AppManifest did help at some point but at others the same
> service wasn't injected.
>
> I will check the documentation again for setting up a project in IntelliJ
> but may be you can give me some hints for solving this.
>
> Thanks,
> Erik
>
>
> On 05/02/2016 01:48 PM, Erik de Hair wrote:
>
>> Hi Dan,
>>
>> While trying to create a simple app I found out the problem was in my
>> code. I had a method with @PostConstruct where a field (with @Injected)
>> being called was null. Shouldn't an injected field be set before the
>> PostConstruct-method is called?
>>
>> I can go on for now because I solved this in another way.
>>
>> But now I've got another problem. I'm running the app in prototyping mode
>> using WebServer-class. It starts without context-path set and I can't open
>> any page. Should the context path be configured somewhere?
>>
>> Erik
>>
>> On 04/29/2016 04:11 PM, Dan Haywood wrote:
>>
>>> Bit difficult to say without seeing the reason for the
>>> NullPointerException.
>>>
>>> You might want to use the current simpleapp archetype to generate a blank
>>> webapp, and then do a merge over.  Steve Cameron did something similar
>>> recently, didn't seem to take him long...
>>>
>>>
>>>
>>> On 29 April 2016 at 14:53, Erik de Hair <e....@pocos.nl> wrote:
>>>
>>> Hi Dan,
>>>>
>>>> On 04/29/2016 03:35 PM, Dan Haywood wrote:
>>>>
>>>> remove the line:
>>>>>
>>>>> bind(AppManifest.class).to(PortalModuleAppManifest.class);
>>>>>
>>>>> from the PortalApplication... I think the error says its already
>>>>> configured, probably because the isis.appManifest property is set in
>>>>> isis.properties (or equivalently specified as -m flag to
>>>>> o.a.i.WebServer).
>>>>>
>>>>> If that's the case, it might be a documentation issue that needs
>>>>> fixing.
>>>>>
>>>>> Removing the line and setting the manifest property in isis.properties
>>>> does work but now I get another exception:
>>>>
>>>> 15:50:23,239  [IsisWicketApplication main       ERROR]  Failed to
>>>> initialize
>>>> com.google.inject.ProvisionException: Unable to provision, see the
>>>> following errors:
>>>>
>>>> 1) Error in custom provider,
>>>> org.apache.isis.core.runtime.system.transaction.IsisTransactionManagerException:
>>>>
>>>> java.lang.NullPointerException
>>>>    at
>>>> org.apache.isis.core.runtime.runner.IsisInjectModule.provideIsisSystem(IsisInjectModule.java:127)
>>>>
>>>>    at
>>>> org.apache.isis.core.runtime.runner.IsisInjectModule.provideIsisSystem(IsisInjectModule.java:127)
>>>>
>>>>    while locating org.apache.isis.core.runtime.system.IsisSystem
>>>>      for field at
>>>> org.apache.isis.viewer.wicket.viewer.IsisWicketApplication.isisSystem(IsisWicketApplication.java:149)
>>>>
>>>>    while locating webapp.PortalApplication
>>>>
>>>> 1 error
>>>>      at
>>>> com.google.inject.internal.Errors.throwProvisionExceptionIfErrorsExist(Errors.java:482)
>>>>
>>>>      at
>>>> com.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:67)
>>>>
>>>>      at
>>>> com.google.inject.internal.InjectorImpl.injectMembers(InjectorImpl.java:984)
>>>>
>>>>      at
>>>> org.apache.isis.viewer.wicket.viewer.IsisWicketApplication.init(IsisWicketApplication.java:264)
>>>>
>>>>      at webapp.PortalApplication.init(PortalApplication.java:102)
>>>>
>>>>
>>>> let me know...
>>>>>
>>>>> Dan
>>>>>
>>>>>
>>>>> On 29 April 2016 at 14:31, Erik de Hair <e....@pocos.nl> wrote:
>>>>>
>>>>> Hi,
>>>>>
>>>>>> When trying to run our application with org.apache.isis.WebServer
>>>>>> using
>>>>>> an
>>>>>> AppManifest I get the following error:
>>>>>>
>>>>>> 15:07:14,497  [IsisWicketApplication main       ERROR] Failed to
>>>>>> initialize
>>>>>> com.google.inject.CreationException: Unable to create injector, see
>>>>>> the
>>>>>> following errors:
>>>>>>
>>>>>> 1) A binding to org.apache.isis.applib.AppManifest was already
>>>>>> configured
>>>>>> at
>>>>>>
>>>>>> org.apache.isis.core.runtime.runner.IsisInjectModule.configure(IsisInjectModule.java:107).
>>>>>>
>>>>>>     at webapp.PortalApplication$1.configure(PortalApplication.java:94)
>>>>>> (via
>>>>>> modules: com.google.inject.util.Modules$OverrideModule ->
>>>>>> webapp.PortalApplication$1)
>>>>>>
>>>>>> 1 error
>>>>>>       at
>>>>>>
>>>>>> com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:466)
>>>>>>
>>>>>>       at
>>>>>>
>>>>>> com.google.inject.internal.InternalInjectorCreator.initializeStatically(InternalInjectorCreator.java:155)
>>>>>>
>>>>>>       at
>>>>>>
>>>>>> com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:107)
>>>>>>
>>>>>>       at com.google.inject.Guice.createInjector(Guice.java:96)
>>>>>>       at com.google.inject.Guice.createInjector(Guice.java:73)
>>>>>>       at com.google.inject.Guice.createInjector(Guice.java:62)
>>>>>>       at
>>>>>>
>>>>>> org.apache.isis.viewer.wicket.viewer.IsisWicketApplication.init(IsisWicketApplication.java:262)
>>>>>>
>>>>>>       at webapp.PortalApplication.init(PortalApplication.java:104)
>>>>>>       at
>>>>>> org.apache.wicket.Application.initApplication(Application.java:823)
>>>>>>
>>>>>>
>>>>>> ThenewIsisWicketModule-method of our PortalApplication:
>>>>>>
>>>>>> @Override
>>>>>> protectedModule newIsisWicketModule()
>>>>>> {
>>>>>>      finalModule isisDefaults =super.newIsisWicketModule();
>>>>>>
>>>>>>      finalModule resellerPortalOverrides =newAbstractModule()
>>>>>>      {
>>>>>>         @Override
>>>>>>         protected voidconfigure()
>>>>>>         {
>>>>>> bind(PageClassList.class).to(PortalPageClassList.class);
>>>>>>
>>>>>>
>>>>>> bind(String.class).annotatedWith(Names.named("applicationName")).toInstance("ITCO
>>>>>>
>>>>>> Portal");
>>>>>>
>>>>>>
>>>>>> bind(String.class).annotatedWith(Names.named("applicationCss")).toInstance("css/application.css");
>>>>>>
>>>>>>
>>>>>>
>>>>>> bind(String.class).annotatedWith(Names.named("applicationJs")).toInstance("scripts/application.js");
>>>>>>
>>>>>>
>>>>>>
>>>>>> bind(String.class).annotatedWith(Names.named("welcomeMessage")).toInstance(readLines("welcome.html"));
>>>>>>
>>>>>>
>>>>>>
>>>>>> bind(String.class).annotatedWith(Names.named("aboutMessage")).toInstance(readLines("about.html"));
>>>>>>
>>>>>>
>>>>>>
>>>>>> bind(String.class).annotatedWith(Names.named("brandLogoHeader")).toInstance("/portal/images/Pocos-Logo-Powering-portal.png");
>>>>>>
>>>>>>
>>>>>>
>>>>>> bind(String.class).annotatedWith(Names.named("brandLogoSignin")).toInstance("/portal/images/Pocos-Logo-Powering-portal.png");
>>>>>>
>>>>>>
>>>>>>
>>>>>> bind(InputStream.class).annotatedWith(Names.named("metaInfManifest")).toProvider(Providers.of(getServletContext().getResourceAsStream("/META-INF/MANIFEST.MF")));
>>>>>>
>>>>>>
>>>>>>
>>>>>> bind(ComponentFactoryRegistrar.class).to(PortalComponentFactoryRegistrar.class);
>>>>>>
>>>>>> bind(AppManifest.class).to(PortalModuleAppManifest.class);
>>>>>>         }
>>>>>>      };
>>>>>>
>>>>>> returnModules.override(isisDefaults).with(resellerPortalOverrides);
>>>>>> }
>>>>>>
>>>>>> Did I forget something?
>>>>>>
>>>>>> Erik
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>
>

Re: Starting app with AppManifest (1.12.1)

Posted by Erik de Hair <e....@pocos.nl>.
Hi,

The problem had nothing to do with lack of a context path. I had a 
dependency conflict between servlet-api 2.5 (dependency of axis2) and 
servlet-api 3.x (dependency of org.apache.isis.WebServer).

The application is running now but I still have some troubles.

I've got some Wicket problems running the app from IntelliJ with 
WebServer class I get the following error:

org.apache.wicket.markup.MarkupNotFoundException: Failed to find markup 
file associated. SearchBarPanel: [SearchBarPanel [Component id = searchBar]]
     at 
org.apache.wicket.markup.html.panel.AssociatedMarkupSourcingStrategy.getMarkup(AssociatedMarkupSourcingStrategy.java:97)
     at 
org.apache.wicket.MarkupContainer.getMarkup(MarkupContainer.java:451)
     at org.apache.wicket.Component.getMarkup(Component.java:756)
     at 
org.apache.wicket.markup.html.panel.DefaultMarkupSourcingStrategy.getMarkup(DefaultMarkupSourcingStrategy.java:82)
     at 
org.apache.wicket.MarkupContainer.getMarkup(MarkupContainer.java:451)
     at org.apache.wicket.Component.getMarkup(Component.java:756)

I couldn't get the app running from Eclipse using the launch files and 
WebServer-class because 'class org.apache.isis.WebServer is not found'. 
So I don't know if it's an issue of using IntelliJ (configuration 
needed?). It looks like (using IntelliJ) the resources from the webapp 
are not loaded: I also get a 404 on some css-file for a custom 
wicket-page in the same app (that has nothing to do with Apache Isis).

I've also noticed that injected services are sometimes not injected so 
calls for these services result in nullpointer exceptions. Adding some 
service to the AppManifest did help at some point but at others the same 
service wasn't injected.

I will check the documentation again for setting up a project in 
IntelliJ but may be you can give me some hints for solving this.

Thanks,
Erik


On 05/02/2016 01:48 PM, Erik de Hair wrote:
> Hi Dan,
>
> While trying to create a simple app I found out the problem was in my 
> code. I had a method with @PostConstruct where a field (with 
> @Injected) being called was null. Shouldn't an injected field be set 
> before the PostConstruct-method is called?
>
> I can go on for now because I solved this in another way.
>
> But now I've got another problem. I'm running the app in prototyping 
> mode using WebServer-class. It starts without context-path set and I 
> can't open any page. Should the context path be configured somewhere?
>
> Erik
>
> On 04/29/2016 04:11 PM, Dan Haywood wrote:
>> Bit difficult to say without seeing the reason for the 
>> NullPointerException.
>>
>> You might want to use the current simpleapp archetype to generate a 
>> blank
>> webapp, and then do a merge over.  Steve Cameron did something similar
>> recently, didn't seem to take him long...
>>
>>
>>
>> On 29 April 2016 at 14:53, Erik de Hair <e....@pocos.nl> wrote:
>>
>>> Hi Dan,
>>>
>>> On 04/29/2016 03:35 PM, Dan Haywood wrote:
>>>
>>>> remove the line:
>>>>
>>>> bind(AppManifest.class).to(PortalModuleAppManifest.class);
>>>>
>>>> from the PortalApplication... I think the error says its already
>>>> configured, probably because the isis.appManifest property is set in
>>>> isis.properties (or equivalently specified as -m flag to 
>>>> o.a.i.WebServer).
>>>>
>>>> If that's the case, it might be a documentation issue that needs 
>>>> fixing.
>>>>
>>> Removing the line and setting the manifest property in isis.properties
>>> does work but now I get another exception:
>>>
>>> 15:50:23,239  [IsisWicketApplication main       ERROR]  Failed to
>>> initialize
>>> com.google.inject.ProvisionException: Unable to provision, see the
>>> following errors:
>>>
>>> 1) Error in custom provider,
>>> org.apache.isis.core.runtime.system.transaction.IsisTransactionManagerException: 
>>>
>>> java.lang.NullPointerException
>>>    at
>>> org.apache.isis.core.runtime.runner.IsisInjectModule.provideIsisSystem(IsisInjectModule.java:127) 
>>>
>>>    at
>>> org.apache.isis.core.runtime.runner.IsisInjectModule.provideIsisSystem(IsisInjectModule.java:127) 
>>>
>>>    while locating org.apache.isis.core.runtime.system.IsisSystem
>>>      for field at
>>> org.apache.isis.viewer.wicket.viewer.IsisWicketApplication.isisSystem(IsisWicketApplication.java:149) 
>>>
>>>    while locating webapp.PortalApplication
>>>
>>> 1 error
>>>      at
>>> com.google.inject.internal.Errors.throwProvisionExceptionIfErrorsExist(Errors.java:482) 
>>>
>>>      at
>>> com.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:67) 
>>>
>>>      at
>>> com.google.inject.internal.InjectorImpl.injectMembers(InjectorImpl.java:984) 
>>>
>>>      at
>>> org.apache.isis.viewer.wicket.viewer.IsisWicketApplication.init(IsisWicketApplication.java:264) 
>>>
>>>      at webapp.PortalApplication.init(PortalApplication.java:102)
>>>
>>>
>>>> let me know...
>>>>
>>>> Dan
>>>>
>>>>
>>>> On 29 April 2016 at 14:31, Erik de Hair <e....@pocos.nl> wrote:
>>>>
>>>> Hi,
>>>>> When trying to run our application with org.apache.isis.WebServer 
>>>>> using
>>>>> an
>>>>> AppManifest I get the following error:
>>>>>
>>>>> 15:07:14,497  [IsisWicketApplication main       ERROR] Failed to
>>>>> initialize
>>>>> com.google.inject.CreationException: Unable to create injector, 
>>>>> see the
>>>>> following errors:
>>>>>
>>>>> 1) A binding to org.apache.isis.applib.AppManifest was already 
>>>>> configured
>>>>> at
>>>>>
>>>>> org.apache.isis.core.runtime.runner.IsisInjectModule.configure(IsisInjectModule.java:107). 
>>>>>
>>>>>     at 
>>>>> webapp.PortalApplication$1.configure(PortalApplication.java:94)
>>>>> (via
>>>>> modules: com.google.inject.util.Modules$OverrideModule ->
>>>>> webapp.PortalApplication$1)
>>>>>
>>>>> 1 error
>>>>>       at
>>>>>
>>>>> com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:466) 
>>>>>
>>>>>       at
>>>>>
>>>>> com.google.inject.internal.InternalInjectorCreator.initializeStatically(InternalInjectorCreator.java:155) 
>>>>>
>>>>>       at
>>>>>
>>>>> com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:107) 
>>>>>
>>>>>       at com.google.inject.Guice.createInjector(Guice.java:96)
>>>>>       at com.google.inject.Guice.createInjector(Guice.java:73)
>>>>>       at com.google.inject.Guice.createInjector(Guice.java:62)
>>>>>       at
>>>>>
>>>>> org.apache.isis.viewer.wicket.viewer.IsisWicketApplication.init(IsisWicketApplication.java:262) 
>>>>>
>>>>>       at webapp.PortalApplication.init(PortalApplication.java:104)
>>>>>       at
>>>>> org.apache.wicket.Application.initApplication(Application.java:823)
>>>>>
>>>>>
>>>>> ThenewIsisWicketModule-method of our PortalApplication:
>>>>>
>>>>> @Override
>>>>> protectedModule newIsisWicketModule()
>>>>> {
>>>>>      finalModule isisDefaults =super.newIsisWicketModule();
>>>>>
>>>>>      finalModule resellerPortalOverrides =newAbstractModule()
>>>>>      {
>>>>>         @Override
>>>>>         protected voidconfigure()
>>>>>         {
>>>>> bind(PageClassList.class).to(PortalPageClassList.class);
>>>>>
>>>>>
>>>>> bind(String.class).annotatedWith(Names.named("applicationName")).toInstance("ITCO 
>>>>>
>>>>> Portal");
>>>>>
>>>>>
>>>>> bind(String.class).annotatedWith(Names.named("applicationCss")).toInstance("css/application.css"); 
>>>>>
>>>>>
>>>>>
>>>>> bind(String.class).annotatedWith(Names.named("applicationJs")).toInstance("scripts/application.js"); 
>>>>>
>>>>>
>>>>>
>>>>> bind(String.class).annotatedWith(Names.named("welcomeMessage")).toInstance(readLines("welcome.html")); 
>>>>>
>>>>>
>>>>>
>>>>> bind(String.class).annotatedWith(Names.named("aboutMessage")).toInstance(readLines("about.html")); 
>>>>>
>>>>>
>>>>>
>>>>> bind(String.class).annotatedWith(Names.named("brandLogoHeader")).toInstance("/portal/images/Pocos-Logo-Powering-portal.png"); 
>>>>>
>>>>>
>>>>>
>>>>> bind(String.class).annotatedWith(Names.named("brandLogoSignin")).toInstance("/portal/images/Pocos-Logo-Powering-portal.png"); 
>>>>>
>>>>>
>>>>>
>>>>> bind(InputStream.class).annotatedWith(Names.named("metaInfManifest")).toProvider(Providers.of(getServletContext().getResourceAsStream("/META-INF/MANIFEST.MF"))); 
>>>>>
>>>>>
>>>>>
>>>>> bind(ComponentFactoryRegistrar.class).to(PortalComponentFactoryRegistrar.class); 
>>>>>
>>>>> bind(AppManifest.class).to(PortalModuleAppManifest.class);
>>>>>         }
>>>>>      };
>>>>>
>>>>> returnModules.override(isisDefaults).with(resellerPortalOverrides);
>>>>> }
>>>>>
>>>>> Did I forget something?
>>>>>
>>>>> Erik
>>>>>
>>>>>
>>>>>
>>>>>
>


Re: Starting app with AppManifest (1.12.1)

Posted by Erik de Hair <e....@pocos.nl>.
Hi Dan,

While trying to create a simple app I found out the problem was in my 
code. I had a method with @PostConstruct where a field (with @Injected) 
being called was null. Shouldn't an injected field be set before the 
PostConstruct-method is called?

I can go on for now because I solved this in another way.

But now I've got another problem. I'm running the app in prototyping 
mode using WebServer-class. It starts without context-path set and I 
can't open any page. Should the context path be configured somewhere?

Erik

On 04/29/2016 04:11 PM, Dan Haywood wrote:
> Bit difficult to say without seeing the reason for the NullPointerException.
>
> You might want to use the current simpleapp archetype to generate a blank
> webapp, and then do a merge over.  Steve Cameron did something similar
> recently, didn't seem to take him long...
>
>
>
> On 29 April 2016 at 14:53, Erik de Hair <e....@pocos.nl> wrote:
>
>> Hi Dan,
>>
>> On 04/29/2016 03:35 PM, Dan Haywood wrote:
>>
>>> remove the line:
>>>
>>>    bind(AppManifest.class).to(PortalModuleAppManifest.class);
>>>
>>> from the PortalApplication... I think the error says its already
>>> configured, probably because the isis.appManifest property is set in
>>> isis.properties (or equivalently specified as -m flag to o.a.i.WebServer).
>>>
>>> If that's the case, it might be a documentation issue that needs fixing.
>>>
>> Removing the line and setting the manifest property in isis.properties
>> does work but now I get another exception:
>>
>> 15:50:23,239  [IsisWicketApplication main       ERROR]  Failed to
>> initialize
>> com.google.inject.ProvisionException: Unable to provision, see the
>> following errors:
>>
>> 1) Error in custom provider,
>> org.apache.isis.core.runtime.system.transaction.IsisTransactionManagerException:
>> java.lang.NullPointerException
>>    at
>> org.apache.isis.core.runtime.runner.IsisInjectModule.provideIsisSystem(IsisInjectModule.java:127)
>>    at
>> org.apache.isis.core.runtime.runner.IsisInjectModule.provideIsisSystem(IsisInjectModule.java:127)
>>    while locating org.apache.isis.core.runtime.system.IsisSystem
>>      for field at
>> org.apache.isis.viewer.wicket.viewer.IsisWicketApplication.isisSystem(IsisWicketApplication.java:149)
>>    while locating webapp.PortalApplication
>>
>> 1 error
>>      at
>> com.google.inject.internal.Errors.throwProvisionExceptionIfErrorsExist(Errors.java:482)
>>      at
>> com.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:67)
>>      at
>> com.google.inject.internal.InjectorImpl.injectMembers(InjectorImpl.java:984)
>>      at
>> org.apache.isis.viewer.wicket.viewer.IsisWicketApplication.init(IsisWicketApplication.java:264)
>>      at webapp.PortalApplication.init(PortalApplication.java:102)
>>
>>
>>> let me know...
>>>
>>> Dan
>>>
>>>
>>> On 29 April 2016 at 14:31, Erik de Hair <e....@pocos.nl> wrote:
>>>
>>> Hi,
>>>> When trying to run our application with org.apache.isis.WebServer using
>>>> an
>>>> AppManifest I get the following error:
>>>>
>>>> 15:07:14,497  [IsisWicketApplication main       ERROR]  Failed to
>>>> initialize
>>>> com.google.inject.CreationException: Unable to create injector, see the
>>>> following errors:
>>>>
>>>> 1) A binding to org.apache.isis.applib.AppManifest was already configured
>>>> at
>>>>
>>>> org.apache.isis.core.runtime.runner.IsisInjectModule.configure(IsisInjectModule.java:107).
>>>>     at webapp.PortalApplication$1.configure(PortalApplication.java:94)
>>>> (via
>>>> modules: com.google.inject.util.Modules$OverrideModule ->
>>>> webapp.PortalApplication$1)
>>>>
>>>> 1 error
>>>>       at
>>>>
>>>> com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:466)
>>>>       at
>>>>
>>>> com.google.inject.internal.InternalInjectorCreator.initializeStatically(InternalInjectorCreator.java:155)
>>>>       at
>>>>
>>>> com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:107)
>>>>       at com.google.inject.Guice.createInjector(Guice.java:96)
>>>>       at com.google.inject.Guice.createInjector(Guice.java:73)
>>>>       at com.google.inject.Guice.createInjector(Guice.java:62)
>>>>       at
>>>>
>>>> org.apache.isis.viewer.wicket.viewer.IsisWicketApplication.init(IsisWicketApplication.java:262)
>>>>       at webapp.PortalApplication.init(PortalApplication.java:104)
>>>>       at
>>>> org.apache.wicket.Application.initApplication(Application.java:823)
>>>>
>>>>
>>>> ThenewIsisWicketModule-method of our PortalApplication:
>>>>
>>>> @Override
>>>> protectedModule newIsisWicketModule()
>>>> {
>>>>      finalModule isisDefaults =super.newIsisWicketModule();
>>>>
>>>>      finalModule resellerPortalOverrides =newAbstractModule()
>>>>      {
>>>>         @Override
>>>>         protected voidconfigure()
>>>>         {
>>>>            bind(PageClassList.class).to(PortalPageClassList.class);
>>>>
>>>>
>>>> bind(String.class).annotatedWith(Names.named("applicationName")).toInstance("ITCO
>>>> Portal");
>>>>
>>>>
>>>> bind(String.class).annotatedWith(Names.named("applicationCss")).toInstance("css/application.css");
>>>>
>>>>
>>>> bind(String.class).annotatedWith(Names.named("applicationJs")).toInstance("scripts/application.js");
>>>>
>>>>
>>>> bind(String.class).annotatedWith(Names.named("welcomeMessage")).toInstance(readLines("welcome.html"));
>>>>
>>>>
>>>> bind(String.class).annotatedWith(Names.named("aboutMessage")).toInstance(readLines("about.html"));
>>>>
>>>>
>>>> bind(String.class).annotatedWith(Names.named("brandLogoHeader")).toInstance("/portal/images/Pocos-Logo-Powering-portal.png");
>>>>
>>>>
>>>> bind(String.class).annotatedWith(Names.named("brandLogoSignin")).toInstance("/portal/images/Pocos-Logo-Powering-portal.png");
>>>>
>>>>
>>>> bind(InputStream.class).annotatedWith(Names.named("metaInfManifest")).toProvider(Providers.of(getServletContext().getResourceAsStream("/META-INF/MANIFEST.MF")));
>>>>
>>>>
>>>> bind(ComponentFactoryRegistrar.class).to(PortalComponentFactoryRegistrar.class);
>>>>            bind(AppManifest.class).to(PortalModuleAppManifest.class);
>>>>         }
>>>>      };
>>>>
>>>>      returnModules.override(isisDefaults).with(resellerPortalOverrides);
>>>> }
>>>>
>>>> Did I forget something?
>>>>
>>>> Erik
>>>>
>>>>
>>>>
>>>>


Re: Starting app with AppManifest (1.12.1)

Posted by Dan Haywood <da...@haywood-associates.co.uk>.
Bit difficult to say without seeing the reason for the NullPointerException.

You might want to use the current simpleapp archetype to generate a blank
webapp, and then do a merge over.  Steve Cameron did something similar
recently, didn't seem to take him long...



On 29 April 2016 at 14:53, Erik de Hair <e....@pocos.nl> wrote:

> Hi Dan,
>
> On 04/29/2016 03:35 PM, Dan Haywood wrote:
>
>> remove the line:
>>
>>   bind(AppManifest.class).to(PortalModuleAppManifest.class);
>>
>> from the PortalApplication... I think the error says its already
>> configured, probably because the isis.appManifest property is set in
>> isis.properties (or equivalently specified as -m flag to o.a.i.WebServer).
>>
>> If that's the case, it might be a documentation issue that needs fixing.
>>
> Removing the line and setting the manifest property in isis.properties
> does work but now I get another exception:
>
> 15:50:23,239  [IsisWicketApplication main       ERROR]  Failed to
> initialize
> com.google.inject.ProvisionException: Unable to provision, see the
> following errors:
>
> 1) Error in custom provider,
> org.apache.isis.core.runtime.system.transaction.IsisTransactionManagerException:
> java.lang.NullPointerException
>   at
> org.apache.isis.core.runtime.runner.IsisInjectModule.provideIsisSystem(IsisInjectModule.java:127)
>   at
> org.apache.isis.core.runtime.runner.IsisInjectModule.provideIsisSystem(IsisInjectModule.java:127)
>   while locating org.apache.isis.core.runtime.system.IsisSystem
>     for field at
> org.apache.isis.viewer.wicket.viewer.IsisWicketApplication.isisSystem(IsisWicketApplication.java:149)
>   while locating webapp.PortalApplication
>
> 1 error
>     at
> com.google.inject.internal.Errors.throwProvisionExceptionIfErrorsExist(Errors.java:482)
>     at
> com.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:67)
>     at
> com.google.inject.internal.InjectorImpl.injectMembers(InjectorImpl.java:984)
>     at
> org.apache.isis.viewer.wicket.viewer.IsisWicketApplication.init(IsisWicketApplication.java:264)
>     at webapp.PortalApplication.init(PortalApplication.java:102)
>
>
>> let me know...
>>
>> Dan
>>
>>
>> On 29 April 2016 at 14:31, Erik de Hair <e....@pocos.nl> wrote:
>>
>> Hi,
>>>
>>> When trying to run our application with org.apache.isis.WebServer using
>>> an
>>> AppManifest I get the following error:
>>>
>>> 15:07:14,497  [IsisWicketApplication main       ERROR]  Failed to
>>> initialize
>>> com.google.inject.CreationException: Unable to create injector, see the
>>> following errors:
>>>
>>> 1) A binding to org.apache.isis.applib.AppManifest was already configured
>>> at
>>>
>>> org.apache.isis.core.runtime.runner.IsisInjectModule.configure(IsisInjectModule.java:107).
>>>    at webapp.PortalApplication$1.configure(PortalApplication.java:94)
>>> (via
>>> modules: com.google.inject.util.Modules$OverrideModule ->
>>> webapp.PortalApplication$1)
>>>
>>> 1 error
>>>      at
>>>
>>> com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:466)
>>>      at
>>>
>>> com.google.inject.internal.InternalInjectorCreator.initializeStatically(InternalInjectorCreator.java:155)
>>>      at
>>>
>>> com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:107)
>>>      at com.google.inject.Guice.createInjector(Guice.java:96)
>>>      at com.google.inject.Guice.createInjector(Guice.java:73)
>>>      at com.google.inject.Guice.createInjector(Guice.java:62)
>>>      at
>>>
>>> org.apache.isis.viewer.wicket.viewer.IsisWicketApplication.init(IsisWicketApplication.java:262)
>>>      at webapp.PortalApplication.init(PortalApplication.java:104)
>>>      at
>>> org.apache.wicket.Application.initApplication(Application.java:823)
>>>
>>>
>>> ThenewIsisWicketModule-method of our PortalApplication:
>>>
>>> @Override
>>> protectedModule newIsisWicketModule()
>>> {
>>>     finalModule isisDefaults =super.newIsisWicketModule();
>>>
>>>     finalModule resellerPortalOverrides =newAbstractModule()
>>>     {
>>>        @Override
>>>        protected voidconfigure()
>>>        {
>>>           bind(PageClassList.class).to(PortalPageClassList.class);
>>>
>>>
>>> bind(String.class).annotatedWith(Names.named("applicationName")).toInstance("ITCO
>>> Portal");
>>>
>>>
>>> bind(String.class).annotatedWith(Names.named("applicationCss")).toInstance("css/application.css");
>>>
>>>
>>> bind(String.class).annotatedWith(Names.named("applicationJs")).toInstance("scripts/application.js");
>>>
>>>
>>> bind(String.class).annotatedWith(Names.named("welcomeMessage")).toInstance(readLines("welcome.html"));
>>>
>>>
>>> bind(String.class).annotatedWith(Names.named("aboutMessage")).toInstance(readLines("about.html"));
>>>
>>>
>>> bind(String.class).annotatedWith(Names.named("brandLogoHeader")).toInstance("/portal/images/Pocos-Logo-Powering-portal.png");
>>>
>>>
>>> bind(String.class).annotatedWith(Names.named("brandLogoSignin")).toInstance("/portal/images/Pocos-Logo-Powering-portal.png");
>>>
>>>
>>> bind(InputStream.class).annotatedWith(Names.named("metaInfManifest")).toProvider(Providers.of(getServletContext().getResourceAsStream("/META-INF/MANIFEST.MF")));
>>>
>>>
>>> bind(ComponentFactoryRegistrar.class).to(PortalComponentFactoryRegistrar.class);
>>>           bind(AppManifest.class).to(PortalModuleAppManifest.class);
>>>        }
>>>     };
>>>
>>>     returnModules.override(isisDefaults).with(resellerPortalOverrides);
>>> }
>>>
>>> Did I forget something?
>>>
>>> Erik
>>>
>>>
>>>
>>>
>

Re: Starting app with AppManifest (1.12.1)

Posted by Erik de Hair <e....@pocos.nl>.
Hi Dan,

On 04/29/2016 03:35 PM, Dan Haywood wrote:
> remove the line:
>
>   bind(AppManifest.class).to(PortalModuleAppManifest.class);
>
> from the PortalApplication... I think the error says its already
> configured, probably because the isis.appManifest property is set in
> isis.properties (or equivalently specified as -m flag to o.a.i.WebServer).
>
> If that's the case, it might be a documentation issue that needs fixing.
Removing the line and setting the manifest property in isis.properties 
does work but now I get another exception:

15:50:23,239  [IsisWicketApplication main       ERROR]  Failed to initialize
com.google.inject.ProvisionException: Unable to provision, see the 
following errors:

1) Error in custom provider, 
org.apache.isis.core.runtime.system.transaction.IsisTransactionManagerException: 
java.lang.NullPointerException
   at 
org.apache.isis.core.runtime.runner.IsisInjectModule.provideIsisSystem(IsisInjectModule.java:127)
   at 
org.apache.isis.core.runtime.runner.IsisInjectModule.provideIsisSystem(IsisInjectModule.java:127)
   while locating org.apache.isis.core.runtime.system.IsisSystem
     for field at 
org.apache.isis.viewer.wicket.viewer.IsisWicketApplication.isisSystem(IsisWicketApplication.java:149)
   while locating webapp.PortalApplication

1 error
     at 
com.google.inject.internal.Errors.throwProvisionExceptionIfErrorsExist(Errors.java:482)
     at 
com.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:67)
     at 
com.google.inject.internal.InjectorImpl.injectMembers(InjectorImpl.java:984)
     at 
org.apache.isis.viewer.wicket.viewer.IsisWicketApplication.init(IsisWicketApplication.java:264)
     at webapp.PortalApplication.init(PortalApplication.java:102)
>
> let me know...
>
> Dan
>
>
> On 29 April 2016 at 14:31, Erik de Hair <e....@pocos.nl> wrote:
>
>> Hi,
>>
>> When trying to run our application with org.apache.isis.WebServer using an
>> AppManifest I get the following error:
>>
>> 15:07:14,497  [IsisWicketApplication main       ERROR]  Failed to
>> initialize
>> com.google.inject.CreationException: Unable to create injector, see the
>> following errors:
>>
>> 1) A binding to org.apache.isis.applib.AppManifest was already configured
>> at
>> org.apache.isis.core.runtime.runner.IsisInjectModule.configure(IsisInjectModule.java:107).
>>    at webapp.PortalApplication$1.configure(PortalApplication.java:94) (via
>> modules: com.google.inject.util.Modules$OverrideModule ->
>> webapp.PortalApplication$1)
>>
>> 1 error
>>      at
>> com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:466)
>>      at
>> com.google.inject.internal.InternalInjectorCreator.initializeStatically(InternalInjectorCreator.java:155)
>>      at
>> com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:107)
>>      at com.google.inject.Guice.createInjector(Guice.java:96)
>>      at com.google.inject.Guice.createInjector(Guice.java:73)
>>      at com.google.inject.Guice.createInjector(Guice.java:62)
>>      at
>> org.apache.isis.viewer.wicket.viewer.IsisWicketApplication.init(IsisWicketApplication.java:262)
>>      at webapp.PortalApplication.init(PortalApplication.java:104)
>>      at org.apache.wicket.Application.initApplication(Application.java:823)
>>
>>
>> ThenewIsisWicketModule-method of our PortalApplication:
>>
>> @Override
>> protectedModule newIsisWicketModule()
>> {
>>     finalModule isisDefaults =super.newIsisWicketModule();
>>
>>     finalModule resellerPortalOverrides =newAbstractModule()
>>     {
>>        @Override
>>        protected voidconfigure()
>>        {
>>           bind(PageClassList.class).to(PortalPageClassList.class);
>>
>>   bind(String.class).annotatedWith(Names.named("applicationName")).toInstance("ITCO
>> Portal");
>>
>>   bind(String.class).annotatedWith(Names.named("applicationCss")).toInstance("css/application.css");
>>
>>   bind(String.class).annotatedWith(Names.named("applicationJs")).toInstance("scripts/application.js");
>>
>>   bind(String.class).annotatedWith(Names.named("welcomeMessage")).toInstance(readLines("welcome.html"));
>>
>>   bind(String.class).annotatedWith(Names.named("aboutMessage")).toInstance(readLines("about.html"));
>>
>>   bind(String.class).annotatedWith(Names.named("brandLogoHeader")).toInstance("/portal/images/Pocos-Logo-Powering-portal.png");
>>
>>   bind(String.class).annotatedWith(Names.named("brandLogoSignin")).toInstance("/portal/images/Pocos-Logo-Powering-portal.png");
>>
>>   bind(InputStream.class).annotatedWith(Names.named("metaInfManifest")).toProvider(Providers.of(getServletContext().getResourceAsStream("/META-INF/MANIFEST.MF")));
>>
>>   bind(ComponentFactoryRegistrar.class).to(PortalComponentFactoryRegistrar.class);
>>           bind(AppManifest.class).to(PortalModuleAppManifest.class);
>>        }
>>     };
>>
>>     returnModules.override(isisDefaults).with(resellerPortalOverrides);
>> }
>>
>> Did I forget something?
>>
>> Erik
>>
>>
>>


Re: Starting app with AppManifest (1.12.1)

Posted by Dan Haywood <da...@haywood-associates.co.uk>.
remove the line:

 bind(AppManifest.class).to(PortalModuleAppManifest.class);

from the PortalApplication... I think the error says its already
configured, probably because the isis.appManifest property is set in
isis.properties (or equivalently specified as -m flag to o.a.i.WebServer).

If that's the case, it might be a documentation issue that needs fixing.

let me know...

Dan


On 29 April 2016 at 14:31, Erik de Hair <e....@pocos.nl> wrote:

> Hi,
>
> When trying to run our application with org.apache.isis.WebServer using an
> AppManifest I get the following error:
>
> 15:07:14,497  [IsisWicketApplication main       ERROR]  Failed to
> initialize
> com.google.inject.CreationException: Unable to create injector, see the
> following errors:
>
> 1) A binding to org.apache.isis.applib.AppManifest was already configured
> at
> org.apache.isis.core.runtime.runner.IsisInjectModule.configure(IsisInjectModule.java:107).
>   at webapp.PortalApplication$1.configure(PortalApplication.java:94) (via
> modules: com.google.inject.util.Modules$OverrideModule ->
> webapp.PortalApplication$1)
>
> 1 error
>     at
> com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:466)
>     at
> com.google.inject.internal.InternalInjectorCreator.initializeStatically(InternalInjectorCreator.java:155)
>     at
> com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:107)
>     at com.google.inject.Guice.createInjector(Guice.java:96)
>     at com.google.inject.Guice.createInjector(Guice.java:73)
>     at com.google.inject.Guice.createInjector(Guice.java:62)
>     at
> org.apache.isis.viewer.wicket.viewer.IsisWicketApplication.init(IsisWicketApplication.java:262)
>     at webapp.PortalApplication.init(PortalApplication.java:104)
>     at org.apache.wicket.Application.initApplication(Application.java:823)
>
>
> ThenewIsisWicketModule-method of our PortalApplication:
>
> @Override
> protectedModule newIsisWicketModule()
> {
>    finalModule isisDefaults =super.newIsisWicketModule();
>
>    finalModule resellerPortalOverrides =newAbstractModule()
>    {
>       @Override
>       protected voidconfigure()
>       {
>          bind(PageClassList.class).to(PortalPageClassList.class);
>
>  bind(String.class).annotatedWith(Names.named("applicationName")).toInstance("ITCO
> Portal");
>
>  bind(String.class).annotatedWith(Names.named("applicationCss")).toInstance("css/application.css");
>
>  bind(String.class).annotatedWith(Names.named("applicationJs")).toInstance("scripts/application.js");
>
>  bind(String.class).annotatedWith(Names.named("welcomeMessage")).toInstance(readLines("welcome.html"));
>
>  bind(String.class).annotatedWith(Names.named("aboutMessage")).toInstance(readLines("about.html"));
>
>  bind(String.class).annotatedWith(Names.named("brandLogoHeader")).toInstance("/portal/images/Pocos-Logo-Powering-portal.png");
>
>  bind(String.class).annotatedWith(Names.named("brandLogoSignin")).toInstance("/portal/images/Pocos-Logo-Powering-portal.png");
>
>  bind(InputStream.class).annotatedWith(Names.named("metaInfManifest")).toProvider(Providers.of(getServletContext().getResourceAsStream("/META-INF/MANIFEST.MF")));
>
>  bind(ComponentFactoryRegistrar.class).to(PortalComponentFactoryRegistrar.class);
>          bind(AppManifest.class).to(PortalModuleAppManifest.class);
>       }
>    };
>
>    returnModules.override(isisDefaults).with(resellerPortalOverrides);
> }
>
> Did I forget something?
>
> Erik
>
>
>