Structr startup issues - java

I've got the right java version installed and the package unpacked, and I'm getting some errors:
WARNING: Error loading module structr-ui-1.1-SNAPSHOT-201505231136.f596a.jar:java.io.FileNotFoundException: structr-ui-1.1-SNAPSHOT-201505231136.f596a.jar (The system cannot find the file specified)
java.io.FileNotFoundException: structr-ui-1.1-SNAPSHOT-201505231136.f596a.jar (The system cannot find the file specified)
Except....this is the SNAPSHOT file in the directory - it looks like the expected version wasn't changed:
structr-ui-2.0-SNAPSHOT-201602031507.0599a.jar
SEVERE: Unable to initialize resource provider for servlet JsonRestServlet, no resource provider found. Please check structr.conf for a valid resource provider class.
and it finally dies with this message:
SEVERE: Vital service HttpService failed to start: No resource provider available for servlet JsonRestServlet. Aborting
For the environment, this is what I've got:
D:\> mvn -v
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-1110T11:41:47-05:00)
Maven home: D:\Applications\Apache\Maven\3.3.9\bin\..
Java version: 1.8.0_66, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.8.0_66\jre
Default locale: en_CA, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "dos"
I'm not a java guy so I'm not sure how to interpret this - am I citing the wrong package here? Should I be pathing to something else?
Here's the entire startup log - my guess the failure to open the SNAPSHOT jar file is the cause of the problem.
D:\Graph\Structr\app>java -cp lib/*;structr-ui-1.1-SNAPSHOT-201505231136.f596a.jar org.structr.Server
Feb 17, 2016 4:53:37 PM org.structr.core.Services initialize
INFO: Reading structr.conf..
Feb 17, 2016 4:53:38 PM org.structr.core.Services getResources
INFO: Found 0 possible resources: []
Feb 17, 2016 4:53:39 PM org.structr.module.JarConfigurationProvider scanResource
WARNING: Error loading module structr-ui-1.1-SNAPSHOT-201505231136.f596a.jar: java.io.FileNotFoundException: structr-ui-1.1-SNAPSHOT-201505231136.f596a.jar (The system cannot find the file specified)
java.io.FileNotFoundException: structr-ui-1.1-SNAPSHOT-201505231136.f596a.jar (The system cannot find the file specified)
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.(ZipFile.java:219)
at java.util.zip.ZipFile.(ZipFile.java:149)
at org.structr.module.JarConfigurationProvider.loadResource(JarConfigurationProvider.java:1095)
at org.structr.module.JarConfigurationProvider.scanResource(JarConfigurationProvider.java:1013)
at org.structr.module.JarConfigurationProvider.scanResources(JarConfigurationProvider.java:1002)
at org.structr.module.JarConfigurationProvider.initialize(JarConfigurationProvider.java:119)
at org.structr.core.Services.getConfigurationProvider(Services.java:496)
at org.structr.core.Services.initialize(Services.java:312)
at org.structr.core.Services.initialize(Services.java:296)
at org.structr.core.Services.getInstance(Services.java:144)
at org.structr.Server.main(Server.java:36)
Feb 17, 2016 4:53:39 PM org.structr.module.JarConfigurationProvider scanResources
INFO: 5 JARs scanned
Feb 17, 2016 4:53:39 PM org.structr.core.Services initialize
INFO: Starting services
Feb 17, 2016 4:53:39 PM org.structr.neo4j.Neo4jDatabaseService initialize
INFO: Relationship cache size set to 10,000
Feb 17, 2016 4:53:39 PM org.structr.neo4j.Neo4jDatabaseService initialize
INFO: Node cache size set to 10,000
Feb 17, 2016 4:53:39 PM org.structr.neo4j.Neo4jDatabaseService initialize
INFO: Initializing database (./db) ...
SLF4J: This version of SLF4J requires log4j version 1.2.12 or later. See also http://www.slf4j.org/codes.html#log4j_version
Feb 17, 2016 4:53:55 PM org.structr.core.graph.NodeService initialize
INFO: Database ready.
Feb 17, 2016 4:57:08 PM org.structr.agent.AgentService run
INFO: AgentService started
Feb 17, 2016 4:57:08 PM org.structr.cron.CronService initialize
WARNING: No cron expression for task , ignoring.
Feb 17, 2016 4:57:08 PM org.structr.rest.service.HttpService initialize
INFO: Running in asynchronous mode
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/D:/Graph/Structr/app/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/D:/Graph/Structr/app/lib/logback-classic-1.1.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
Feb 17, 2016 4:57:08 PM org.structr.rest.service.StructrHttpServiceConfig initializeFromProperties
SEVERE: Unable to initialize resource provider for servlet JsonRestServlet, no resource provider found. Please check structr.conf for a valid resource provider class.
java.lang.IllegalStateException: No resource provider available for servlet JsonRestServlet
at org.structr.rest.service.StructrHttpServiceConfig.initializeFromProperties(StructrHttpServiceConfig.java:97)
at org.structr.rest.service.HttpService.collectServlets(HttpService.java:608)
at org.structr.rest.service.HttpService.initialize(HttpService.java:400)
at org.structr.core.Services.createService(Services.java:549)
at org.structr.core.Services.initialize(Services.java:324)
at org.structr.core.Services.initialize(Services.java:296)
at org.structr.core.Services.getInstance(Services.java:144)
at org.structr.Server.main(Server.java:36)
Feb 17, 2016 4:57:08 PM org.structr.core.Services createService
SEVERE: Vital service HttpService failed to start: No resource provider available for servlet JsonRestServlet. Aborting

I tried again, and the only way I got this to work was to remove all the jre* packages from my windows 7 system. The java control panel doesn't seem to work as expected, and structr doesn't run when a jre is driving this particular bus.

Related

Why my Tomcat 7 stop working after deploy

I have a grails app that runs on dev environment and I crated the war without problems.
In the server, I stop the service using "sudo service tomcat7 stop" command and put the war file into the server folder "/var/lib/tomcat7/webapps" and start the server again with the command "sudo service tomcat7 start".
For checking the state of the server I run "sudo service tomcat7 status" and get the "Tomcat servlet engine is running with pid 19169" response, and check if the application deploys correctly on the folder "/var/lib/tomcat7/webapps" and I see the project's folder there.
Right now, if I check the catalina.out file, I can't see any deploy error having this:
May 27, 2020 9:04:31 PM org.apache.coyote.AbstractProtocol init INFO:
Initializing ProtocolHandler ["http-bio-80"] May 27, 2020 9:04:31 PM
org.apache.catalina.startup.Catalina load INFO: Initialization
processed in 1280 ms May 27, 2020 9:04:31 PM
org.apache.catalina.core.StandardService startInternal INFO: Starting
service Catalina May 27, 2020 9:04:31 PM
org.apache.catalina.core.StandardEngine startInternal INFO: Starting
Servlet Engine: Apache Tomcat/7.0.26 May 27, 2020 9:04:33 PM
org.apache.catalina.startup.HostConfig deployDescriptor INFO:
Deploying configuration descriptor
/etc/tomcat7/Catalina/localhost/docs.xml May 27, 2020 9:04:33 PM
org.apache.catalina.startup.HostConfig deployDescriptor INFO:
Deploying configuration descriptor
/etc/tomcat7/Catalina/localhost/host-manager.xml May 27, 2020 9:04:33
PM org.apache.catalina.startup.HostConfig deployDescriptor INFO:
Deploying configuration descriptor
/etc/tomcat7/Catalina/localhost/manager.xml May 27, 2020 9:04:33 PM
org.apache.catalina.startup.HostConfig deployDescriptor INFO:
Deploying configuration descriptor
/etc/tomcat7/Catalina/localhost/examples.xml May 27, 2020 9:04:33 PM
org.apache.catalina.startup.HostConfig deployWAR INFO: Deploying web
application archive /var/lib/tomcat7/webapps/fleetcontroller.war
log4j:WARN No appenders could be found for logger
(net.bull.javamelody). log4j:WARN Please initialize the log4j system
properly. log4j:WARN See
http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
But if I wait a while, the tomcat service is stoped.
When I check the server status with "sudo service tomcat7 status" I get this msg
Tomcat servlet engine is not running, but pid file exists.
And the catalina.out show me:
WARN intercept.RequestmapFilterInvocationDefinition - Exception
initializing; this is ok if it's at startup and due to GORM not being
initialized yet since the first web request will re-initialize. Error
message is: {0} 2020-05-27 21:14:13,192 [pool-2-thread-1] WARN
module.ModuleDeclarationsFactory - resources artefact
KickstartResources does not define any modules | Using LESS files to
generating CSS files!
Please, if someone can help with that, because I don't know how to find the problem.
Really thanks for your time.
It was a virtual machine size problem.
I checked some server parameters and see that they was lower than production. infrastructure office changed the virtual server size and it starts to work!
Thanks you for your time!

Getting Exception whenever I start Jenkins

Whenever I run this command java -jar jenkins.war --ajp13Port=-1 --httpPort=8080 it throws
First Jenkins started with daemon mode where it was restarting the process then I have tried to start it manually but getting the same error.
I even tried with older version of Jenkins as well but gettting the same error.
Jenkins Version - 2.107.2
Running from: /Applications/Jenkins/jenkins.war
webroot: $user.home/.jenkins
Apr 25, 2018 2:54:55 PM Main deleteWinstoneTempContents
WARNING: Failed to delete the temporary Winstone file /var/folders/60/r656jt5d01s0g2qtqdlycjbr0000gq/T/winstone/jenkins.war
Apr 25, 2018 2:54:55 PM org.eclipse.jetty.util.log.JavaUtilLog info
INFO: Logging initialized #429ms
Apr 25, 2018 2:54:55 PM winstone.Logger logInternal
INFO: Beginning extraction from war file
Apr 25, 2018 2:54:56 PM org.eclipse.jetty.util.log.JavaUtilLog warn
WARNING: Empty contextPath
Apr 25, 2018 2:54:56 PM winstone.Logger logInternal
INFO: Winstone shutdown successfully
java.lang.NoSuchMethodError: org.eclipse.jetty.server.handler.HandlerWrapper.updateBean(Ljava/lang/Object;Ljava/lang/Object;Z)V
at org.eclipse.jetty.server.handler.HandlerWrapper.setHandler(HandlerWrapper.java:95)
at org.eclipse.jetty.servlet.ServletContextHandler.doSetHandler(ServletContextHandler.java:188)
at org.eclipse.jetty.servlet.ServletContextHandler.relinkHandlers(ServletContextHandler.java:210)
at org.eclipse.jetty.servlet.ServletContextHandler.<init>(ServletContextHandler.java:171)
at org.eclipse.jetty.webapp.WebAppContext.<init>(WebAppContext.java:289)
at org.eclipse.jetty.webapp.WebAppContext.<init>(WebAppContext.java:221)
at winstone.HostConfiguration$1.<init>(HostConfiguration.java:155)
at winstone.HostConfiguration.create(HostConfiguration.java:155)
at winstone.HostConfiguration.<init>(HostConfiguration.java:81)
at winstone.HostGroup.initHost(HostGroup.java:66)
at winstone.HostGroup.<init>(HostGroup.java:45)
at winstone.Launcher.<init>(Launcher.java:145)
at winstone.Launcher.main(Launcher.java:354)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at Main._main(Main.java:312)
at Main.main(Main.java:136)
Check the dependency tree or open the war by extracting it and see that the particular method is available or not.
This may be the case when it is taking a wrong jar while building the war file from it.

Bind Asterisk to my Java program via AGI

I am trying to bind Asterisk to my java program.
I followed this article (http://www.jcgonzalez.com/asterisk-handle-calls-with-java-example) to the letter. But I have an error once I call the 888 extention. It gives me the following error :
Dec 12, 2014 7:32:00 PM org.asteriskjava.fastagi.DefaultAgiServer startup
INFO: Thread pool started.
Dec 12, 2014 7:32:00 PM org.asteriskjava.fastagi.DefaultAgiServer startup
INFO: Listening on *:4573.
Dec 12, 2014 7:32:05 PM org.asteriskjava.fastagi.DefaultAgiServer startup
INFO: Received connection from /127.0.0.1
Dec 12, 2014 7:32:05 PM org.asteriskjava.fastagi.ResourceBundleMappingStrategy loadResourceBundle
INFO: Resource bundle 'fastagi-mapping' not found.
Dec 12, 2014 7:32:05 PM org.asteriskjava.fastagi.AbstractMappingStrategy createAgiScriptInstance
SEVERE: Unable to create AgiScript instance of type hello.agi: Class not found, make sure the class exists and is available on the CLASSPATH
Dec 12, 2014 7:32:05 PM org.asteriskjava.fastagi.internal.AgiConnectionHandler run
SEVERE: No script configured for URL 'agi://localhost/hello.agi' (script 'hello.agi')
I have just switched to UBUNTU, and I have no idea what this sentence means : make sure the fastagi-mapping.properties is in the class path or put it in the same folder as your compiled classes.
Please help.
Actually you have to put hello.agi mapping with actual java class file in fastagi-mapping.properties file , so that it can find the corresponding AGI file that u call from asterisk..
Your error have no any relation to AGI.
Your error say you have no class in path(or mistype)
SEVERE: Unable to create AgiScript instance of type hello.agi: Class not found, make sure the class exists and is available on the CLASSPATH
Dec 12, 2014 7:32:05 PM org.asteriskjava.fastagi.internal.AgiConnectionHandler run
SEVERE: No script configured for URL 'agi://localhost/hello.agi' (script 'hello.agi')
Note, class used WILL depend of url used when calling agi in dialplan.

Deploying jenkins war file using java command

I am trying to deploy a jenkins war file. I executed the following command
java -jar jenkins.war
Below is the log file.
PS C:\Sites> java -jar jenkins.war Running from: C:\Sites\jenkins.war
webroot: $user.home/.jenkins Sep 03, 2014 6:09:15 PM winstone.Logger
logInternal INFO: Beginning extraction from war file Sep 03, 2014
6:09:28 PM org.eclipse.jetty.util.log.JavaUtilLog info INFO:
jetty-8.y.z-SNAPSHOT Sep 03, 2014 6:09:35 PM
org.eclipse.jetty.util.log.JavaUtilLog info INFO: NO JSP Support for ,
did not find org.apache.jasper.servlet.JspServlet Jenkins home
directory: C:\Users\Mathew.jenkins found at: $user.home/.jenkins
Sep 03, 2014 6:09:46 PM org.eclipse.jetty.util.log.JavaUtilLog info
INFO: Started SelectChannelConnector#0.0.0.0:8080 Sep 03, 2014 6:09:46
PM winstone.Logger logInternal INFO: Winstone Servlet Engine v2.0
running: controlPort=disabled Sep 03, 2014 6:09:46 PM
jenkins.InitReactorRunner$1 onAttained INFO: Started initialization
Sep 03, 2014 6:10:26 PM jenkins.InitReactorRunner$1 onAttained INFO:
Listed all plugins Sep 03, 2014 6:10:26 PM jenkins.InitReactorRunner$1
onAttained INFO: Prepared all plugins Sep 03, 2014 6:10:26 PM
jenkins.InitReactorRunner$1 onAttained INFO: Started all plugins Sep
03, 2014 6:10:26 PM jenkins.InitReactorRunner$1 onAttained INFO:
Augmented all extensions Sep 03, 2014 6:10:26 PM
jenkins.InitReactorRunner$1 onAttained INFO: Loaded all jobs Sep 03,
2014 6:10:42 PM org.jenkinsci.main.modules.sshd.SSHD start INFO:
Started SSHD at port 55062 Sep 03, 2014 6:10:45 PM
jenkins.InitReactorRunner$1 onAttained INFO: Completed initialization
Sep 03, 2014 6:10:45 PM hudson.WebAppMain$3 run INFO: Jenkins is fully
up and running Sep 03, 2014 6:11:48 PM
hudson.model.DownloadService$Downloadable load INFO: Obtained the
updated data file for hudson.tasks.Maven.MavenInstaller Sep 03, 2014
6:11:51 PM hudson.model.DownloadService$Downloadable load INFO:
Obtained the updated data file for hudson.tasks.Ant.AntInstaller Sep
03, 2014 6:11:52 PM hudson.model.DownloadService$Downloadable load
INFO: Obtained the updated data file for hudson.tools.JDKInstaller Sep
03, 2014 6:12:11 PM hudson.model.UpdateSite updateData INFO: Obtained
the latest update center data file for UpdateSource default
Can anyone tell me what does the command java-jar jenkins.war do?
WHere did it deploy my war file?
Which web server does it use and how does localhost:8080 point to jenkins application?
Q. Can anyone tell me what does the command java -jar jenkins.war do?
java -jar expects a jar file name, in this case, jenkins.war.
An executable Java program can be packaged in a JAR file, along with any libraries the program uses. Executable JAR files have the manifest specifying the entry point class with Main-Class: myPrograms.MyClass and an explicit Class-Path (and the -cp argument is ignored). Some operating systems can run these directly when clicked. The typical invocation is "java -jar foo.jar" from a command line
Reference: http://en.wikipedia.org/wiki/JAR_(file_format)
Q. Where did it deploy my war file?
In case it is a RHEL/CentOS installation, your war is deployed at /var/lib/jenkins
You can find out the location by reading the file /etc/init.d/jenkins. You will find a variable named JENKINS_CONFIG
JENKINS_CONFIG=/etc/sysconfig/jenkins
Q. Which web server does it use and how does localhost:8080 point to jenkins application?
In case it is a RHEL/CentOS installation, you will generally find the file here: /etc/sysconfig/jenkins. In this file, you define port on which Jenkins runs.
1) It executes the java arvhive jenkins.war (see http://docs.oracle.com/javase/7/docs/technotes/tools/windows/jar.html)
2) From the output you posted yourself:
Running from: C:\Sites\jenkins.war webroot: $user.home/.jenkins
the user.home variable may refer to your ~ directory on Linux, or your Document and Settings on windows. See http://docs.oracle.com/javase/tutorial/essential/environment/sysprop.html
3) From the output you posted yourself:
jetty-8.y.z-SNAPSHOT
INFO: Started SelectChannelConnector#0.0.0.0:8080
See http://www.eclipse.org/jetty/. This is a web server that register a listener on port 8080.
it uses the Manifest.mf inside, if you open the war, you would understand how it runs
The Main class uses winstone http://winstone.sourceforge.net/
I would recommend to use glassfish, jetty or tomcat - for better control on configuration
there is a bug open for that
https://issues.jenkins-ci.org/browse/JENKINS-18366
Also see various container notes
https://wiki.jenkins-ci.org/display/JENKINS/Containers

An incompatible version 1.1.12 of the APR based Apache Tomcat Native library is installed, while Tomcat requires version 1.1.17

I downloaded Apache Tomcat 7.x. When I add this Tomcat in Eclipse I get this error:
Jan 25, 2011 3:21:05 PM org.apache.catalina.core.AprLifecycleListener init
SEVERE: An incompatible version 1.1.12 of the APR based Apache Tomcat Native library is installed, while Tomcat requires version 1.1.17
Jan 25, 2011 3:21:05 PM org.apache.catalina.core.AprLifecycleListener init
SEVERE: An incompatible version 1.1.12 of the APR based Apache Tomcat Native library is installed, while Tomcat requires version 1.1.17
Jan 25, 2011 3:21:05 PM org.apache.catalina.core.AprLifecycleListener init
SEVERE: An incompatible version 1.1.12 of the APR based Apache Tomcat Native library is installed, while Tomcat requires version 1.1.17
Jan 25, 2011 3:21:05 PM org.apache.catalina.core.AprLifecycleListener init
SEVERE: An incompatible version 1.1.12 of the APR based Apache Tomcat Native library is installed, while Tomcat requires version 1.1.17
Jan 25, 2011 3:21:05 PM org.apache.catalina.core.AprLifecycleListener init
SEVERE: An incompatible version 1.1.12 of the APR based Apache Tomcat Native library is installed, while Tomcat requires version 1.1.17
Jan 25, 2011 3:21:08 PM org.apache.coyote.AbstractProtocolHandler init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Jan 25, 2011 3:21:08 PM org.apache.coyote.AbstractProtocolHandler init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Jan 25, 2011 3:21:08 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 3054 ms
Jan 25, 2011 3:21:08 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Jan 25, 2011 3:21:08 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.6
Jan 25, 2011 3:21:08 PM org.apache.coyote.AbstractProtocolHandler start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Jan 25, 2011 3:21:08 PM org.apache.coyote.AbstractProtocolHandler start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Jan 25, 2011 3:21:08 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 251 ms
How can I solve this problem?
When I open the localhost:8080/manager/html it shows the following error:
HTTP Status 404 - /manager/html
type Status report
message /manager/html
description The requested resource (/manager/html) is not available.
Apache Tomcat/7.0.6
The first error certainly sounds like a version mismatch. The APR library is a library linked in at runtime based on your path (which itself can be based on where you execute Tomcat from). It sounds like you have the APR library for Tomcat 6. It's possible that Eclipse is providing this APR library.
Tomcat ships with an APR library but in order to ease installation Tomcat doesn't automatically modify the path to point at the APR library. The Eclipse Tomcat integration may (I'm not sure on this one, haven't used the integration before) include the APR libraries to make it easier to use Tomcat.
Check and make sure that Eclipse isn't configured to use an earlier version of Tomcat and if it is, either upgrade Eclipse to Tomcat 7 or downgrade Tomcat to the version specified in Eclipse.
If you can't figure it out then you don't necessarily have to worry about it at the moment. Tomcat should work anyways without the APR libraries. The only benefit you will get from the APR libraries is increased performance and since this is probably the start of your project that doesn't have to be worked out right away.
The second issue, the /manager/ page, could be Tomcat configuration. Tomcat won't actually display the manager page (and it will give you that error) unless users have been configured with manager permissions.
Try going to just / (i.e. http://localhost:8080), that page should load regardless of user configuration.
In my case I had inadvertently installed the APR library when I install once Tomcat locally on my Linux using the package manager. On Debian/Ubuntu this installed the APR package for a different Tomcat version (the one bundled with your distribution) which caused this error.
After simply
sudo apt-get purge libtcnative-1
The error was gone.

Categories