标签: startup

Clojure应用程序启动性能

我在Clojure中编写了一些小的实用程序应用程序,我使用Maven和maven-shade-plugin编译成自包含的可执行JAR文件("uberjars").这些uberjars包含clojure.jar的解压缩版本以及应用程序所依赖的其他库(即:commons-cli).它们很方便,因为我可以将它们发送给客户而无需客户安装Clojure(所有客户都已经安装了JRE).

我发现Clojure应用程序需要几秒钟才能启动,而用Java编写的类似应用程序在相同的机器上以秒为单位启动(例如,显示使用消息的时间).

我怀疑这是因为Clojure正在编译clojure.core库中的一些代码,因为clojure.jar .clj文件中有源代码(文件).

有没有办法预编译这个源代码?可以采取其他措施来加速启动性能吗?我听到客户抱怨启动需要多长时间(他们不知道或不关心应用程序是用Clojure,Java还是Foobar编写的).

performance clojure startup

19
推荐指数
1
解决办法
2370
查看次数

如何在linux中启动tomcat服务器?

我试着安装

   1.yum install -zxvf apache-tomcat-6.0.47.tar.gz then 
   2.  export TOMCAT_HOME=/home/mpatil/softwares/apache-tomcat-6.0.37
   3. [root@localhost mpatil]# echo $TOMCAT_HOME 
      /home/mpatil/softwares/apache-tomcat-7.0.47
Run Code Online (Sandbox Code Playgroud)

使用此命令启动tomcat

   4.[root@localhost mpatil]# /startup.sh 
bash: /startup.sh: No such file or directory 
Run Code Online (Sandbox Code Playgroud)

我不知道为什么会这样.

我的档案

      5.[root@localhost mpatil]#  find /home -type f -name   apache-tomcat-6.0.37.tar.gz
/home/mpatil/Downloads/apache-tomcat-6.0.37.tar.gz
Run Code Online (Sandbox Code Playgroud)

我之前尝试过的是正确与否? - 请告诉我我的问题是如何在linux中启动一个tomcat服务器.请告诉我..

linux installation tomcat centos startup

19
推荐指数
3
解决办法
19万
查看次数

脚本在PyCharm中运行,但不是从命令行运行

当我尝试从PyCharm IDE运行我的程序时,一切正常但如果我输入Fedora:

python myScript.py
Run Code Online (Sandbox Code Playgroud)

在shell提示符中,我从模块中获得了一个导入错误.

ImportError : No modue named myDependency

PyCharm做什么允许解释器在从IDE启动时找到我的依赖项?如何让我的脚本找到它的依赖项,以便可以使用单一命令启动它?

python fedora startup

19
推荐指数
3
解决办法
1万
查看次数

当我使用Launch4j添加启动画面时,我收到启动错误("启动应用程序时出错")

我注意到Launch4j的GUI似乎更喜欢bmp文件,所以我使用Gimp将我的jpg文件转换为该格式,但是在尝试运行Launch4j生成的可执行文件时我一直收到错误.

java splash-screen startup bmp launch4j

18
推荐指数
2
解决办法
5962
查看次数

如何在Scala Play Framework中对服务器启动执行操作?

我的目录中有一个配置文件servers.conf,conf/只要路由/servers被命中,我的ServerController就会读取该配置文件.这不具备性能,因为当文件不会更改时,它需要在每次连续命中时重新读取配置文件.此外,如果配置文件有问题,我可以尽快告诉用户,而不是在页面命中时抛出异常.

目前我在我的这个ServerController.scala:

case class Server(ip: String, port: String)

/**
  * This controller creates an `Action` to handle HTTP requests to the
  * application's server page.
  */
@Singleton
class ServerController @Inject() extends Controller {

