Re: How can I remove the admin module?

2023-06-28 Thread Rene Cordier

Hello Martijn,

Yes removing the TaskManagerModule should work. You can only start admin 
tasks via wedadmin anyways. So if you don't use them, it is safe I 
believe to remove.


Best regards,
Rene.

On 28/06/2023 21:49, martijn brinkers wrote:

I think I have found it. I also had to disable the TaskManager module:

 private static final Module PROTOCOLS = Modules.combine(
 new ProtocolHandlerModule(),
 new SMTPServerModule(),
//new WebAdminServerModule(),
//new DataRoutesModules(),
//new MailRepositoriesRoutesModule(),
//new MailQueueRoutesModule(),
//new NoJwtModule(),
 new DefaultProcessorsConfigurationProviderModule()
//new TaskManagerModule()
 );


On Wed, Jun 28, 2023 at 4:27 PM martijn brinkers 
wrote:


Hi,

I'm trying to create a James server (I'm using release 3.8) without the
admin module. Main reason for this is that I want a minimal system.

As an experiement I created a copy of the jpa-smtp-app and then tried to
remove modules related to the webadmin.

It works if I disable some admin modules. However disabling the
DataRoutesModules results in a runtime error when trying to start the
application.

 From JPAJamesServerMain:

 private static final Module PROTOCOLS = Modules.combine(
 new ProtocolHandlerModule(),
 new SMTPServerModule(),
//new WebAdminServerModule(),
//new DataRoutesModules(),
//new MailRepositoriesRoutesModule(),
//new MailQueueRoutesModule(),
//new NoJwtModule(),
 new DefaultProcessorsConfigurationProviderModule(),
 new TaskManagerModule());

With the admin modules commented out, compilation works. However at
runtime the folllowing error is shown:


16:19:18.519 [ERROR] o.a.j.GuiceJamesServer - Fatal error while starting
James
com.google.inject.CreationException: Unable to create injector, see the
following errors:

1) [Guice/MissingImplementation]: No implementation for
Set> was bound.

Did you mean?
 Set> annotated with
@Named(value="additional_information_dto") bound at
TaskSerializationModule.provideAdditionalInformationDTOModules(TaskSerializationModule.java:60)
   \_ installed by: Modules$OverrideModule -> Modules$CombinedModule ->
Modules$CombinedModule -> Modules$CombinedModule -> TaskManagerModule ->
TaskSerializationModule

Requested by:
1  :
TaskSerializationModule.provideAdditionalInformationDTOModules(TaskSerializationModule.java:60)
   \_ for 1st parameter
  at
TaskSerializationModule.provideAdditionalInformationDTOModules(TaskSerializationModule.java:60)
   \_ installed by: Modules$OverrideModule -> Modules$CombinedModule ->
Modules$CombinedModule -> Modules$CombinedModule -> TaskManagerModule ->
TaskSerializationModule

Learn more:
   https://github.com/google/guice/wiki/MISSING_IMPLEMENTATION

2) [Guice/MissingImplementation]: No implementation for
Set> was bound.

Did you mean?
 Set> annotated with
@Named(value="task_dto") bound at
TaskSerializationModule.provideTaskDTOModules(TaskSerializationModule.java:83)
   \_ installed by: Modules$OverrideModule -> Modules$CombinedModule ->
Modules$CombinedModule -> Modules$CombinedModule -> TaskManagerModule ->
TaskSerializationModule

Requested by:
1  :
TaskSerializationModule.provideTaskDTOModules(TaskSerializationModule.java:83)
   \_ for 1st parameter
  at
TaskSerializationModule.provideTaskDTOModules(TaskSerializationModule.java:83)
   \_ installed by: Modules$OverrideModule -> Modules$CombinedModule ->
Modules$CombinedModule -> Modules$CombinedModule -> TaskManagerModule ->
TaskSerializationModule

If I only enable DataRoutesModules, the above error is not shown.

 private static final Module PROTOCOLS = Modules.combine(
 new ProtocolHandlerModule(),
 new SMTPServerModule(),
//new WebAdminServerModule(),
 new DataRoutesModules(),
//new MailRepositoriesRoutesModule(),
//new MailQueueRoutesModule(),
//new NoJwtModule(),
 new DefaultProcessorsConfigurationProviderModule(),
 new TaskManagerModule());

The DataRoutesModules however pull in spark-core via a dependency (and
therefore also jetty etc) which I would like to prevent.

What I do not understand is that it looks like
"Set>" is provided by TaskSerializationModule and
TaskSerializationModule is installed by TaskManagerModule. It therefore
looks like there is an implementation available.

Any suggestion on how I can complete remove the web admin (and it's
dependencies).

Kind regards,

Martijn Brinkers





-
To unsubscribe, e-mail: server-user-unsubscr...@james.apache.org
For additional commands, e-mail: server-user-h...@james.apache.org



Re: How can I remove the admin module?

