问:
Liferay freezes durring boot
Do you have any advice of what might be wrong in my Liferay installation? I think the following log message is the most relevant:
The portal instance needs to be restarted to complete the installation of
Liferay is packed inside Tomcat; and when I try to start it it starts starting just fine, it loggs messages in console and then, all the sudden it freezes. Logs stop and application is not responding.

We have a cluster of 16 servers all running Liferay Community Edition Portal 7.0.4 GA5 inside Tomcat inside Java 8 virtual machine inside RedHat Linux. All 16 servers have the same copy of jars and wars deployed. 15 out of those 16 work just fine. But this one freezes. Other applications on the server in question work just fine, so it is probably not the Operating System related.

Here are some logs for you:

The most interesthing log is error log taken from the standard out:

```<code>
Thread dump for portal startup after waited 600000ms:

2022-12-13 12:32:21
Full thread dump Java HotSpot(TM) 64-Bit Server VM (25.231-b11 mixed mode):

"Attach Listener" #53 daemon prio=9 os_prio=0 tid=0x00007f89d0008800 nid=0x1734 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"com.liferay.portal.kernel.process.ProcessUtil-2" #52 daemon prio=1 os_prio=0 tid=0x00007f89b85c1000 nid=0x170b runnable [0x00007f8974c19000]
   java.lang.Thread.State: RUNNABLE

"com.liferay.portal.kernel.process.ProcessUtil-1" #51 daemon prio=1 os_prio=0 tid=0x00007f89b9304000 nid=0x170a runnable [0x00007f89776f5000]
   java.lang.Thread.State: RUNNABLE

"process reaper" #50 daemon prio=10 os_prio=0 tid=0x00007f89b85ab800 nid=0x1709 runnable [0x00007f89d80ae000]
   java.lang.Thread.State: RUNNABLE

"Java2D Disposer" #49 daemon prio=10 os_prio=0 tid=0x00007f8988190000 nid=0x14fe in Object.wait() [0x00007f8974d1a000]
   java.lang.Thread.State: WAITING (on object monitor)

"equinox telnet" #46 daemon prio=5 os_prio=0 tid=0x0000000001885800 nid=0x14f0 runnable [0x00007f8977ffe000]
   java.lang.Thread.State: RUNNABLE

"Portal Startup Monitoring Thread" #41 daemon prio=5 os_prio=0 tid=0x0000000001ff9000 nid=0x14c2 waiting on condition [0x00007f89774f3000]
   java.lang.Thread.State: WAITING (parking)

"SCR Component Actor" #40 daemon prio=5 os_prio=0 tid=0x0000000001fc3800 nid=0x14c1 in Object.wait() [0x00007f89775f4000]
   java.lang.Thread.State: WAITING (on object monitor)

"fileinstall-/opt/liferay/bundle/osgi/war" #38 daemon prio=5 os_prio=0 tid=0x0000000001d4b800 nid=0x14bf in Object.wait() [0x00007f89777f6000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)

"fileinstall-/opt/liferay/bundle/osgi/modules" #37 daemon prio=5 os_prio=0 tid=0x0000000001c84800 nid=0x14be in Object.wait() [0x00007f89778f7000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)

"fileinstall-/opt/liferay/bundle/osgi/shared" #36 daemon prio=5 os_prio=0 tid=0x0000000001c99000 nid=0x14bd in Object.wait() [0x00007f89779f8000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)

"fileinstall-/opt/liferay/bundle/osgi/marketplace" #35 daemon prio=5 os_prio=0 tid=0x0000000001c8c000 nid=0x14bc in Object.wait() [0x00007f8977af9000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)

"fileinstall-/opt/liferay/bundle/osgi/configs" #34 daemon prio=5 os_prio=0 tid=0x0000000001c9a000 nid=0x14bb in Object.wait() [0x00007f8977bfa000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)

"fileinstall-/opt/liferay/bundle/osgi/portal" #33 daemon prio=5 os_prio=0 tid=0x0000000001c92800 nid=0x14ba in Object.wait() [0x00007f8977cfb000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)

"Thread-6" #31 daemon prio=5 os_prio=0 tid=0x00007f8984001800 nid=0x14b8 waiting on condition [0x00007f8977dfc000]
   java.lang.Thread.State: WAITING (parking)

"Thread-5" #30 daemon prio=5 os_prio=0 tid=0x0000000001875800 nid=0x14b7 waiting on condition [0x00007f8977efd000]
   java.lang.Thread.State: WAITING (parking)

"CM Event Dispatcher" #28 daemon prio=5 os_prio=0 tid=0x000000000183b800 nid=0x14b5 in Object.wait() [0x00007f89c419b000]
   java.lang.Thread.State: WAITING (on object monitor)

"CM Configuration Updater" #27 daemon prio=5 os_prio=0 tid=0x00000000018a6800 nid=0x14b4 in Object.wait() [0x00007f89c4657000]
   java.lang.Thread.State: WAITING (on object monitor)

"Start Level: Equinox Container: 4023bd5b-d87a-001d-1ab8-f03d08a00709" #26 daemon prio=5 os_prio=0 tid=0x00007f89959f6000 nid=0x14ac in Object.wait() [0x00007f89c4758000]
   java.lang.Thread.State: WAITING (on object monitor)

"Bundle File Closer" #25 daemon prio=5 os_prio=0 tid=0x00007f89780b0800 nid=0x14ab in Object.wait() [0x00007f89c4551000]
   java.lang.Thread.State: WAITING (on object monitor)

"Refresh Thread: Equinox Container: 4023bd5b-d87a-001d-1ab8-f03d08a00709" #24 daemon prio=5 os_prio=0 tid=0x00007f8996540000 nid=0x14aa in Object.wait() [0x00007f89c48d3000]
   java.lang.Thread.State: WAITING (on object monitor)

"Framework Event Dispatcher: Equinox Container: 4023bd5b-d87a-001d-1ab8-f03d08a00709" #23 daemon prio=5 os_prio=0 tid=0x00007f899640b000 nid=0x14a9 in Object.wait() [0x00007f89c49d4000]
   java.lang.Thread.State: WAITING (on object monitor)

"Active Thread: Equinox Container: 4023bd5b-d87a-001d-1ab8-f03d08a00709" #21 prio=5 os_prio=0 tid=0x00007f8993fce000 nid=0x14a6 waiting on condition [0x00007f89c5ad5000]
   java.lang.Thread.State: TIMED_WAITING (parking)

"Tomcat JDBC Pool Cleaner[2070428996:1670930516054]" #20 daemon prio=5 os_prio=0 tid=0x00007f899c233800 nid=0x148c in Object.wait() [0x00007f89d8dda000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)

"localhost-startStop-1" #19 daemon prio=5 os_prio=0 tid=0x00007f899800c000 nid=0x1484 waiting on condition [0x00007f89d9ae5000]
   java.lang.Thread.State: WAITING (parking)

"Catalina-startStop-1" #18 daemon prio=5 os_prio=0 tid=0x00007f8a25eed800 nid=0x1483 waiting on condition [0x00007f89d9be7000]
   java.lang.Thread.State: WAITING (parking)

"NioBlockingSelector.BlockPoller-1" #17 daemon prio=5 os_prio=0 tid=0x00007f8a25edc000 nid=0x1482 runnable [0x00007f89f4189000]
   java.lang.Thread.State: RUNNABLE

"GC Daemon" #16 daemon prio=2 os_prio=0 tid=0x00007f8a25daa000 nid=0x1481 in Object.wait() [0x00007f89f44c8000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)

"AsyncFileHandlerWriter-1414644648" #15 daemon prio=5 os_prio=0 tid=0x00007f8a25913800 nid=0x147f waiting on condition [0x00007f89f4dfc000]
   java.lang.Thread.State: TIMED_WAITING (parking)

"oneagentperiodiceventsmanaged" #12 daemon prio=5 os_prio=0 tid=0x00007f8a08001000 nid=0x1471 runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"oneagentautosensor" #11 daemon prio=5 os_prio=0 tid=0x00007f89a8001000 nid=0x1470 runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"oneagentsubpathsender" #10 daemon prio=5 os_prio=0 tid=0x00007f8a04001000 nid=0x146f runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"oneagentperiodicrequests" #9 daemon prio=5 os_prio=0 tid=0x00007f8a0c001000 nid=0x146d runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"Service Thread" #8 daemon prio=9 os_prio=0 tid=0x00007f8a25774000 nid=0x147d runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"C1 CompilerThread2" #7 daemon prio=9 os_prio=0 tid=0x00007f8a25769000 nid=0x147c waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"C2 CompilerThread1" #6 daemon prio=9 os_prio=0 tid=0x00007f8a25767000 nid=0x147b waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"C2 CompilerThread0" #5 daemon prio=9 os_prio=0 tid=0x00007f8a25765000 nid=0x147a waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"Signal Dispatcher" #4 daemon prio=9 os_prio=0 tid=0x00007f8a25762800 nid=0x1479 runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"Finalizer" #3 daemon prio=8 os_prio=0 tid=0x00007f8a2571b800 nid=0x1478 in Object.wait() [0x00007f8a18600000]
   java.lang.Thread.State: WAITING (on object monitor)

"Reference Handler" #2 daemon prio=10 os_prio=0 tid=0x00007f8a25715000 nid=0x1477 in Object.wait() [0x00007f8a18701000]
   java.lang.Thread.State: WAITING (on object monitor)

"main" #1 prio=5 os_prio=0 tid=0x00007f8a244ce800 nid=0x1467 waiting on condition [0x00007f8a2885f000]
   java.lang.Thread.State: WAITING (parking)

"VM Thread" os_prio=0 tid=0x00007f8a246fd000 nid=0x1476 runnable

"GC task thread#0 (ParallelGC)" os_prio=0 tid=0x00007f8a24524800 nid=0x1472 runnable

"GC task thread#1 (ParallelGC)" os_prio=0 tid=0x00007f8a24526800 nid=0x1473 runnable

"GC task thread#2 (ParallelGC)" os_prio=0 tid=0x00007f8a24528800 nid=0x1474 runnable

"GC task thread#3 (ParallelGC)" os_prio=0 tid=0x00007f8a2452a000 nid=0x1475 runnable

"VM Periodic Task Thread" os_prio=0 tid=0x00007f8a25777000 nid=0x147e waiting on condition

JNI global references: 693
</code>```

I had to truncate logs to be able to post here.

I am really not that good at interpreting the thread dump so if you can see what is going on here?
It appears to me that Liferay is waiting for something to happen what never happens.

Second most interesting log is the catalina log taken durring server boot. In here you can see all what was happening before server froze:

