UniTime / unitime

Comprehensive University Timetabling System
http://www.unitime.org
Apache License 2.0
282 stars 163 forks source link

why I get this problem when I use (mvn zanata:pull) #83

Closed Abdulaziz-KTA closed 3 years ago

Abdulaziz-KTA commented 3 years ago

image first I use laptop and get this then I change to Hyper V still the same problem

Abdulaziz-KTA commented 3 years ago

I put Arabic Translation manual and use (ant import-translations -Dlocale=ar) then (ant build) Nothing happened I get this image

tomas-muller commented 3 years ago

This is related to Issue #82 -- please keep the questions related to the same thread in the same issue. Feel free to reopen the issue if you have follow-up questions.

It appears that this happens when the mvn zanata:pull is used on Java version 9 and older (UniTime is being built using Java 8 LTS). See ZNTA-2633 or ZNTA-2788 for more details. At the moment, if you insists in using Java 9 or later, the existing workaround is to replace the following lines in pom.xml

<plugin>
    <groupId>org.zanata</groupId>
    <artifactId>zanata-maven-plugin</artifactId>
    <version>4.6.2</version>
</plugin>

with the following lines

<plugin>
    <groupId>at.porscheinformatik.zanata</groupId>
    <artifactId>zanata-maven-plugin</artifactId>
    <version>4.7.0</version>
</plugin>

When the mvn zanata:pull succeeds, you should see the downloaded files xxx_ar.properties files in Documentation/Translations, for example:

% ls Documentation/Translations/*_ar.properties
Documentation/Translations/ConstantsMessages_ar.properties
Documentation/Translations/ExaminationMessages_ar.properties
Documentation/Translations/PageNames_ar.properties

Once the ant import-translations -Dlocale=ar is done, you should also see new xxx_ar.properties files under JavaSource/org/unitime/localization/messages and/or JavaSource/org/unitime/timetable/gwt/resources, for example:

% git status
On branch master
Your branch is up to date with 'origin/master'.

Untracked files:
  (use "git add <file>..." to include in what will be committed)
    JavaSource/org/unitime/localization/messages/ConstantsMessages_ar.properties
    JavaSource/org/unitime/localization/messages/ExaminationMessages_ar.properties
    JavaSource/org/unitime/localization/messages/PageNames_ar.properties

nothing added to commit but untracked files present (use "git add" to track)

Once the ant build is done, you should see a new UniTime.war in the Distributions folder. See http://help.unitime.org/build for more details. You need to put the UniTime.war under the Tomcat/webapps, just like you did with the one from the official distribution following the http://help.unitime.org/Timetabling_Installation document.

Abdulaziz-KTA commented 3 years ago

sorry and thank you

when ant build place UniTime.war in the Tomcat/webapps I get this image

tomas-muller commented 3 years ago

Is there any error in the Tomcat log?

Abdulaziz-KTA commented 3 years ago

image this is localhost_access_log.2021-04-19 file When use default it is work not use ant build

tomas-muller commented 3 years ago

This is not very helpful. Please check the other log files, in particular, the unitime.log and/or catalina.out. It should have something like:

[04/19/21 04:01:49] INFO   deployWAR -> Deploying web application archive [/Applications/apache-tomcat-9.0.13/webapps/UniTime.war]
...
[04/19/21 04:01:57] INFO   afterPropertiesSet -> ******* UniTime 4.5.162 build on Fri, 16 Apr 2021 is starting up *******
[04/19/21 04:01:57] INFO   afterPropertiesSet ->  - Initializing Logging ... 
[04/19/21 04:01:57] INFO   afterPropertiesSet ->  - Initializing Hibernate ... 
...
[04/19/21 04:02:21] INFO   afterPropertiesSet ->  - Creating Message Log Appender ... 
[04/19/21 04:02:21] INFO   afterPropertiesSet ->  - Initializing Room Availability Service ... 
[04/19/21 04:02:21] INFO   afterPropertiesSet ->  - Cleaning Logs ...
[04/19/21 04:02:21] INFO   afterPropertiesSet ->  - Starting Event Expiration Service ...
[04/19/21 04:02:21] INFO   EventExpirationService -> Event expiration service started.
[04/19/21 04:02:21] INFO   afterPropertiesSet -> ******* UniTime 4.5.162 build on Fri, 16 Apr 2021 initialized successfully *******

Also, did the build ant succeeded?

Abdulaziz-KTA commented 3 years ago

image put it default UniTime.war

image

image when put unitime build nothing happened into log unitime the last record was for default file

tomas-muller commented 3 years ago

Ok, let's try the other way as well. The UniTime.war that you have (as a result of the ant build), how big is it? If you rename it to UniTime.zip, can it be unzipped? It should contain a structure like this:

Screen Shot 2021-04-19 at 13 48 30

When you do ant build do you get a similar log as what is indicated on the http://help.unitime.org/build page? If not, can you send me the output?

Abdulaziz-KTA commented 3 years ago

this is file output https://drive.google.com/file/d/1gmunX_ESZLWLlVtQcW-gzCuEZooBZ7Qe/view?usp=sharing

ant build the same output on the link image

tomas-muller commented 3 years ago

Are you using the same version of Java to run the Tomcat as you have used to build UniTime?

I am using Java 13 and when I deploy your UniTime.war, I get the following error in localhost.2021-04-19.log that prevents UniTime from being deployed:

19-Apr-2021 17:46:36.320 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.listenerStart Error configuring application listener of class [org.unitime.timetable.filter.BusySessions$Listener]
    java.lang.UnsupportedClassVersionError: org/unitime/timetable/filter/BusySessions$Listener has been compiled by a more recent version of the Java Runtime (class file version 59.0), this version of the Java Runtime only recognizes class file versions up to 57.0 (unable to load class [org.unitime.timetable.filter.BusySessions$Listener])
        at org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:2398)
        at org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:857)
        at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1329)
        at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1182)
        at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:546)
        at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:527)
        at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:150)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4621)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5165)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:743)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:719)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:714)
        at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:970)
        at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1841)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at java.base/java.lang.Thread.run(Thread.java:830)

The error indicates that the UniTime was built with Java 15, and hence cannot be run with Java 13. It only works the other way around (UniTime built using and older version of Java would work on a newer version).

Abdulaziz-KTA commented 3 years ago

I use tomcat 8 and change jdk 15 to 13 still not working

i get this image

tomas-muller commented 3 years ago

You need to build UniTime using Java 13 then too.

Abdulaziz-KTA commented 3 years ago

run it on anther laptop it is work put I get new problem (Arabic translate) image

Sorry, I bothered you so much.

Abdulaziz-KTA commented 3 years ago

@tomas-muller Arabic not show

run it on anther laptop it is work put I get new problem (Arabic translate) image

Sorry, I bothered you so much.

tomas-muller commented 3 years ago

Looks like you have some character encoding issue. The downloaded translations should be in UTF-8. Ideally, when you download the translations (using mvn zanata:pull), you should see the downloaded translations correctly. For example:

% cat Documentation/Translations/PageNames_ar.properties
...
Courses=مقررات
Current_User=المستخدم الحالي
Curricula=مناهج
Curriculum_Detail=تفصيل المنهج
Curriculum_Details=تفاصيل المنهج

If your operating system is not set in UTF-8, you may see some weird characters in the downloaded files. In this case, the issue should be resolved by setting the file.encoding to utf-8 in the next step:

ant -Dlocale=ar -Dfile.encoding=UTF-8 import-translations

When done, you can check one of the imported files, e.g.:

% cat JavaSource/org/unitime/localization/messages/PageNames_ar.properties
...
# Default: Courses
Courses=\u0645\u0642\u0631\u0631\u0627\u062A

# Default: Current User
Current_User=\u0627\u0644\u0645\u0633\u062A\u062E\u062F\u0645 \u0627\u0644\u062D\u0627\u0644\u064A

# Default: Curricula
Curricula=\u0645\u0646\u0627\u0647\u062C

# Default: Curriculum Detail
Curriculum_Detail=\u062A\u0641\u0635\u064A\u0644 \u0627\u0644\u0645\u0646\u0647\u062C

# Default: Curriculum Details
Curriculum_Details=\u062A\u0641\u0627\u0635\u064A\u0644 \u0627\u0644\u0645\u0646\u0647\u062C

This is correct, the Arabic characters have been translated into the Unicode \uXXXX notation. You can verify the notation by copy&pasting one of the translated string into Decode/Unescape Unicode Entities conversion tool. Here is an example with the last string (using Curriculum Details translation):

Screen Shot 2021-04-25 at 13 52 37

After that, you can make a new UniTime build.

Abdulaziz-KTA commented 3 years ago

Thank you