2023-06-28 Thread martijn brinkers
I think I have found it. I also had to disable the TaskManager module:

private static final Module PROTOCOLS = Modules.combine(
new ProtocolHandlerModule(),
new SMTPServerModule(),
//new WebAdminServerModule(),
//new DataRoutesModules(),
//new MailRepositoriesRoutesModule(),
//new MailQueueRoutesModule(),
//new NoJwtModule(),
new DefaultProcessorsConfigurationProviderModule()
//new TaskManagerModule()
);


On Wed, Jun 28, 2023 at 4:27 PM martijn brinkers 
wrote:

> Hi,
>
> I'm trying to create a James server (I'm using release 3.8) without the
> admin module. Main reason for this is that I want a minimal system.
>
> As an experiement I created a copy of the jpa-smtp-app and then tried to
> remove modules related to the webadmin.
>
> It works if I disable some admin modules. However disabling the
> DataRoutesModules results in a runtime error when trying to start the
> application.
>
> From JPAJamesServerMain:
>
> private static final Module PROTOCOLS = Modules.combine(
> new ProtocolHandlerModule(),
> new SMTPServerModule(),
> //new WebAdminServerModule(),
> //new DataRoutesModules(),
> //new MailRepositoriesRoutesModule(),
> //new MailQueueRoutesModule(),
> //new NoJwtModule(),
> new DefaultProcessorsConfigurationProviderModule(),
> new TaskManagerModule());
>
> With the admin modules commented out, compilation works. However at
> runtime the folllowing error is shown:
>
>
> 16:19:18.519 [ERROR] o.a.j.GuiceJamesServer - Fatal error while starting
> James
> com.google.inject.CreationException: Unable to create injector, see the
> following errors:
>
> 1) [Guice/MissingImplementation]: No implementation for
> Set TaskExecutionDetails$AdditionalInformation, ? extends
> AdditionalInformationDTO>> was bound.
>
> Did you mean?
> Set TaskExecutionDetails$AdditionalInformation, ? extends
> AdditionalInformationDTO>> annotated with
> @Named(value="additional_information_dto") bound at
> TaskSerializationModule.provideAdditionalInformationDTOModules(TaskSerializationModule.java:60)
>   \_ installed by: Modules$OverrideModule -> Modules$CombinedModule ->
> Modules$CombinedModule -> Modules$CombinedModule -> TaskManagerModule ->
> TaskSerializationModule
>
> Requested by:
> 1  :
> TaskSerializationModule.provideAdditionalInformationDTOModules(TaskSerializationModule.java:60)
>   \_ for 1st parameter
>  at
> TaskSerializationModule.provideAdditionalInformationDTOModules(TaskSerializationModule.java:60)
>   \_ installed by: Modules$OverrideModule -> Modules$CombinedModule ->
> Modules$CombinedModule -> Modules$CombinedModule -> TaskManagerModule ->
> TaskSerializationModule
>
> Learn more:
>   https://github.com/google/guice/wiki/MISSING_IMPLEMENTATION
>
> 2) [Guice/MissingImplementation]: No implementation for
> Set> was bound.
>
> Did you mean?
> Set> annotated with
> @Named(value="task_dto") bound at
> TaskSerializationModule.provideTaskDTOModules(TaskSerializationModule.java:83)
>   \_ installed by: Modules$OverrideModule -> Modules$CombinedModule ->
> Modules$CombinedModule -> Modules$CombinedModule -> TaskManagerModule ->
> TaskSerializationModule
>
> Requested by:
> 1  :
> TaskSerializationModule.provideTaskDTOModules(TaskSerializationModule.java:83)
>   \_ for 1st parameter
>  at
> TaskSerializationModule.provideTaskDTOModules(TaskSerializationModule.java:83)
>   \_ installed by: Modules$OverrideModule -> Modules$CombinedModule ->
> Modules$CombinedModule -> Modules$CombinedModule -> TaskManagerModule ->
> TaskSerializationModule
>
> If I only enable DataRoutesModules, the above error is not shown.
>
> private static final Module PROTOCOLS = Modules.combine(
> new ProtocolHandlerModule(),
> new SMTPServerModule(),
> //new WebAdminServerModule(),
> new DataRoutesModules(),
> //new MailRepositoriesRoutesModule(),
> //new MailQueueRoutesModule(),
> //new NoJwtModule(),
> new DefaultProcessorsConfigurationProviderModule(),
> new TaskManagerModule());
>
> The DataRoutesModules however pull in spark-core via a dependency (and
> therefore also jetty etc) which I would like to prevent.
>
> What I do not understand is that it looks like
> "Set TaskExecutionDetails$AdditionalInformation, ? extends
> AdditionalInformationDTO>>" is provided by TaskSerializationModule and
> TaskSerializationModule is installed by TaskManagerModule. It therefore
> looks like there is an implementation available.
>
> Any suggestion on how I can complete remove the web admin (and it's
> dependencies).
>
> Kind regards,
>
> Martijn Brinkers
>