```<code>    29-Nov-2022 15:48:58.762 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version:        Apache Tomcat/8.0.32
    29-Nov-2022 15:48:58.764 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built:          Feb 2 2016 19:34:53 UTC
    29-Nov-2022 15:48:58.764 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number:         8.0.32.0
    29-Nov-2022 15:48:58.764 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name:               Linux
    29-Nov-2022 15:48:58.764 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version:            3.10.0-862.3.3.el7.x86_64
    29-Nov-2022 15:48:58.764 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture:          amd64
    29-Nov-2022 15:48:58.764 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home:             /usr/java/jdk1.8.0_231-amd64/jre
    29-Nov-2022 15:48:58.764 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version:           1.8.0_231-b11
    29-Nov-2022 15:48:58.764 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor:            Oracle Corporation
    29-Nov-2022 15:48:58.764 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE:         /opt/liferay/liferay-ce-portal-7.0-ga5/tomcat-8.0.32
    29-Nov-2022 15:48:58.765 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME:         /opt/liferay/liferay-ce-portal-7.0-ga5/tomcat-8.0.32
    29-Nov-2022 15:48:58.765 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/opt/liferay/bundle/tomcat/conf/logging.properties
    29-Nov-2022 15:48:58.765 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
    29-Nov-2022 15:48:58.765 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dfile.encoding=UTF8
    29-Nov-2022 15:48:58.766 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.net.preferIPv4Stack=true
    29-Nov-2022 15:48:58.766 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dorg.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES=false
    29-Nov-2022 15:48:58.766 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Duser.timezone=GMT
    29-Nov-2022 15:48:58.766 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xmx3072m
    29-Nov-2022 15:48:58.766 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -DLIFERAY_LOGS=/opt/liferay/logs
    29-Nov-2022 15:48:58.766 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dhttps.proxyHost=192.168.255.60
    29-Nov-2022 15:48:58.766 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dhttps.proxyPort=8080
    29-Nov-2022 15:48:58.766 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dhttp.proxyHost=192.168.255.60
    29-Nov-2022 15:48:58.766 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dhttp.proxyPort=8080
    29-Nov-2022 15:48:58.766 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dhttp.nonProxyHosts=localhost|127.0.0.1|11.220.10.*|11.220.11.*|11.220.11.*|11.220.11.*|11.220.11.*|11.220.11.*|11.220.11.*|11.220.11.*
    29-Nov-2022 15:48:58.766 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.endorsed.dirs=/opt/liferay/bundle/tomcat/endorsed
    29-Nov-2022 15:48:58.767 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/opt/liferay/bundle/tomcat
    29-Nov-2022 15:48:58.767 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/opt/liferay/bundle/tomcat
    29-Nov-2022 15:48:58.767 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/opt/liferay/bundle/tomcat/temp
    29-Nov-2022 15:48:58.767 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -agentpath:/opt/dynatrace/oneagent/agent/lib64/liboneagentloader.so=loglevelcon=none,tenant=c36be366-d0cd-5d68-a746-328377dac62a,tenanttoken=ozhtrfDimuukoPl,server=https://11.220.19.2:8443/communication;https://11.220.19.3:8443/communication
    29-Nov-2022 15:48:58.767 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
    29-Nov-2022 15:48:58.930 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
    29-Nov-2022 15:48:58.945 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
    29-Nov-2022 15:48:58.949 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 533 ms
    29-Nov-2022 15:48:58.974 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service Catalina
    29-Nov-2022 15:48:58.974 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.0.32
    29-Nov-2022 15:48:58.983 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDescriptor Deploying configuration descriptor /opt/liferay/liferay-ce-portal-7.0-ga5/tomcat-8.0.32/conf/Catalina/localhost/ROOT.xml
    13-Dec-2022 11:21:57.350 INFO [localhost-startStop-1] org.apache.catalina.core.ApplicationContext.log No Spring WebApplicationInitializer types detected on classpath
    Loading jar:file:/opt/liferay/liferay-ce-portal-7.0-ga5/tomcat-8.0.32/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/system.properties
    Loading jar:file:/opt/liferay/liferay-ce-portal-7.0-ga5/tomcat-8.0.32/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/system.properties
    Loading jar:file:/opt/liferay/liferay-ce-portal-7.0-ga5/tomcat-8.0.32/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/portal.properties
    Loading file:/opt/liferay/liferay-ce-portal-7.0-ga5/portal-ext.properties
    log4j:WARN No such property [conversionPattern] in net.logstash.log4j.JSONEventLayoutV1.
    [Target Platform Indexer][main] INFO osgi.logging.org_eclipse_osgi - ServiceEvent REGISTERED {org.eclipse.osgi.service.security.TrustEngine}={service.ranking=-2147483648, osgi.signedcontent.trust.engine=org.eclipse.osgi, service.id=24, service.bundleid=0, service.scope=singleton}[Target Platform Indexer]
    [Target Platform Indexer][main] INFO osgi.logging.org_eclipse_osgi - ServiceEvent REGISTERED {org.eclipse.osgi.signedcontent.SignedContentFactory}={service.id=25, service.bundleid=0, service.scope=singleton}[Target Platform Indexer]
    [Target Platform Indexer][main] INFO osgi.logging.org_eclipse_osgi - ServiceEvent REGISTERED {org.eclipse.osgi.service.debug.DebugOptionsListener}={service.ranking=2147483647, listener.symbolic.name=org.eclipse.osgi, service.pid=0.org.eclipse.osgi.internal.debug.Debug, service.vendor=Eclipse.org - Equinox, service.id=26, service.bundleid=0, service.scope=singleton}[Target Platform Indexer]
    [Target Platform Indexer][main] INFO osgi.logging.org_eclipse_osgi - ServiceEvent REGISTERED {org.eclipse.osgi.service.debug.DebugOptionsListener}={service.ranking=2147483647, listener.symbolic.name=org.eclipse.osgi, service.pid=0.org.eclipse.osgi.container.ModuleContainer, service.vendor=Eclipse.org - Equinox, service.id=27, service.bundleid=0, service.scope=singleton}[Target Platform Indexer]
    [Target Platform Indexer][Framework stop] INFO osgi.logging.org_eclipse_osgi - ServiceEvent UNREGISTERING {com.liferay.portal.app.license.AppLicenseVerifier}={version=1.0.0, service.id=22, service.bundleid=0, service.scope=singleton}[Target Platform Indexer]
    [Target Platform Indexer][Framework stop] INFO osgi.logging.org_eclipse_osgi - ServiceEvent UNREGISTERING {org.osgi.framework.hooks.resolver.ResolverHookFactory}={service.id=23, service.bundleid=0, service.scope=singleton}[Target Platform Indexer]
    13-Dec-2022 11:22:31.648 INFO [localhost-startStop-1] org.apache.catalina.core.ApplicationContext.log Initializing Spring root WebApplicationContext
</code>```

Nothing too special here either. Only interesting thing about this log is that it ends after the line saying that it is initializing the spring root.

In the Liferay log the most interesthing record i could find is:

```<code>    {"@timestamp":"2022-11-29T15:49:42.300Z","source_host":"127.0.0.1","file":"LPKGArtifactInstaller.java","method":"_logRestartRequired","level":"INFO","line_number":"127","thread_name":"fileinstall-\/opt\/liferay\/bundle\/osgi\/marketplace","@version":1,"logger_name":"com.liferay.marketplace.deployer.internal.LPKGArtifactInstaller","message":"The portal instance needs to be restarted to complete the installation of \/opt\/liferay\/liferay-ce-portal-7.0-ga5\/osgi\/marketplace\/Liferay Marketplace.lpkg","class":"com.liferay.marketplace.deployer.internal.LPKGArtifactInstaller","mdc":{}}
</code>```

I am not allowed to attach the whole log file here.

Here what is interesting is that, toward the end of the log, it says that portal needs to be restarted to complete the installation. What is interesting is that whenever Tomcat is restarted the exact same logs are generated with this message that it needs to be restarted.

After these logs logging stops in total and no log entry is written to logs unless we restart the server.

This will not fix itself if we wait, we did not notice this problem for more than 6 months and durring those 6 months nothing was logged into logs. So, it is completely frozen.

Any idea? How to proceed into debugging this problem?

Title: Liferay freezes durring boot

Body:
Do you have any advice of what might be wrong in my Liferay installation? I think the following log message is the most relevant:
The portal instance needs to be restarted to complete the installation of
Liferay is packed inside Tomcat; and when I try to start it it starts starting just fine, it loggs messages in console and then, all the sudden it freezes. Logs stop and application is not responding.

We have a cluster of 16 servers all running Liferay Community Edition Portal 7.0.4 GA5 inside Tomcat inside Java 8 virtual machine inside RedHat Linux. All 16 servers have the same copy of jars and wars deployed. 15 out of those 16 work just fine. But this one freezes. Other applications on the server in question work just fine, so it is probably not the Operating System related.

Here are some logs for you:

The most interesthing log is error log taken from the standard out:

Thread dump for portal startup after waited 600000ms:

2022-12-13 12:32:21
Full thread dump Java HotSpot(TM) 64-Bit Server VM (25.231-b11 mixed mode):

"Attach Listener" #53 daemon prio=9 os_prio=0 tid=0x00007f89d0008800 nid=0x1734 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"com.liferay.portal.kernel.process.ProcessUtil-2" #52 daemon prio=1 os_prio=0 tid=0x00007f89b85c1000 nid=0x170b runnable [0x00007f8974c19000]
   java.lang.Thread.State: RUNNABLE

"com.liferay.portal.kernel.process.ProcessUtil-1" #51 daemon prio=1 os_prio=0 tid=0x00007f89b9304000 nid=0x170a runnable [0x00007f89776f5000]
   java.lang.Thread.State: RUNNABLE

"process reaper" #50 daemon prio=10 os_prio=0 tid=0x00007f89b85ab800 nid=0x1709 runnable [0x00007f89d80ae000]
   java.lang.Thread.State: RUNNABLE

"Java2D Disposer" #49 daemon prio=10 os_prio=0 tid=0x00007f8988190000 nid=0x14fe in Object.wait() [0x00007f8974d1a000]
   java.lang.Thread.State: WAITING (on object monitor)

"equinox telnet" #46 daemon prio=5 os_prio=0 tid=0x0000000001885800 nid=0x14f0 runnable [0x00007f8977ffe000]
   java.lang.Thread.State: RUNNABLE

"Portal Startup Monitoring Thread" #41 daemon prio=5 os_prio=0 tid=0x0000000001ff9000 nid=0x14c2 waiting on condition [0x00007f89774f3000]
   java.lang.Thread.State: WAITING (parking)

"SCR Component Actor" #40 daemon prio=5 os_prio=0 tid=0x0000000001fc3800 nid=0x14c1 in Object.wait() [0x00007f89775f4000]
   java.lang.Thread.State: WAITING (on object monitor)

"fileinstall-/opt/liferay/bundle/osgi/war" #38 daemon prio=5 os_prio=0 tid=0x0000000001d4b800 nid=0x14bf in Object.wait() [0x00007f89777f6000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)

"fileinstall-/opt/liferay/bundle/osgi/modules" #37 daemon prio=5 os_prio=0 tid=0x0000000001c84800 nid=0x14be in Object.wait() [0x00007f89778f7000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)

"fileinstall-/opt/liferay/bundle/osgi/shared" #36 daemon prio=5 os_prio=0 tid=0x0000000001c99000 nid=0x14bd in Object.wait() [0x00007f89779f8000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)

"fileinstall-/opt/liferay/bundle/osgi/marketplace" #35 daemon prio=5 os_prio=0 tid=0x0000000001c8c000 nid=0x14bc in Object.wait() [0x00007f8977af9000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)

"fileinstall-/opt/liferay/bundle/osgi/configs" #34 daemon prio=5 os_prio=0 tid=0x0000000001c9a000 nid=0x14bb in Object.wait() [0x00007f8977bfa000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)

"fileinstall-/opt/liferay/bundle/osgi/portal" #33 daemon prio=5 os_prio=0 tid=0x0000000001c92800 nid=0x14ba in Object.wait() [0x00007f8977cfb000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)

"Thread-6" #31 daemon prio=5 os_prio=0 tid=0x00007f8984001800 nid=0x14b8 waiting on condition [0x00007f8977dfc000]
   java.lang.Thread.State: WAITING (parking)

"Thread-5" #30 daemon prio=5 os_prio=0 tid=0x0000000001875800 nid=0x14b7 waiting on condition [0x00007f8977efd000]
   java.lang.Thread.State: WAITING (parking)

"CM Event Dispatcher" #28 daemon prio=5 os_prio=0 tid=0x000000000183b800 nid=0x14b5 in Object.wait() [0x00007f89c419b000]
   java.lang.Thread.State: WAITING (on object monitor)