  /**
    * Create an Action to render an HTML page with a the list of servers.
    * The configuration in the `routes` file means that this method
    * will be called when the application receives a `GET` request with …
Run Code Online (Sandbox Code Playgroud)

scala startup playframework playframework-2.5

18
推荐指数
1
解决办法
6161
查看次数

Powershell使用ScheduledJob在启动时使用管理员权限运行作业

为了简化我的一些工作,我创建了一个PowerShell脚本,需要:

  1. 在启动时运行.
  2. 使用管理员权限运行,因为它必须写入c:\ program files文件夹.

我使用powershell创建了启动服务,如下所示:

function MakeStartupService
{
    Write-Host "Adding script as a startup service"
    $trigger = New-JobTrigger -AtStartup -RandomDelay 00:00:15
    Try
    {
      Register-ScheduledJob -Trigger $trigger -FilePath "absolute_path" -Name "Job-name" -EA Stop
    }
    Catch [system.exception]
    {
        Write-Host "Looks like an existing startup service exists for the same. Overwriting existing job"
        Unregister-ScheduledJob "Job-name"
        Register-ScheduledJob -Trigger $trigger -FilePath "absolute_path" -Name "Job-name"
    }
}
Run Code Online (Sandbox Code Playgroud)

作业已成功注册为启动服务,并在任务计划程序中可见.如果我使用Start-Job -DefinitionName Job-name或通过右键单击任务计划程序启动它,它工作正常但它不会启动Windows启动时.

目前我正在我的个人Windows 10系统上测试这个,并检查了另一个Windows 10系统,但行为仍然是名称.我正在为此作业添加任务调度程序窗口的屏幕截图. 在此输入图像描述

对不起,如果这个问题听起来重复或愚蠢(我是powershell的初学者),但请相信我,我在网上找到的解决方案都没有为此工作.

提前致谢 !!

windows powershell startup

18
推荐指数
1
解决办法
1万
查看次数

实际上在ASP.NET Core中的ConfigureServices阶段读取AppSettings

我需要ConfigureServices在ASP.NET Core 1.0 Web应用程序中的方法中设置一些依赖项(服务).

问题是,基于新的JSON配置,我需要设置服务或其他服务.

我似乎无法ConfigureServices在应用程序生命周期的阶段实际读取设置:

public void ConfigureServices(IServiceCollection services)
{
    var section = Configuration.GetSection("MySettings"); // this does not actually hold the settings
    services.Configure<MySettingsClass>(section); // this is a setup instruction, I can't actually get a MySettingsClass instance with the settings
    // ...
    // set up services
    services.AddSingleton(typeof(ISomething), typeof(ConcreteSomething));
}
Run Code Online (Sandbox Code Playgroud)

我需要实际阅读该部分并决定注册的内容ISomething(可能与其他类型不同ConcreteSomething).

configuration app-config startup sections asp.net-core

18
推荐指数
3
解决办法
1万
查看次数

如何更改WPF应用程序的StartupUri?

我试图修改App.cs并从代码后面加载WPF XAML文件,但它不能正常工作.

无论我试图将其设置为StartupUri,它都不会启动,程序将在此之后退出.

public partial class App : Application
{
    protected override void OnStartup(StartupEventArgs e)
    {
        base.OnStartup(e);

        LoginDialog dlg = new LoginDialog();
        if (dlg.ShowDialog() != true)
            return;

        switch (dlg.ChoiceApp) { 
            case ChoiceApp.CustomerEntry:
                StartupUri = new Uri("/MyApp;component/Forms/CustomerEntry.xaml", 
                    UriKind.Relative);
                break;
            case ChoiceApp.VendorEntry:
                StartupUri = new Uri("/MyApp;component/Forms/VendorEntry.xaml", 
                    UriKind.Relative);
                break;
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

现在我甚至做了跟踪并发现LoginDialog工作正常并正确返回值,但设置"StartupUri"不起作用.

我在反向程序集中检查了在OnStartup之后调用App的DoStartup方法,所以从技术上讲,我的StartupUri必须加载,但它没有,在App.xaml启动uri根本没有定义.

注意:Bug已确认

我注意到ShowDialog设置了Application.MainWindow,当对话结束时,它将其设置为null,并且由于此设置,在OnStartup或Startup事件中调用Modal Dialog后,StartupUri不起作用.

关于无效的uri或类似的东西没有错误或例外.

这个方法在没有在Startup事件或OnStartup中调用DialogBox的情况下工作,我认为在这个方法上调用showdialog会导致它的主窗口设置为过期窗口,并在此之后关闭.

wpf uri startup

17
推荐指数
4
解决办法
5万
查看次数

Eclipse工作区在启动时崩溃

我使用的是Spring Tool Suite(STS)3.0.0版本(eclipse.buildId = 3.0.0.201208091018-RELEASE-e42).它运行良好了几个月,但最近我的主工作区在启动画面上崩溃,出现错误,如本文最后一部分所示.

我试过'STS.exe -clean'并将安装(通过新的工作台)恢复到早期的配置..但似乎没有任何作用.

我把它作为一个单独的工具驱动(即几乎所有与开发相关的任务,甚至连接到服务器,数据库),所以这非常令人沮丧:-(.

任何帮助将不胜感激.

            !ENTRY org.eclipse.ui.workbench 4 2 2012-11-28 08:56:53.195
            !MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.ui.workbench".
            !STACK 1
            org.eclipse.core.runtime.CoreException: Plug-in "org.eclipse.equinox.p2.ui.sdk.scheduler" was unable to instantiate class "org.eclipse.equinox.internal.p2.ui.sdk.scheduler.AutomaticUpdateScheduler".
                at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.throwException(RegistryStrategyOSGI.java:194)
                at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:186)
                at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:905)
                at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
                at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55)
                at org.eclipse.ui.internal.WorkbenchPlugin$1.run(WorkbenchPlugin.java:273)
                at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
                at org.eclipse.ui.internal.WorkbenchPlugin.createExtension(WorkbenchPlugin.java:269)
                at org.eclipse.ui.internal.EarlyStartupRunnable.getExecutableExtension(EarlyStartupRunnable.java:117)
                at org.eclipse.ui.internal.EarlyStartupRunnable.run(EarlyStartupRunnable.java:66)
                at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
                at org.eclipse.ui.internal.Workbench$52.run(Workbench.java:2357)
                at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
            Caused by: java.lang.NullPointerException
                at org.eclipse.equinox.internal.p2.ui.sdk.scheduler.AutomaticUpdateScheduler.<init>(AutomaticUpdateScheduler.java:68)
                at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
                at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
                at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
                at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
                at java.lang.Class.newInstance0(Class.java:372)
                at java.lang.Class.newInstance(Class.java:325)
                at …
Run Code Online (Sandbox Code Playgroud)

eclipse crash startup workbench

17
推荐指数
3
解决办法
2万
查看次数

如何减少React Native Android应用程序的启动时间

我目前正试图弄清楚如何减少Android启动时间.它不是iOS的问题,但对于Android,我看到的时间是6-10秒.目标是大约3-4秒.

以下是我遇到的研究摘要

  • createReactContext:反应桥初始化并开始加载所有本机模块
  • getMethodDescriptors:使用反射,它使用编译(运行时)所有公开方法的列表ReactMethod

解决方案存在但不完美:

  1. LazyReactPackage(实验性)https://github.com/facebook/react-native/commit/797ca6c219b2a44f88f10c61d91e8cc21e2f306e
  2. 删除所有公开的 https://github.com/facebook/react-native/pull/10084的反射ReactMethods

我对这些解决方案的问题在于使用注释处理来生成类(编译时).我试图找出如何让这些解决方案运行没有运气.

此外,围绕减少Android启动时间的其他建议也会有所帮助.

谢谢!

android startup gradle annotation-processing react-native

17
推荐指数
1
解决办法
949
查看次数