Module could not be loaded - Hello World

English! place to talk about development, programming and coding
Post Reply
Dietrich1337
Znuny newbie
Posts: 11
Joined: 10 May 2023, 13:06
Znuny Version: 7.0
Real Name: Marcel Carus

Module could not be loaded - Hello World

Post by Dietrich1337 »

Hey guys,

I started the Hello World Practice and I am facing an issue now.
I am currently using Znuny 7.0.4 on RHEL9.

Worked everything fine for me and the Menu Button with Hello World is shown in my menu bar. But there is a 500 Internal Server Error, when I click the button. The log gives me this error message:

Code: Select all

Kernel::System::HelloWorld could not be loaded: Kernel/System/HelloWorld.pm did not return a true value at /opt/znuny/Kernel/System/ObjectManager.pm line 255.
I have no idea, what the problem is. I checked ObjectManager.pm at line 255 and there is a requirement for the correct file Ending ( .pm ).
But the file has the correct ending.

If someone can give me an advice, I would be very grateful

Best regards
root
Administrator
Posts: 4129
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: Module could not be loaded - Hello World

Post by root »

Hi,

How does Kernel/System/HelloWorld.pm looks like?

- Roy
Znuny and Znuny LTS running on CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO

Use a test system - always.

Do you need professional services? Check out https://www.znuny.com/

Do you want to contribute or want to know where it goes ?
Dietrich1337
Znuny newbie
Posts: 11
Joined: 10 May 2023, 13:06
Znuny Version: 7.0
Real Name: Marcel Carus

Re: Module could not be loaded - Hello World

Post by Dietrich1337 »

Code: Select all

# --
# Kernel/System/HelloWorld.pm - core module
# Copyright (C) (year) (name of author) (email of author)
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (GPL). If you
# did not receive this file, see https://www.gnu.org/licenses/gpl-3.0.txt.
# --

package Kernel::System::HelloWorld;

use strict;
use warnings;

# list your object dependencies (e.g. Kernel::System::DB) here
our @ObjectDependencies = (
    # 'Kernel::System::DB',
);

=head1 NAME

HelloWorld - Little "Hello World" module

=head1 DESCRIPTION

A simple module to display the text 'Hello World'.

=head2 new()

Create an object. Do not use it directly, instead use:

    my $HelloWorldObject = $Kernel::OM->Get('Kernel::System::HelloWorld');

=cut

sub new {
    my ( $Type, %Param ) = @_;

    # allocate new hash for object
    my $Self = {};
    bless ($Self, $Type);

    return $Self;
}

=head2 GetHelloWorldText()

Return the "Hello World" text.

    my $HelloWorldText = $HelloWorldObject->GetHelloWorldText();

=cut

sub GetHelloWorldText {
    my ( $Self, %Param ) = @_;

    # Get the DBObject from the central object manager
    # my $DBObject = $Kernel::OM->Get('Kernel::System::DB');

    my $HelloWorld = $Self->_FormatHelloWorldText(
        String => 'Hello World',
    );

    return $HelloWorld;
}

=begin Internal:

=head2 _FormatHelloWorldText()

Format "Hello World" text to uppercase

    my $HelloWorld = $Self->_FormatHelloWorldText(
        String => 'Hello World',
    );

=cut

sub _FormatHelloWorldText{
    my ( $Self, %Param ) = @_;

    my $HelloWorld = uc $Param{String};

    return $HelloWorld;

}

=end Internal:

1;
-rw-rw----. 1 znuny apache 1696 11. Mai 08:53 HelloWorld.pm
julio78
Znuny newbie
Posts: 1
Joined: 13 Jul 2023, 18:30
Znuny Version: 6.5.3
Real Name: julio vera
Company: arba

Re: Module could not be loaded - Hello World

Post by julio78 »

Hello guys, we have the same error
Kernel::System::HelloWorld could not be loaded: Kernel/System/HelloWorld.pm did not return a true value at /opt/otrs//Kernel/System/ObjectManager.pm line 255.

our version is Znuny 6.5.3 , we're stuck and can't continue, any sugestions?
Post Reply