"CM Configuration Updater" #27 daemon prio=5 os_prio=0 tid=0x00000000018a6800 nid=0x14b4 in Object.wait() [0x00007f89c4657000]
   java.lang.Thread.State: WAITING (on object monitor)

"Start Level: Equinox Container: 4023bd5b-d87a-001d-1ab8-f03d08a00709" #26 daemon prio=5 os_prio=0 tid=0x00007f89959f6000 nid=0x14ac in Object.wait() [0x00007f89c4758000]
   java.lang.Thread.State: WAITING (on object monitor)

"Bundle File Closer" #25 daemon prio=5 os_prio=0 tid=0x00007f89780b0800 nid=0x14ab in Object.wait() [0x00007f89c4551000]
   java.lang.Thread.State: WAITING (on object monitor)

"Refresh Thread: Equinox Container: 4023bd5b-d87a-001d-1ab8-f03d08a00709" #24 daemon prio=5 os_prio=0 tid=0x00007f8996540000 nid=0x14aa in Object.wait() [0x00007f89c48d3000]
   java.lang.Thread.State: WAITING (on object monitor)

"Framework Event Dispatcher: Equinox Container: 4023bd5b-d87a-001d-1ab8-f03d08a00709" #23 daemon prio=5 os_prio=0 tid=0x00007f899640b000 nid=0x14a9 in Object.wait() [0x00007f89c49d4000]
   java.lang.Thread.State: WAITING (on object monitor)

"Active Thread: Equinox Container: 4023bd5b-d87a-001d-1ab8-f03d08a00709" #21 prio=5 os_prio=0 tid=0x00007f8993fce000 nid=0x14a6 waiting on condition [0x00007f89c5ad5000]
   java.lang.Thread.State: TIMED_WAITING (parking)

"Tomcat JDBC Pool Cleaner[2070428996:1670930516054]" #20 daemon prio=5 os_prio=0 tid=0x00007f899c233800 nid=0x148c in Object.wait() [0x00007f89d8dda000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)

"localhost-startStop-1" #19 daemon prio=5 os_prio=0 tid=0x00007f899800c000 nid=0x1484 waiting on condition [0x00007f89d9ae5000]
   java.lang.Thread.State: WAITING (parking)

"Catalina-startStop-1" #18 daemon prio=5 os_prio=0 tid=0x00007f8a25eed800 nid=0x1483 waiting on condition [0x00007f89d9be7000]
   java.lang.Thread.State: WAITING (parking)

"NioBlockingSelector.BlockPoller-1" #17 daemon prio=5 os_prio=0 tid=0x00007f8a25edc000 nid=0x1482 runnable [0x00007f89f4189000]
   java.lang.Thread.State: RUNNABLE

"GC Daemon" #16 daemon prio=2 os_prio=0 tid=0x00007f8a25daa000 nid=0x1481 in Object.wait() [0x00007f89f44c8000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)

"AsyncFileHandlerWriter-1414644648" #15 daemon prio=5 os_prio=0 tid=0x00007f8a25913800 nid=0x147f waiting on condition [0x00007f89f4dfc000]
   java.lang.Thread.State: TIMED_WAITING (parking)

"oneagentperiodiceventsmanaged" #12 daemon prio=5 os_prio=0 tid=0x00007f8a08001000 nid=0x1471 runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"oneagentautosensor" #11 daemon prio=5 os_prio=0 tid=0x00007f89a8001000 nid=0x1470 runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"oneagentsubpathsender" #10 daemon prio=5 os_prio=0 tid=0x00007f8a04001000 nid=0x146f runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"oneagentperiodicrequests" #9 daemon prio=5 os_prio=0 tid=0x00007f8a0c001000 nid=0x146d runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"Service Thread" #8 daemon prio=9 os_prio=0 tid=0x00007f8a25774000 nid=0x147d runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"C1 CompilerThread2" #7 daemon prio=9 os_prio=0 tid=0x00007f8a25769000 nid=0x147c waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"C2 CompilerThread1" #6 daemon prio=9 os_prio=0 tid=0x00007f8a25767000 nid=0x147b waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"C2 CompilerThread0" #5 daemon prio=9 os_prio=0 tid=0x00007f8a25765000 nid=0x147a waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"Signal Dispatcher" #4 daemon prio=9 os_prio=0 tid=0x00007f8a25762800 nid=0x1479 runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"Finalizer" #3 daemon prio=8 os_prio=0 tid=0x00007f8a2571b800 nid=0x1478 in Object.wait() [0x00007f8a18600000]
   java.lang.Thread.State: WAITING (on object monitor)

"Reference Handler" #2 daemon prio=10 os_prio=0 tid=0x00007f8a25715000 nid=0x1477 in Object.wait() [0x00007f8a18701000]
   java.lang.Thread.State: WAITING (on object monitor)

"main" #1 prio=5 os_prio=0 tid=0x00007f8a244ce800 nid=0x1467 waiting on condition [0x00007f8a2885f000]
   java.lang.Thread.State: WAITING (parking)

"VM Thread" os_prio=0 tid=0x00007f8a246fd000 nid=0x1476 runnable

"GC task thread#0 (ParallelGC)" os_prio=0 tid=0x00007f8a24524800 nid=0x1472 runnable

"GC task thread#1 (ParallelGC)" os_prio=0 tid=0x00007f8a24526800 nid=0x1473 runnable

"GC task thread#2 (ParallelGC)" os_prio=0 tid=0x00007f8a24528800 nid=0x1474 runnable

"GC task thread#3 (ParallelGC)" os_prio=0 tid=0x00007f8a2452a000 nid=0x1475 runnable

"VM Periodic Task Thread" os_prio=0 tid=0x00007f8a25777000 nid=0x147e waiting on condition

JNI global references: 693

I had to truncate logs to be able to post here.

I am really not that good at interpreting the thread dump so if you can see what is going on here?
It appears to me that Liferay is waiting for something to happen what never happens.

Second most interesting log is the catalina log taken durring server boot. In here you can see all what was happening before server froze:

    29-Nov-2022 15:48:58.762 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version:        Apache Tomcat/8.0.32
    29-Nov-2022 15:48:58.764 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built:          Feb 2 2016 19:34:53 UTC
    29-Nov-2022 15:48:58.764 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number:         8.0.32.0
    29-Nov-2022 15:48:58.764 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name:               Linux
    29-Nov-2022 15:48:58.764 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version:            3.10.0-862.3.3.el7.x86_64
    29-Nov-2022 15:48:58.764 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture:          amd64
    29-Nov-2022 15:48:58.764 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home:             /usr/java/jdk1.8.0_231-amd64/jre
    29-Nov-2022 15:48:58.764 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version:           1.8.0_231-b11
    29-Nov-2022 15:48:58.764 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor:            Oracle Corporation
    29-Nov-2022 15:48:58.764 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE:         /opt/liferay/liferay-ce-portal-7.0-ga5/tomcat-8.0.32
    29-Nov-2022 15:48:58.765 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME:         /opt/liferay/liferay-ce-portal-7.0-ga5/tomcat-8.0.32
    29-Nov-2022 15:48:58.765 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/opt/liferay/bundle/tomcat/conf/logging.properties
    29-Nov-2022 15:48:58.765 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
    29-Nov-2022 15:48:58.765 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dfile.encoding=UTF8
    29-Nov-2022 15:48:58.766 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.net.preferIPv4Stack=true
    29-Nov-2022 15:48:58.766 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dorg.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES=false
    29-Nov-2022 15:48:58.766 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Duser.timezone=GMT
    29-Nov-2022 15:48:58.766 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xmx3072m
    29-Nov-2022 15:48:58.766 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -DLIFERAY_LOGS=/opt/liferay/logs
    29-Nov-2022 15:48:58.766 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dhttps.proxyHost=192.168.255.60
    29-Nov-2022 15:48:58.766 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dhttps.proxyPort=8080
    29-Nov-2022 15:48:58.766 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dhttp.proxyHost=192.168.255.60
    29-Nov-2022 15:48:58.766 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dhttp.proxyPort=8080
    29-Nov-2022 15:48:58.766 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dhttp.nonProxyHosts=localhost|127.0.0.1|11.220.10.*|11.220.11.*|11.220.11.*|11.220.11.*|11.220.11.*|11.220.11.*|11.220.11.*|11.220.11.*
    29-Nov-2022 15:48:58.766 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.endorsed.dirs=/opt/liferay/bundle/tomcat/endorsed
    29-Nov-2022 15:48:58.767 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/opt/liferay/bundle/tomcat
    29-Nov-2022 15:48:58.767 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/opt/liferay/bundle/tomcat
    29-Nov-2022 15:48:58.767 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/opt/liferay/bundle/tomcat/temp
    29-Nov-2022 15:48:58.767 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -agentpath:/opt/dynatrace/oneagent/agent/lib64/liboneagentloader.so=loglevelcon=none,tenant=c36be366-d0cd-5d68-a746-328377dac62a,tenanttoken=ozhtrfDimuukoPl,server=https://11.220.19.2:8443/communication;https://11.220.19.3:8443/communication
    29-Nov-2022 15:48:58.767 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
    29-Nov-2022 15:48:58.930 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
    29-Nov-2022 15:48:58.945 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
    29-Nov-2022 15:48:58.949 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 533 ms
    29-Nov-2022 15:48:58.974 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service Catalina
    29-Nov-2022 15:48:58.974 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.0.32
    29-Nov-2022 15:48:58.983 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDescriptor Deploying configuration descriptor /opt/liferay/liferay-ce-portal-7.0-ga5/tomcat-8.0.32/conf/Catalina/localhost/ROOT.xml
    13-Dec-2022 11:21:57.350 INFO [localhost-startStop-1] org.apache.catalina.core.ApplicationContext.log No Spring WebApplicationInitializer types detected on classpath
    Loading jar:file:/opt/liferay/liferay-ce-portal-7.0-ga5/tomcat-8.0.32/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/system.properties
    Loading jar:file:/opt/liferay/liferay-ce-portal-7.0-ga5/tomcat-8.0.32/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/system.properties
    Loading jar:file:/opt/liferay/liferay-ce-portal-7.0-ga5/tomcat-8.0.32/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/portal.properties
    Loading file:/opt/liferay/liferay-ce-portal-7.0-ga5/portal-ext.properties
    log4j:WARN No such property [conversionPattern] in net.logstash.log4j.JSONEventLayoutV1.
    [Target Platform Indexer][main] INFO osgi.logging.org_eclipse_osgi - ServiceEvent REGISTERED {org.eclipse.osgi.service.security.TrustEngine}={service.ranking=-2147483648, osgi.signedcontent.trust.engine=org.eclipse.osgi, service.id=24, service.bundleid=0, service.scope=singleton}[Target Platform Indexer]
    [Target Platform Indexer][main] INFO osgi.logging.org_eclipse_osgi - ServiceEvent REGISTERED {org.eclipse.osgi.signedcontent.SignedContentFactory}={service.id=25, service.bundleid=0, service.scope=singleton}[Target Platform Indexer]
    [Target Platform Indexer][main] INFO osgi.logging.org_eclipse_osgi - ServiceEvent REGISTERED {org.eclipse.osgi.service.debug.DebugOptionsListener}={service.ranking=2147483647, listener.symbolic.name=org.eclipse.osgi, service.pid=0.org.eclipse.osgi.internal.debug.Debug, service.vendor=Eclipse.org - Equinox, service.id=26, service.bundleid=0, service.scope=singleton}[Target Platform Indexer]
    [Target Platform Indexer][main] INFO osgi.logging.org_eclipse_osgi - ServiceEvent REGISTERED {org.eclipse.osgi.service.debug.DebugOptionsListener}={service.ranking=2147483647, listener.symbolic.name=org.eclipse.osgi, service.pid=0.org.eclipse.osgi.container.ModuleContainer, service.vendor=Eclipse.org - Equinox, service.id=27, service.bundleid=0, service.scope=singleton}[Target Platform Indexer]
    [Target Platform Indexer][Framework stop] INFO osgi.logging.org_eclipse_osgi - ServiceEvent UNREGISTERING {com.liferay.portal.app.license.AppLicenseVerifier}={version=1.0.0, service.id=22, service.bundleid=0, service.scope=singleton}[Target Platform Indexer]
    [Target Platform Indexer][Framework stop] INFO osgi.logging.org_eclipse_osgi - ServiceEvent UNREGISTERING {org.osgi.framework.hooks.resolver.ResolverHookFactory}={service.id=23, service.bundleid=0, service.scope=singleton}[Target Platform Indexer]
    13-Dec-2022 11:22:31.648 INFO [localhost-startStop-1] org.apache.catalina.core.ApplicationContext.log Initializing Spring root WebApplicationContext

Nothing too special here either. Only interesting thing about this log is that it ends after the line saying that it is initializing the spring root.

In the Liferay log the most interesthing record i could find is:

    {"@timestamp":"2022-11-29T15:49:42.300Z","source_host":"127.0.0.1","file":"LPKGArtifactInstaller.java","method":"_logRestartRequired","level":"INFO","line_number":"127","thread_name":"fileinstall-\/opt\/liferay\/bundle\/osgi\/marketplace","@version":1,"logger_name":"com.liferay.marketplace.deployer.internal.LPKGArtifactInstaller","message":"The portal instance needs to be restarted to complete the installation of \/opt\/liferay\/liferay-ce-portal-7.0-ga5\/osgi\/marketplace\/Liferay Marketplace.lpkg","class":"com.liferay.marketplace.deployer.internal.LPKGArtifactInstaller","mdc":{}}

I am not allowed to attach the whole log file here.

Here what is interesting is that, toward the end of the log, it says that portal needs to be restarted to complete the installation. What is interesting is that whenever Tomcat is restarted the exact same logs are generated with this message that it needs to be restarted.

After these logs logging stops in total and no log entry is written to logs unless we restart the server.

This will not fix itself if we wait, we did not notice this problem for more than 6 months and durring those 6 months nothing was logged into logs. So, it is completely frozen.

Any idea? How to proceed into debugging this problem?


来源: stackexchange

问:
pkg_resources.get_distribution() returns diffrent path to location when pyproject.toml is used
I have a python project that is installed via setup.py.
I usually install it as editable install:

py -3 -m pip install -e <path_to_my_project>

before I added pyproject.toml, execution of such an instruction:

```<code>import pkg_resources
pkg_resources.get_distribution('my-project')`
</code>```

returned:

my-project 0.0.0 (<path_to_my_project>)

After adding pyproject.toml (empty), the execution of this instruction looks like this:

my-project 0.0.0 (c:\users\<user>\appdata\local\programs\python\python310-32\lib\site-packages)

What should be added to pyproject.toml to have backward compatibility?

My setup.py looks as followS:

```<code>from setuptools import setup, find_packages

setup(
    name='my-project',
    packages=find_packages(where='src'),
    package_dir={"": "src"},
)

</code>```

I tried https://pip.pypa.io/en/stable/reference/build-system/pyproject-toml/#fallback-behaviour

ContentLicense: CC BY-SA 4.0

Body:
I have a python project that is installed via setup.py.
I usually install it as editable install:

py -3 -m pip install -e <path_to_my_project>

before I added pyproject.toml, execution of such an instruction:

import pkg_resources
pkg_resources.get_distribution('my-project')`

returned:

my-project 0.0.0 (<path_to_my_project>)

After adding pyproject.toml (empty), the execution of this instruction looks like this:

my-project 0.0.0 (c:\users\<user>\appdata\local\programs\python\python310-32\lib\site-packages)

What should be added to pyproject.toml to have backward compatibility?

My setup.py looks as followS:

from setuptools import setup, find_packages

setup(
    name='my-project',
    packages=find_packages(where='src'),
    package_dir={"": "src"},
)

I tried https://pip.pypa.io/en/stable/reference/build-system/pyproject-toml/#fallback-behaviour


问:
In `timetk` ,how to pad time by week?
How to pad date by week ? In timetk ,below code want to pad time by week ,but it failed.
Anyone can help ? Thanks!

```<code>library(tidyverse)
library(timetk)

df <- data.frame(month_day=as.Date(c('2022-1-1','2022-2-1','2022-3-1')),
                 amount=c(100,400,600))
df %>% pad_by_time(month_day,
                    .by='week',
                   .fill_na_direction='down',
                   .start_date='2022',
                   .end_date = '2022-3-31')
</code>```

Title: In `timetk` ,how to pad time by week?

Body:
How to pad date by week ? In timetk ,below code want to pad time by week ,but it failed.
Anyone can help ? Thanks!

library(tidyverse)
library(timetk)

df <- data.frame(month_day=as.Date(c('2022-1-1','2022-2-1','2022-3-1')),
                 amount=c(100,400,600))
df %>% pad_by_time(month_day,
                    .by='week',
                   .fill_na_direction='down',
                   .start_date='2022',
                   .end_date = '2022-3-31')


问:
Nested FormArrays using udos86/ng-dynamic-forms
I am using the package udos86/ng-dynamic-forms but I need to implement a 2 deep level nested forms, similar concept to Task and Subtasks, where the user can add as many tasks as he/she wants in the form, and for each task, the user can also as many subtasks as he/she wants.

For this concept, I have a global Add Task button, and for each Task row I have the Remove Task and Add Subtask button, adding these 2 buttons using an ng-template for the array. In this case the context would be the Task array, and not the subtasks. I need to implement this button, so it would add a new subtasks, but there is no example on how to achieve this in the documentation or in the questions asked in the issues.

This is an example of the fields I am using

```<code>export const CHECKLIST_TASK_FORM_MODEL: DynamicFormModel = [
  new DynamicFormArrayModel({
    id: 'task_array',
    initialCount: 1,
    groupFactory: () => {
      return [
        new DynamicFormGroupModel({
          id: 'task_group',
          legend: 'Name',
          group: [
            new MyDynamicInputModel(
              {
                id: 'task_no',
                label: 'Task No',
                readOnly: true,
                value: 1,
              },
              {
                grid: {
                  host: 'col-1',
                },
              }
            ),

            new MyDynamicInputModel(
              {
                id: 'task_name',
                label: 'Task Name',
                required: true,
              },
              {
                grid: {
                  host: 'col-2',
                },
              }
            ),

            new MyDynamicInputModel(
              {
                id: 'assigned_to',
                label: 'Assigned To',
              },
              {
                grid: {
                  host: 'col-2',
                },
              }
            ),
          ],
        }),

        new DynamicFormArrayModel({
          id: 'sub_task_array',
          initialCount: 0,
          groupFactory: () => {
            return [
              new DynamicFormGroupModel({
                id: 'task_group_children',
                legend: 'Name',
                group: [
                  new MyDynamicInputModel(
                    {
                      id: 'subtasks_name',
                      label: 'Subtask Name',
                    },
                    {
                      grid: {
                        host: 'col-4',
                      },
                    }
                  ),

                  new MyDynamicInputModel(
                    {
                      id: 'notes2',
                      label: 'Notes',
                    },
                    {
                      grid: {
                        host: 'col-4',
                      },
                    }
                  ),
                ],
              }),
            ];
          },
        }),
      ];
    },
  }),
];
</code>```

Thanks for the help

Body:
I am using the package udos86/ng-dynamic-forms but I need to implement a 2 deep level nested forms, similar concept to Task and Subtasks, where the user can add as many tasks as he/she wants in the form, and for each task, the user can also as many subtasks as he/she wants.

For this concept, I have a global Add Task button, and for each Task row I have the Remove Task and Add Subtask button, adding these 2 buttons using an ng-template for the array. In this case the context would be the Task array, and not the subtasks. I need to implement this button, so it would add a new subtasks, but there is no example on how to achieve this in the documentation or in the questions asked in the issues.

This is an example of the fields I am using

export const CHECKLIST_TASK_FORM_MODEL: DynamicFormModel = [
  new DynamicFormArrayModel({
    id: 'task_array',
    initialCount: 1,
    groupFactory: () => {
      return [
        new DynamicFormGroupModel({
          id: 'task_group',
          legend: 'Name',
          group: [
            new MyDynamicInputModel(
              {
                id: 'task_no',
                label: 'Task No',
                readOnly: true,
                value: 1,
              },
              {
                grid: {
                  host: 'col-1',
                },
              }
            ),

            new MyDynamicInputModel(
              {
                id: 'task_name',
                label: 'Task Name',
                required: true,
              },
              {
                grid: {
                  host: 'col-2',
                },
              }
            ),

            new MyDynamicInputModel(
              {
                id: 'assigned_to',
                label: 'Assigned To',
              },
              {
                grid: {
                  host: 'col-2',
                },
              }
            ),
          ],
        }),

        new DynamicFormArrayModel({
          id: 'sub_task_array',
          initialCount: 0,
          groupFactory: () => {
            return [
              new DynamicFormGroupModel({
                id: 'task_group_children',
                legend: 'Name',
                group: [
                  new MyDynamicInputModel(
                    {
                      id: 'subtasks_name',
                      label: 'Subtask Name',
                    },
                    {
                      grid: {
                        host: 'col-4',
                      },
                    }
                  ),

                  new MyDynamicInputModel(
                    {
                      id: 'notes2',
                      label: 'Notes',
                    },
                    {
                      grid: {
                        host: 'col-4',
                      },
                    }
                  ),
                ],
              }),
            ];
          },
        }),
      ];
    },
  }),
];

Thanks for the help


问:
Accessing resources from a Qt application
I'm developing a Qt application that is using many resources (music, sounds, images) from external files.

I don't want to use the Qt Resources System, as the size of my resources is big.

Here is my dev folder-structure :

```<code>myApp+-res+-images- *.jpg, *.png images
     |    |
     |    +-sounds- *.wav sounds
     |
     +-src- myApp.pro
            *.cpp files
            *.h files
</code>```

When I compile and run my program from Qt Creator, in debug mode, the application path is this one :

```<code>.../myApp/build-GameFramework-Desktop_Qt_6_3_0_MinGW_64_bit-Debug/debug
</code>```

so, my resources files are in this relative location : ../../res/

This relative location is the same if I compile and run my program from Qt Creator in release mode.

But when I want to deploy my program, my res folder is in the same folder as my application :

```<code>myApp+-res+-images- *.jpg, *.png images
     |    |
     |    +-sounds- *.wav sounds
     |
     +-myApp.exe
</code>```

This means my resources files are now in this relative location : res/, which is not the same as when I'm developing my app.

Is there a way to have my resources at the same relative location, no matter if I run my app from Qt Creator or from my application folder ?

If not, what is the best/easiest way to cope with this problem ?

Body:
I'm developing a Qt application that is using many resources (music, sounds, images) from external files.

I don't want to use the Qt Resources System, as the size of my resources is big.

Here is my dev folder-structure :

myApp+-res+-images- *.jpg, *.png images
     |    |
     |    +-sounds- *.wav sounds
     |
     +-src- myApp.pro
            *.cpp files
            *.h files

When I compile and run my program from Qt Creator, in debug mode, the application path is this one :

.../myApp/build-GameFramework-Desktop_Qt_6_3_0_MinGW_64_bit-Debug/debug

so, my resources files are in this relative location : ../../res/

This relative location is the same if I compile and run my program from Qt Creator in release mode.

But when I want to deploy my program, my res folder is in the same folder as my application :

myApp+-res+-images- *.jpg, *.png images
     |    |
     |    +-sounds- *.wav sounds
     |
     +-myApp.exe

This means my resources files are now in this relative location : res/, which is not the same as when I'm developing my app.

Is there a way to have my resources at the same relative location, no matter if I run my app from Qt Creator or from my application folder ?

If not, what is the best/easiest way to cope with this problem ?


问:
AES encryption via URL
We are using this Microsoft sample code (https://learn.microsoft.com/en-us/dotnet/api/system.security.cryptography.aes?view=net-7.0) to generate the encrypted information, then Convert.ToBase64String() to achieve valueA shown below.

The encrypted information is this (valueA):

```<code>i6k/KpzA/5O8w557u4X+nhprrOWj4KwxChIqw2mgt/Dc6AuFGT9piTuYtytQf8ZdlRe8Z3MeL20oUOimGeo2xA==
</code>```

If we pass it via URL it changes to this (valueB):

```<code>i6k%2FKpzA%2F5O8w557u4X%2BnhprrOWj4KwxChIqw2mgt%2FDc6AuFGT9piTuYtytQf8ZdlRe8Z3MeL20oUOimGeo2xA%3D%3D
</code>```

So, when we try to decrypt this valueB information we apply Convert.FromBase64String(), but it returns an error due to charset replacement.

How can I make this work?

Title: AES encryption via URL

Body:
We are using this Microsoft sample code (https://learn.microsoft.com/en-us/dotnet/api/system.security.cryptography.aes?view=net-7.0) to generate the encrypted information, then Convert.ToBase64String() to achieve valueA shown below.

The encrypted information is this (valueA):

i6k/KpzA/5O8w557u4X+nhprrOWj4KwxChIqw2mgt/Dc6AuFGT9piTuYtytQf8ZdlRe8Z3MeL20oUOimGeo2xA==

If we pass it via URL it changes to this (valueB):

i6k%2FKpzA%2F5O8w557u4X%2BnhprrOWj4KwxChIqw2mgt%2FDc6AuFGT9piTuYtytQf8ZdlRe8Z3MeL20oUOimGeo2xA%3D%3D

So, when we try to decrypt this valueB information we apply Convert.FromBase64String(), but it returns an error due to charset replacement.

How can I make this work?


问:
Looking to find repeat payment within 18 months of the first transaction date
My goal is to find the contact numbers who have a second transaction within 18 months of the first transaction.

This is the SQL Query I have currently:

```<code>SELECT [contact_number]
      ,[transaction_date]
      ,[transaction_type]
      ,[amount]
      ,[payment_method]
  FROM [dbo].[financial_history]
  WHERE [payment_method] IN ('CASH', 'CHQ')
    AND YEAR([transaction_date]) = YEAR(CURRENT_TIMESTAMP)
</code>```

This is getting me all the contacts within 2022 with the payment method of CASH and CHQ

The Table Looks like this:

contact_number
transaction date
transaction type
amount
payment method

111111
2022-11-25 00:00:00.000
xxxxxxxxxxx
xx
xxxxxxxx

111111
2022-11-14 00:00:00.000
xxxxxxxxxxx
xx
xxxxxxxx

111111
2022-11-30 00:00:00.000
xxxxxxxxxxx
xx
xxxxxxxx

I want the new query to pull something that will look like this:

contact_number
transaction date
transaction type
amount
payment method
Second

111111
2022-11-25 00:00:00.000
xxxxxxxxxxx
xx
xxxxxxxx
2022-11-25 00:00:00.000

111111
2022-11-14 00:00:00.000
xxxxxxxxxxx
xx
xxxxxxxx

111111
2022-11-30 00:00:00.000
xxxxxxxxxxx
xx
xxxxxxxx

There are multiple contact numbers with multiple transactions on the same date so I only want the second column to line up with the second transaction date only. The second transaction has to be within 18 months of the first.

Body:
My goal is to find the contact numbers who have a second transaction within 18 months of the first transaction.

This is the SQL Query I have currently:

SELECT [contact_number]
      ,[transaction_date]
      ,[transaction_type]
      ,[amount]
      ,[payment_method]
  FROM [dbo].[financial_history]
  WHERE [payment_method] IN ('CASH', 'CHQ')
    AND YEAR([transaction_date]) = YEAR(CURRENT_TIMESTAMP)

This is getting me all the contacts within 2022 with the payment method of CASH and CHQ

The Table Looks like this:

contact_number
transaction date
transaction type
amount
payment method

111111
2022-11-25 00:00:00.000
xxxxxxxxxxx
xx
xxxxxxxx

111111
2022-11-14 00:00:00.000
xxxxxxxxxxx
xx
xxxxxxxx

111111
2022-11-30 00:00:00.000
xxxxxxxxxxx
xx
xxxxxxxx

I want the new query to pull something that will look like this:

contact_number
transaction date
transaction type
amount
payment method
Second

111111
2022-11-25 00:00:00.000
xxxxxxxxxxx
xx
xxxxxxxx
2022-11-25 00:00:00.000

111111
2022-11-14 00:00:00.000
xxxxxxxxxxx
xx
xxxxxxxx

111111
2022-11-30 00:00:00.000
xxxxxxxxxxx
xx
xxxxxxxx

There are multiple contact numbers with multiple transactions on the same date so I only want the second column to line up with the second transaction date only. The second transaction has to be within 18 months of the first.


问:
View the recent appended input in chatbox and empty the textarea
I am trying to create a chatbox for our project in WebDev. As I click send on the button provided, it will append the value from the textarea and will automatically delete or remove the recent input in the textarea.

I already tried to follow the instruction in this link emptying the textarea in IE but I didn't get it.

I am a first year college student in programming and I really know little to nothing in this matter.

```<code>    <form action="" class="form-container">
        <p><img src="" alt="logo">Nanon Virtual Assistant</p> <hr>
        <label for="msg" ><b>Message</b></label>
        <div id="chatbody">
            <img src="" alt="logo">
            <p>By using this service, I consent to provide my personal data in accordance to the Nanon Privacy Policy and applicable Philippine privacy laws.</p> <br>
            <div id="message"></div>
        </div>
        <textarea type="text" id="msg" placeholder="Type message" required></textarea>
        <button type="button" class="btn cancel" onclick="closeForm()">Close</button>
        <button type="button" class="btn send" onclick="send(); openmsg();">Send</button>
    </form>
</code>```
```<code>function send() {var y = document.getElementById("msg").value;document.getElementById("message").innerHTML = y;}
function send() {const node = document.createElement("div"); const textnode = document.createTextNode(document.getElementById("msg").value); node.appendChild(textnode); document.getElementById("message").appendChild(node);}
</code>```
```<code>#chatbody{overflow-y: auto; padding: 3vh 0 0 0; text-align: center; height: 30vh; background-color: #c9fcff50;}
#chatbody p{font-size: 2vh;}
#message{height: fit-content; width: 22vw;}
#message div{text-align: left; margin-left: auto; margin-right: 0; background-color: #299aa0; color: white; word-wrap: break-word; width: fit-content; max-width: 15vw; margin-top: 1.5vh;  padding: .5vw 2vw .5vw 2vw; border-radius: 25px; }
</code>```

Sample image

Body:
I am trying to create a chatbox for our project in WebDev. As I click send on the button provided, it will append the value from the textarea and will automatically delete or remove the recent input in the textarea.

I already tried to follow the instruction in this link emptying the textarea in IE but I didn't get it.

I am a first year college student in programming and I really know little to nothing in this matter.

    <form action="" class="form-container">

Nanon Virtual Assistant

        Message

By using this service, I consent to provide my personal data in accordance to the Nanon Privacy Policy and applicable Philippine privacy laws.

        <textarea type="text" id="msg" placeholder="Type message" required></textarea>
        <button type="button" class="btn cancel" onclick="closeForm()">Close</button>
        <button type="button" class="btn send" onclick="send(); openmsg();">Send</button>
    </form>

function send() {var y = document.getElementById("msg").value;document.getElementById("message").innerHTML = y;}
function send() {const node = document.createElement("div"); const textnode = document.createTextNode(document.getElementById("msg").value); node.appendChild(textnode); document.getElementById("message").appendChild(node);}

#chatbody{overflow-y: auto; padding: 3vh 0 0 0; text-align: center; height: 30vh; background-color: #c9fcff50;}
#chatbody p{font-size: 2vh;}
#message{height: fit-content; width: 22vw;}
#message div{text-align: left; margin-left: auto; margin-right: 0; background-color: #299aa0; color: white; word-wrap: break-word; width: fit-content; max-width: 15vw; margin-top: 1.5vh;  padding: .5vw 2vw .5vw 2vw; border-radius: 25px; }

Sample image


问:
grep matching control -ie vs -ei and patterns
I don't understand the matching control with grep.

```<code>grep --include "*.md" -rnw -ie 'word1.*word2'
</code>```

vs

```<code>grep --include "*.md" -rnw . -ie 'word1.*word2'
</code>```

vs

```<code>grep --include "*.md" -rnw -ei 'word1.*word2'
</code>```

vs

```<code>grep --include "*.md" -rnw . -ei 'word1.*word2'
</code>```

I do not understand why these grep expression are not equivalent.

The 1st one outputs as I presumed
any content which starts with word1 followed by a set of chars before word2.

This expression seems to be equivalent to the 2nd one.

The last expression outputs seems to be equivalent to

```<code>  grep --include "*.md" -rnw . -ei
</code>```

and outputs isolated i, such as "i.e" or i) or -i

the 3rd expression I do not understand its output

Thanks

Body:
I don't understand the matching control with grep.

grep --include "*.md" -rnw -ie 'word1.*word2'

vs

grep --include "*.md" -rnw . -ie 'word1.*word2'

vs

grep --include "*.md" -rnw -ei 'word1.*word2'

vs

grep --include "*.md" -rnw . -ei 'word1.*word2'

I do not understand why these grep expression are not equivalent.

The 1st one outputs as I presumed
any content which starts with word1 followed by a set of chars before word2.

This expression seems to be equivalent to the 2nd one.

The last expression outputs seems to be equivalent to

  grep --include "*.md" -rnw . -ei

and outputs isolated i, such as "i.e" or i) or -i

the 3rd expression I do not understand its output

Thanks


问:
Changing linetype with modelplot
I am trying to change the linetypes of my regression plot with model plot.
I have several indices, displayed for several groups(all participants, only women, only men and different age groups).
There is no error message, but somehow, the linetype argument is not applied. However, the color argument works. Did that happen to anyone before or can you find my mistake?

This is my code, for the gender differentiation:

```<code>#Plots for all index, #2 for gender (sex.V0)
models7 <- list("Social Index Female"=ols_women, "Social Index Male"=ols_men, "Trust Index Female"=ols_women_trust, "Trust Index Male"=ols_men_trust, "Identification Index Female"=ols_women_id, "Identification Index Male"=ols_men_id, "Motivation Index Female"=ols_women_mot, "Motivation Index Male"=ols_men_mot, "Engagement Index Female"=ols_women_eng, "Engagement Index Male"=ols_men_eng)

b <-list(geom_vline(xintercept = 0, color='yellow'), scale_color_manual(values=c("Social Index Female"='red', "Social Index Male"='red', "Trust Index Female"='orange', "Trust Index Male"='orange', "Identification Index Female"='green', "Identification Index Male"='green', "Motivation Index Female"='blue', "Motivation Index Male"='blue', "Engagement Index Female"='purple', "Engagement Index Male"='purple'), aesthetics="color"), scale_linetype_manual(values=c("Social Index Female"='solid', "Social Index Male"='dashed', "Trust Index Female"='solid', "Trust Index Male"='dashed', "Identification Index Female"='solid', "Identification Index Male"='dashed', "Motivation Index Female"='solid', "Motivation Index Male"='dashed', "Engagement Index Female"='solid', "Engagement Index Male"='dashed')))

modelplot(models7, background= b, coef_omit = "Intercept", coef_rename = ("tx.V0"="TE"))+ labs(title="Coefficient Plots Gender")+theme_classic()
ggsave("plot_gender.png")

</code>```

Thanks!!

```<code>[enter image description here](https://i.stack.imgur.com/qMPqy.png)
</code>```

this is the resulting plot!

Title: Changing linetype with modelplot

Body:
I am trying to change the linetypes of my regression plot with model plot.
I have several indices, displayed for several groups(all participants, only women, only men and different age groups).
There is no error message, but somehow, the linetype argument is not applied. However, the color argument works. Did that happen to anyone before or can you find my mistake?

This is my code, for the gender differentiation:

#Plots for all index, #2 for gender (sex.V0)
models7 <- list("Social Index Female"=ols_women, "Social Index Male"=ols_men, "Trust Index Female"=ols_women_trust, "Trust Index Male"=ols_men_trust, "Identification Index Female"=ols_women_id, "Identification Index Male"=ols_men_id, "Motivation Index Female"=ols_women_mot, "Motivation Index Male"=ols_men_mot, "Engagement Index Female"=ols_women_eng, "Engagement Index Male"=ols_men_eng)

b <-list(geom_vline(xintercept = 0, color='yellow'), scale_color_manual(values=c("Social Index Female"='red', "Social Index Male"='red', "Trust Index Female"='orange', "Trust Index Male"='orange', "Identification Index Female"='green', "Identification Index Male"='green', "Motivation Index Female"='blue', "Motivation Index Male"='blue', "Engagement Index Female"='purple', "Engagement Index Male"='purple'), aesthetics="color"), scale_linetype_manual(values=c("Social Index Female"='solid', "Social Index Male"='dashed', "Trust Index Female"='solid', "Trust Index Male"='dashed', "Identification Index Female"='solid', "Identification Index Male"='dashed', "Motivation Index Female"='solid', "Motivation Index Male"='dashed', "Engagement Index Female"='solid', "Engagement Index Male"='dashed')))

modelplot(models7, background= b, coef_omit = "Intercept", coef_rename = ("tx.V0"="TE"))+ labs(title="Coefficient Plots Gender")+theme_classic()
ggsave("plot_gender.png")

Thanks!!

[enter image description here](https://i.stack.imgur.com/qMPqy.png)

this is the resulting plot!


问:
Type 'Element' is not assignable to type 'FC<ReactElement<any, string | JSXElementConstructor<any>>>'
when I convert my functional component with declaring a function, getting an error as:

Type 'Element' is not assignable to type 'FC<ReactElement<any, string | JSXElementConstructor<any>>>'. need to understand this error. any one help me?

works well:

```<code>import { FC, ReactElement } from "react";
import "./App.css";

const App: FC = (): ReactElement => {
  return (
    <div>
      <h1>Hello React!</h1>
    </div>
  );
};

export default App;
</code>```

same function converted to this, then throw the above error:

```<code>import { FC, ReactElement } from "react";
import "./App.css";

    function App(): FC<ReactElement> {
      return (
        <div>
          <h1>Hello React!</h1>
        </div>
      );
    }

    export default App;
</code>```

Body:
when I convert my functional component with declaring a function, getting an error as:

Type 'Element' is not assignable to type 'FC<ReactElement<any, string | JSXElementConstructor<any>>>'. need to understand this error. any one help me?

works well:

import { FC, ReactElement } from "react";
import "./App.css";

const App: FC = (): ReactElement => {
  return (

Hello React!

  );
};

export default App;

same function converted to this, then throw the above error:

import { FC, ReactElement } from "react";
import "./App.css";

    function App(): FC<ReactElement> {
      return (

Hello React!

      );
    }

    export default App;


问:
Typescript has any type even if its defined
```<code>import { InboundResponseHeadersT } from './types'
export const handler = async () => {
  let status = true
  let lastId: string | null = null
  while (status) {
    try {
      //.       ERROR IS HERE
      let { data, messageData } = await axios
        .get('https://xxxxxxxx/httpadapter/inbound', {
          httpsAgent: new https.Agent({ rejectUnauthorized: false }),
          headers: {
            'X-DeleteAfterConfirmation': true,
            'X-LastId': lastId,
          },
          auth: {
            username: 'xxx',
            password: 'xxxx',
          },
        })
        .then((res) => ({
          data: res.data as string,
          messageData: res.headers as InboundResponseHeadersT,
        }))
      const parser = new XMLParser({ ignoreAttributes: false })
      let obj = parser.parse(data)

      await watchEvent(obj, messageData['x-conversationid'])
      lastId = messageData['x-id']
    } catch (err) {
      status = false
      break
    }
  }
}
</code>```

The exporting type

```<code>export type InboundResponseHeadersT = {
  'x-messageversion': string
  'x-backendreceiverid': string
  'x-schemaset': string
  'x-conversationid': string
  'x-id': string
  'x-filename': string
  'x-messageid': string
  'content-type': 'text/xml'
  'x-backendsenderid': string
  'x-messagetype': string
  'x-content-type-options': string
  'x-xss-protection': string
  'strict-transport-security': string
  'x-frame-options': string
  'content-length': string
}
</code>```

I have the following problem that my TS says that messageData has type any even if i set the type in the return statement. What am i doing wrong here?

EDIT:

After removing the while() loop the error dissapear. But i need the loop

Body:
import { InboundResponseHeadersT } from './types'
export const handler = async () => {
  let status = true
  let lastId: string | null = null
  while (status) {
    try {
      //.       ERROR IS HERE
      let { data, messageData } = await axios
        .get('https://xxxxxxxx/httpadapter/inbound', {
          httpsAgent: new https.Agent({ rejectUnauthorized: false }),
          headers: {
            'X-DeleteAfterConfirmation': true,
            'X-LastId': lastId,
          },
          auth: {
            username: 'xxx',
            password: 'xxxx',
          },
        })
        .then((res) => ({
          data: res.data as string,
          messageData: res.headers as InboundResponseHeadersT,
        }))
      const parser = new XMLParser({ ignoreAttributes: false })
      let obj = parser.parse(data)

      await watchEvent(obj, messageData['x-conversationid'])
      lastId = messageData['x-id']
    } catch (err) {
      status = false
      break
    }
  }
}

The exporting type

export type InboundResponseHeadersT = {
  'x-messageversion': string
  'x-backendreceiverid': string
  'x-schemaset': string
  'x-conversationid': string
  'x-id': string
  'x-filename': string
  'x-messageid': string
  'content-type': 'text/xml'
  'x-backendsenderid': string
  'x-messagetype': string
  'x-content-type-options': string
  'x-xss-protection': string
  'strict-transport-security': string
  'x-frame-options': string
  'content-length': string
}

I have the following problem that my TS says that messageData has type any even if i set the type in the return statement. What am i doing wrong here?

EDIT:

After removing the while() loop the error dissapear. But i need the loop


问:
Access Denied You don't have permission to access "site" on this server using ChromeDriver and Chrome through Selenium Java
I've been using selenium with chrome and I've been trying to access a website but I keep receiving this error message:

Access Denied You don't have permission to access "website" on this server.

The website works fine on my regular chrome browser, but when opened through selenium I receive this error message.

Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'CHL130688', ip: '10.100.40.93', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '19.0.1'
Driver info: org.openqa.selenium.chrome.ChromeDriver


问:
SQL Pivot Table - Either make dynamic column headers in pivot, or transpose result
I have a table populated with timesheet information that looks like the following:

Interval
Team
Count

9:30AM
Team1
0

9:00AM
Team1
2

11:00AM
Team3
2.5

12:30AM
Team2
4

.
.
.

This table represents how many employess (Count, a float) are working for which team (Team, as Str) during which time of day (Interval, datatype Time).

I have tried the below:

```<code>SELECT *

FROM
    (SELECT
        [Interval] AS 'TimeBlock'
        ,Team
        ,ROUND([Count]/2,1) AS 'Hours'
    FROM  MyTable
    WHERE [Interval] >= CONVERT(TIME, DATEADD(MINUTE, ROUND(DATEDIFF(MINUTE, 0, GETDATE()) / 30.0, 0) * 30, 0))
    ) AS "SUB"
PIVOT
    (SUM(Hours)
    FOR Team IN
        ([Team1]
        ,[Team2]
        ,[Team3])
    ) AS "Pivot";
</code>```

Which yields a pivot table that lists the team across the top (along the pivot, or has the teams as the columns). What I would like is to show the time intervals across the top, and the team listed down the left hand side.

I know that listing the time intervals in the pivot will give me my desired result. However, I do not want to list every 30 min time interval between 6:00 AM and Midnight

As a work around I have simply been using excel to unpivot the columns, and then pivot along the time interval.

BONUS: Have a total by team as the final column and total by time as the final row
Ex//

Team
9:30 AM
10:00 AM
10:30 AM
11:00 AM
TOTAL

Team1
0
1
0.5
1
2.5

Team2
2
3
1
3
9

Team3
2.5
1
2
2
7.5

TOTAL
4.5
5
3.5
6
19

Body:
I have a table populated with timesheet information that looks like the following:

Interval
Team
Count

9:30AM
Team1
0

9:00AM
Team1
2

11:00AM
Team3
2.5

12:30AM
Team2
4

.
.
.

This table represents how many employess (Count, a float) are working for which team (Team, as Str) during which time of day (Interval, datatype Time).

I have tried the below:

SELECT *

FROM
    (SELECT
        [Interval] AS 'TimeBlock'
        ,Team
        ,ROUND([Count]/2,1) AS 'Hours'
    FROM  MyTable
    WHERE [Interval] >= CONVERT(TIME, DATEADD(MINUTE, ROUND(DATEDIFF(MINUTE, 0, GETDATE()) / 30.0, 0) * 30, 0))
    ) AS "SUB"
PIVOT
    (SUM(Hours)
    FOR Team IN
        ([Team1]
        ,[Team2]
        ,[Team3])
    ) AS "Pivot";

Which yields a pivot table that lists the team across the top (along the pivot, or has the teams as the columns). What I would like is to show the time intervals across the top, and the team listed down the left hand side.

I know that listing the time intervals in the pivot will give me my desired result. However, I do not want to list every 30 min time interval between 6:00 AM and Midnight

As a work around I have simply been using excel to unpivot the columns, and then pivot along the time interval.

BONUS: Have a total by team as the final column and total by time as the final row
Ex//

Team
9:30 AM
10:00 AM
10:30 AM
11:00 AM
TOTAL

Team1
0
1
0.5
1
2.5

Team2
2
3
1
3
9

Team3
2.5
1
2
2
7.5

TOTAL
4.5
5
3.5
6
19


问:
How to send multiple selected values, appending them as parameter to URL string - ( in JSON Server)?
I have a basic question, but still getting confused a lot.
Please note the following things before I take you to the problem

I am using JSON server as my fake API for now.

I am utilizing Material UI's select menu ( select multiple)

I am using reactJs

My Search URL is "http://localhost:3000/cars_like=Verna,Toyota,Mercedes,Audi" - this would be sent to fake api to get the filtered results in turn.

My typical Json shape -

[{id: 1, carList : ["Verna", "Toyota","Audi"]},
{id : 2, carList : ["Toyota","Audi" ]},
{id : 3, carList : ["Toyota","Mercedes" ]}, ... }];

Problem Description -
Into my MUI's select menu, I send the tags as "Toyota", "Mercedes", "Audi". I am getting "[]" an empty array as response.
I want that at least id : 3, could returned as it contains "Toyota, Mercedes", althought not "Audi".
Again there is one problem I found while filtering through multiple values into the json-server is -

When I send search params as - "Verna", "Audi", it returns me [], but it could return me an object with "id" : 1 (see above), the only difference is it contains "Toyota" between "Verna" & "Audi", and I think the (search operation breaks there and not even go to "Audi" at all).
But on the other hand, If I add filters exactly the way they are mentioned into my Json-data , say for instance "Verna", "Toyota", "Audi", they returns me the response.

How to send the parameters to the json-server, that even if the filters are not being sent into the exact order as contained in a particular json-object, it return me only those objects, whose carList array, get matched with maximum filter values.
I think I was able to describe you the problem I am facing.
All suggestions are welcome!


问:
selectone in mybatis throws nullpointerException
DAO

```<code>// Review Total Count
public int reviewTotalCnt() {
    System.out.println("========== Review Total Count DAO ==========");

    return sqlSession.selectOne("ReviewMapper.reviewTotalCnt");
}
</code>```

XML

```<code><!-- Review Total Count -->
<select id="reviewTotalCnt" resultType="int">
    SELECT COUNT(r_id)
    FROM b_review;
</select>
</code>```

Please help

I tried changing the XML resultType to Integer and the return type to Integer, but it didn't work.

Body:
DAO

// Review Total Count
public int reviewTotalCnt() {
    System.out.println("========== Review Total Count DAO ==========");

    return sqlSession.selectOne("ReviewMapper.reviewTotalCnt");
}

XML

<select id="reviewTotalCnt" resultType="int">
    SELECT COUNT(r_id)
    FROM b_review;
</select>

Please help

I tried changing the XML resultType to Integer and the return type to Integer, but it didn't work.


问:
MTD, QTD, YTD Aggregation
I'm trying to build a report aggregation that contains Client Name, Row Date, Offered, Handled, and other metrics. I'm not able to figure out how to aggregate the metrics for MTD, QTD, YTD for Offered, Handle and other metrics. In tableau, i was able to apply this method using this code SUM(IF [Row date] <= [SelectedDate] AND MONTH([Row date]) = MONTH([SelectedDate]) AND YEAR([Row date]) = YEAR([SelectedDate]) THEN [Handled] END ), but i'm not able to apply it in SSRS. Please advise . thanks.

Title: MTD, QTD, YTD Aggregation


问:
Laravel 9 with Vite breaks a JS file on 'npm run build'
I am trying to use @yaireo/tagify in my Laravel 9 project. (https://www.npmjs.com/package/@yaireo/tagify)

I imported it with npm i @yaireo/tagify --save

Then put import Tagify from '@yaireo/tagify' in my app.js file, then ran npm run build on my project.

I can verify the code gets added to the project as it appears in my previously empty app.abc123.js file by looking at the sources within Chrome. The file looks compressed / optimized which I expect to happen.

However, I get this error in the console jquery-3.6.1.min.js:2 Uncaught ReferenceError: Tagify is not defined

I've also tried copying the jQuery.tagify.min.js file to /resources/js/jQuery.tagify.min.js and then using @vite(['resources/js/jQuery.tagify.min.js']) within the blade template, then npm run build to build the files. Again this works, and the file is included in the sources, but the exact same error.

The only way I were able to get it to work without the error was by copying jQuery.tagify.min.js directly to /public/build/assets/jQuery.tagify.min.js and using  in the blade template.

This says to me that vite seems to be doing something when it's trying to compress/optimise the file that breaks the functionality.

I recall running into the same issues with bootstrap and JQuery and ultimately decided to reference the CDN for those files.

This is the raw jQuery.tagify.min.js file: https://pastebin.com/PzK7ps25

This is the file after being processed by vite / npm run build: https://pastebin.com/1FCDXyty

What am I doing wrong?

Edit:

Not that it should have any bearing on the issue, the code I am using within the blade template is:

```<code><input name='basic' value='tag1, tag2, group 3, etc...'>

<script>
    $( document ).ready(function() {
        // The DOM element you wish to replace with Tagify
        var input = document.querySelector('input[name=basic]');

        // initialize Tagify on the above input node reference
        new Tagify(input)
    });

</script>
</code>```

Body:
I am trying to use @yaireo/tagify in my Laravel 9 project. (https://www.npmjs.com/package/@yaireo/tagify)

I imported it with npm i @yaireo/tagify --save

Then put import Tagify from '@yaireo/tagify' in my app.js file, then ran npm run build on my project.

I can verify the code gets added to the project as it appears in my previously empty app.abc123.js file by looking at the sources within Chrome. The file looks compressed / optimized which I expect to happen.

However, I get this error in the console jquery-3.6.1.min.js:2 Uncaught ReferenceError: Tagify is not defined

I've also tried copying the jQuery.tagify.min.js file to /resources/js/jQuery.tagify.min.js and then using @vite(['resources/js/jQuery.tagify.min.js']) within the blade template, then npm run build to build the files. Again this works, and the file is included in the sources, but the exact same error.

The only way I were able to get it to work without the error was by copying jQuery.tagify.min.js directly to /public/build/assets/jQuery.tagify.min.js and using  in the blade template.

This says to me that vite seems to be doing something when it's trying to compress/optimise the file that breaks the functionality.

I recall running into the same issues with bootstrap and JQuery and ultimately decided to reference the CDN for those files.

This is the raw jQuery.tagify.min.js file: https://pastebin.com/PzK7ps25

This is the file after being processed by vite / npm run build: https://pastebin.com/1FCDXyty

What am I doing wrong?

Edit:

Not that it should have any bearing on the issue, the code I am using within the blade template is:

<input name='basic' value='tag1, tag2, group 3, etc...'>


问:
angular-editor AngularEditor removed some characters like CSS style
angular-editor AngularEditor removed some characters like CSS style

when I click on code view in the angular editor toolbar, enter some CSS code, and then save the angular editor removed CSS style

config: AngularEditorConfig = {
  editable: true,
  enableToolbar: true,
  showToolbar: true,
  spellcheck: true,
  height: '15rem',
  minHeight: '5rem',
  placeholder: 'Enter text here...',
  translate: 'no',
  defaultParagraphSeparator: 'p',
  defaultFontName: 'Arial',
  toolbarHiddenButtons: [
    ['bold']
    ],
  customClasses: [
    {
      name: "quote",
      class: "quote",
    },
    {
      name: 'redText',
      class: 'redText'
    },
    {
      name: "titleText",
      class: "titleText",
      tag: "h1",
    },
  ]
};
}```
<pre class="snippet-code-html lang-html prettyprint-override"><code><angular-editor  [(ngModel)]="model.Message" [config]="config" name="Message"></angular-editor></code>```

Body:
angular-editor AngularEditor removed some characters like CSS style

when I click on code view in the angular editor toolbar, enter some CSS code, and then save the angular editor removed CSS style

config: AngularEditorConfig = {
  editable: true,
  enableToolbar: true,
  showToolbar: true,
  spellcheck: true,
  height: '15rem',
  minHeight: '5rem',
  placeholder: 'Enter text here...',
  translate: 'no',
  defaultParagraphSeparator: 'p',
  defaultFontName: 'Arial',
  toolbarHiddenButtons: [
    ['bold']
    ],
  customClasses: [
    {
      name: "quote",
      class: "quote",
    },
    {
      name: 'redText',
      class: 'redText'
    },
    {
      name: "titleText",
      class: "titleText",
      tag: "h1",
    },
  ]
};
}

<angular-editor  [(ngModel)]="model.Message" [config]="config" name="Message"></angular-editor>


问:
How to use Ardalis Specification with ValueObject and HasConversion
Let's say I use a ValueObject for a ZipCode, and I have a Converter to save it as a string in the database.

// EntityTypeConfiguration
builder.Property(p => p.ZipCode)
    .HasConversion<ValueOfConverter<ZipCode, string>>()
    .HasMaxLength(PostalCodeMaxLength)
    .IsRequired();
```
<p>When I'm doing a search, I have to cast like this or else I get and exception</p>
<pre class="lang-cs prettyprint-override"><code>// Query
Query.Search(x => (string)(object)x.ZipCode, zipCode);
</code>```

Body:
Let's say I use a ValueObject for a ZipCode, and I have a Converter to save it as a string in the database.

// EntityTypeConfiguration
builder.Property(p => p.ZipCode)
    .HasConversion<ValueOfConverter<ZipCode, string>>()
    .HasMaxLength(PostalCodeMaxLength)
    .IsRequired();

When I'm doing a search, I have to cast like this or else I get and exception

// Query
Query.Search(x => (string)(object)x.ZipCode, zipCode);


问:
Why Imputation converts float64 column to object and not converting again?
I just did mean imputation on a pandas dataframe, but the column after imputation in converted to object type and is not converting back to float. I tried astype(float), which says need a string not a method, to_numeric() also donot work.

this is it is converted to object

Applying astype() function

This is the error that comes

```<code># mean imputation
mean_age = df['Age'].mean
df['Mean_Age'] = df['Age'].fillna(mean_age)

# This makes the column to object and astype() and to_numeric() even donot work to convert it back to float
</code>```

Body:
I just did mean imputation on a pandas dataframe, but the column after imputation in converted to object type and is not converting back to float. I tried astype(float), which says need a string not a method, to_numeric() also donot work.

this is it is converted to object

Applying astype() function

This is the error that comes

# mean imputation
mean_age = df['Age'].mean
df['Mean_Age'] = df['Age'].fillna(mean_age)

# This makes the column to object and astype() and to_numeric() even donot work to convert it back to float


问:
Modifying/Closing Connector 9060 port from server.xml without whole appserver restart
I have an app which listens on 9060 port. What i want to acheive is, if i remove the 9060 port from server.xml and then stop/terminate my app, 9060 port should be completely closed i.e netstat -tanp | grep 9060 - should return nothing.

Currently 9060 related connector in my server.xml looks like this,

```<code><Connector port="9060" maxThreads="150" minSpareThreads="25" maxSpareThreads="75" enableLookups="false" acceptCount="100"
         connectionTimeout="20000" disableUploadTimeout="true" />
</code>```

However, what i want to understand is, is it practically possible without whole appserver restart? Does the 9060 port related change in server.xml reflect only when appserver is restarted? Is there any way to achieve this without entire appserver restart?

Body:
I have an app which listens on 9060 port. What i want to acheive is, if i remove the 9060 port from server.xml and then stop/terminate my app, 9060 port should be completely closed i.e netstat -tanp | grep 9060 - should return nothing.

Currently 9060 related connector in my server.xml looks like this,

<Connector port="9060" maxThreads="150" minSpareThreads="25" maxSpareThreads="75" enableLookups="false" acceptCount="100"
         connectionTimeout="20000" disableUploadTimeout="true" />

However, what i want to understand is, is it practically possible without whole appserver restart? Does the 9060 port related change in server.xml reflect only when appserver is restarted? Is there any way to achieve this without entire appserver restart?


问:
Adobe Analytics - how to get report API 2.0 to get multi-level breakdown data using Java
I need help in getting adobe-analytics data when multiple IDs are passed for multi-level breakdown using API 2.0.

I am getting first level data for V124 ----

```<code>"metricContainer": {
        "metrics": [
            {
                "columnId": "0",
                "id": "metrics/event113",
                "sort": "desc"
            }
        ]
    },
    "dimension": "variables/evar124",
</code>```

but i want to use IDs returned in above call response to in second level breakdown of v124 to get v125 as---

```<code>"metricContainer": {
        "metrics": [
            {
                "columnId": "0",
                "id": "metrics/event113",
                "sort": "desc",
                "filters": [
                    "0"
                ]
            }
        ],
        "metricFilters": [
            {
                "id": "0",
                "type": "breakdown",
                "dimension": "variables/evar124",
                "itemId": "2629267831"
            },
            {
                "id": "1",
                "type": "breakdown",
                "dimension": "variables/evar124",
                "itemId": "2629267832"
            }
        ]
    },
    "dimension": "variables/evar125",
</code>```

This always returns data only for 2629267831 ID and not 2629267832.
I want to get data for thousands of IDs (returned from first API call) in a single API call. What am i doing wrong?

Body:
I need help in getting adobe-analytics data when multiple IDs are passed for multi-level breakdown using API 2.0.

I am getting first level data for V124 ----

"metricContainer": {
        "metrics": [
            {
                "columnId": "0",
                "id": "metrics/event113",
                "sort": "desc"
            }
        ]
    },
    "dimension": "variables/evar124",

but i want to use IDs returned in above call response to in second level breakdown of v124 to get v125 as---

"metricContainer": {
        "metrics": [
            {
                "columnId": "0",
                "id": "metrics/event113",
                "sort": "desc",
                "filters": [
                    "0"
                ]
            }
        ],
        "metricFilters": [
            {
                "id": "0",
                "type": "breakdown",
                "dimension": "variables/evar124",
                "itemId": "2629267831"
            },
            {
                "id": "1",
                "type": "breakdown",
                "dimension": "variables/evar124",
                "itemId": "2629267832"
            }
        ]
    },
    "dimension": "variables/evar125",

This always returns data only for 2629267831 ID and not 2629267832.
I want to get data for thousands of IDs (returned from first API call) in a single API call. What am i doing wrong?


问:
How to use BrowserHistory in Redux actions lavel react-router-dom v6
I am new on react-router-dom v6. I want to use BrowserHistory in redux ations. Usually I wrapp my app with BrowserHistory and pass history object.

index.js

```<code>root.render(
  <BrowserRouter history={history}>
    <Provider store={store}>
      <App />
    </Provider>
  </BrowserRouter>
)
</code>```

history.js

```<code>import { createBrowserHistory } from 'history'
export default createBrowserHistory()

</code>```
```<code>// Actions
export const createStream = (data) => async (dispatch, getState) => {
  const { userId } = getState().auth

  try {
     const response = await addStream({ ...data, userId })
     dispatch({
       type: STREAM_ADDED,
       payload: { stream: response.data },
     })
    history.push('/')
  } catch (ex) {}
}
</code>```

When user successfully create streams then I want to navigate user "/" path.

Body:
I am new on react-router-dom v6. I want to use BrowserHistory in redux ations. Usually I wrapp my app with BrowserHistory and pass history object.

index.js

root.render(
  <BrowserRouter history={history}>
    <Provider store={store}>
      <App />
    </Provider>
  </BrowserRouter>
)

history.js

import { createBrowserHistory } from 'history'
export default createBrowserHistory()

// Actions
export const createStream = (data) => async (dispatch, getState) => {
  const { userId } = getState().auth

  try {
     const response = await addStream({ ...data, userId })
     dispatch({
       type: STREAM_ADDED,
       payload: { stream: response.data },
     })
    history.push('/')
  } catch (ex) {}
}

When user successfully create streams then I want to navigate user "/" path.


问:
how to get image from html page using flask and convert it into np.array?
I have a Flask and HTML Code (mentioned below), in this code, I have a image, and it has respective button.

```<code><form action="{{url_for('predict')}}" method="POST">
    <img src="static/a.png" alt="Saree" style="width:100%" name="my_image_for_prediction">
    <button type="submit" class="button-17" role="button" style = "position:absolute; left:136px; bottom:80px;">Make Predictions</button>
</form>
</code>```

and my flask code is this:

```<code>app = Flask(__name__)

@app.route('/')
def index():
    return render_template('index.html')

@app.route('/predict', methods=['GET', 'POST'])
def predict():
    img = request.form.get('my_image_for_prediction')
    img = np.asarray(PIL.Image.open(img))
</code>```

error:

```<code>AttributeError: 'NoneType' object has no attribute 'read'
</code>```

I want to get the image from the html file and convert that image into numpy array. How do i do it??

Body:
I have a Flask and HTML Code (mentioned below), in this code, I have a image, and it has respective button.

<form action="{{url_for('predict')}}" method="POST">

    <button type="submit" class="button-17" role="button" style = "position:absolute; left:136px; bottom:80px;">Make Predictions</button>
</form>

and my flask code is this:

app = Flask(__name__)

@app.route('/')
def index():
    return render_template('index.html')

@app.route('/predict', methods=['GET', 'POST'])
def predict():
    img = request.form.get('my_image_for_prediction')
    img = np.asarray(PIL.Image.open(img))

error:

AttributeError: 'NoneType' object has no attribute 'read'

I want to get the image from the html file and convert that image into numpy array. How do i do it??


问:
Rollup Error:' Could not resolve' error for .js and .jsx file references inside index.ts
I am trying to rollup and publish a repo with an older version of react that is using plain .js and .jsx files. It has a few typescript files as well. I have followed this tutorial but added a js file and jsx file to the app and reference them index.ts in the src folder. (I added @rollup/plugin-babel to the rollup config to process the jsx file as well.) Here is my index.ts:

```<code>export * from './components';

// The below line gives an "Could not resolve" error when you run `npm run rollup`
export * from './path-to/my/jsfile.js';

// If you comment out the above line you get a similar error but for this jsx file.
export * from './path-to/my/jsxfile.jsx';
</code>```

When I try to execute the rollup -c command I get an error that says

```<code>dist/esm/types/index.d.ts → dist/index.d.ts...
[!] Error: Could not resolve './path-to/my/jsfile.js' from dist/esm/types/index.d.ts
</code>```

When I comment out the jsfile.js export line I get the error:

```<code>dist/esm/types/index.d.ts → dist/index.d.ts...
[!] Error: Could not resolve './path-to/my/jsxfile.jsx' from dist/esm/types/index.d.ts
</code>```

Here is my rollup config:

```<code>import resolve from "@rollup/plugin-node-resolve";
import commonjs from "@rollup/plugin-commonjs";
import typescript from "@rollup/plugin-typescript";
import postcss from "rollup-plugin-postcss";
import dts from "rollup-plugin-dts";
import { babel } from '@rollup/plugin-babel';

const packageJson = require("./package.json");

export default [
  {
    input: "src/index.ts",
    output: [
      {
        file: packageJson.main,
        format: "cjs",
        sourcemap: true,
      },
      {
        file: packageJson.module,
        format: "esm",
        sourcemap: true,
      },
    ],
    plugins: [
      resolve({extensions: ['.js', '.ts']}),
      babel({ babelHelpers: 'bundled', extensions: [".js", ".jsx"], }),
      commonjs(),
      typescript({ tsconfig: "./tsconfig.json" }),
      postcss(),
    ],
  },
  {
    input: "dist/esm/types/index.d.ts",
    output: [{ file: "dist/index.d.ts", format: "esm" }],
    plugins: [dts()],
    external: [/\.(css|less|scss)$/],
  },
];
</code>```

How can I rollup js and jsx files along with ts files?

Body:
I am trying to rollup and publish a repo with an older version of react that is using plain .js and .jsx files. It has a few typescript files as well. I have followed this tutorial but added a js file and jsx file to the app and reference them index.ts in the src folder. (I added @rollup/plugin-babel to the rollup config to process the jsx file as well.) Here is my index.ts:

export * from './components';

// The below line gives an "Could not resolve" error when you run `npm run rollup`
export * from './path-to/my/jsfile.js';

// If you comment out the above line you get a similar error but for this jsx file.
export * from './path-to/my/jsxfile.jsx';

When I try to execute the rollup -c command I get an error that says

dist/esm/types/index.d.ts → dist/index.d.ts...
[!] Error: Could not resolve './path-to/my/jsfile.js' from dist/esm/types/index.d.ts

When I comment out the jsfile.js export line I get the error:

dist/esm/types/index.d.ts → dist/index.d.ts...
[!] Error: Could not resolve './path-to/my/jsxfile.jsx' from dist/esm/types/index.d.ts

Here is my rollup config:

import resolve from "@rollup/plugin-node-resolve";
import commonjs from "@rollup/plugin-commonjs";
import typescript from "@rollup/plugin-typescript";
import postcss from "rollup-plugin-postcss";
import dts from "rollup-plugin-dts";
import { babel } from '@rollup/plugin-babel';

const packageJson = require("./package.json");

export default [
  {
    input: "src/index.ts",
    output: [
      {
        file: packageJson.main,
        format: "cjs",
        sourcemap: true,
      },
      {
        file: packageJson.module,
        format: "esm",
        sourcemap: true,
      },
    ],
    plugins: [
      resolve({extensions: ['.js', '.ts']}),
      babel({ babelHelpers: 'bundled', extensions: [".js", ".jsx"], }),
      commonjs(),
      typescript({ tsconfig: "./tsconfig.json" }),
      postcss(),
    ],
  },
  {
    input: "dist/esm/types/index.d.ts",
    output: [{ file: "dist/index.d.ts", format: "esm" }],
    plugins: [dts()],
    external: [/\.(css|less|scss)$/],
  },
];

How can I rollup js and jsx files along with ts files?


问:
Checkmarx scan issue with jQuery Code (Client Potential XSS)
I'm facing Client potential XSS issue in below code.

```<code>function mainNavMoreHandler() {
   var moreInfoId = $(this).text().replace(/[^\w]/gi, '') + 'SubNavMoreInfo';
   $('.subNavMoreInfo li:visible').hide();
   $('#' + moreInfoId).show();
}

function initMainnav(){
if(Modernizr.mq(mqXs){
  $('.subnav a').not('.noMoreInfo').off('mouseover', mainNavMoreHandler);
  $('.spSubHead').off('click', prodsolSubNavHandler);
} else {
  $('.subnav a').not('.noMoreInfo').on('mouseover', mainNavMoreHandler);
  $('.spSubHead').on('click', prodsolSubNavHandler);
}
</code>```

}

Issue Description :

The application's mainNavMoreHandler embeds untrusted data in the generated output with $, at line 4 .This untrusted data is embedded straight into the output without proper sanitization or encoding, enabling an attacker to inject malicious code into the output.

How can i resolve this issue. Need some help on this. Thanks.

Body:
I'm facing Client potential XSS issue in below code.

function mainNavMoreHandler() {
   var moreInfoId = $(this).text().replace(/[^\w]/gi, '') + 'SubNavMoreInfo';
   $('.subNavMoreInfo li:visible').hide();
   $('#' + moreInfoId).show();
}

function initMainnav(){
if(Modernizr.mq(mqXs){
  $('.subnav a').not('.noMoreInfo').off('mouseover', mainNavMoreHandler);
  $('.spSubHead').off('click', prodsolSubNavHandler);
} else {
  $('.subnav a').not('.noMoreInfo').on('mouseover', mainNavMoreHandler);
  $('.spSubHead').on('click', prodsolSubNavHandler);
}

}

Issue Description :

The application's mainNavMoreHandler embeds untrusted data in the generated output with $, at line 4 .This untrusted data is embedded straight into the output without proper sanitization or encoding, enabling an attacker to inject malicious code into the output.

How can i resolve this issue. Need some help on this. Thanks.