This setup was already running and working fine. But something happened: maybe some package got updated, some file corrupted or a network change broke it.
The command bin/gerrit.sh start returns Starting Gerrit Code Review: FAILED.
logs/error_log:
[2018-11-28 11:49:01,135] [main] WARN com.google.gerrit.sshd.SshDaemon : Disabling cipher aes192-ctr: Unable to initialize cipher BaseCipher[AES,16,24,AES/CTR/NoPadding]
[2018-11-28 11:49:01,135] [main] WARN com.google.gerrit.sshd.SshDaemon : Disabling cipher aes256-ctr: Unable to initialize cipher BaseCipher[AES,16,32,AES/CTR/NoPadding]
[2018-11-28 11:49:01,138] [main] WARN com.google.gerrit.sshd.SshDaemon : Disabling cipher arcfour256: Illegal key size or default parameters; try installing unlimited cryptography extension
[2018-11-28 11:49:01,145] [main] WARN com.google.gerrit.sshd.SshDaemon : Disabling cipher aes192-cbc: Unable to initialize cipher BaseCipher[AES,16,24,AES/CBC/NoPadding]
[2018-11-28 11:49:01,145] [main] WARN com.google.gerrit.sshd.SshDaemon : Disabling cipher aes256-cbc: Unable to initialize cipher BaseCipher[AES,16,32,AES/CBC/NoPadding]
[2018-11-28 11:49:01,214] [main] WARN com.google.gerrit.sshd.SshDaemon : Cannot format SSHD host key [EdDSA]: invalid key type
[2018-11-28 11:49:01,227] [main] WARN com.google.gerrit.server.config.GitwebCgiConfig : gitweb not installed (no /usr/lib/cgi-bin/gitweb.cgi found)
[2018-11-28 11:49:02,025] [main] INFO org.eclipse.jetty.util.log : Logging initialized #8689ms
[2018-11-28 11:49:02,102] [main] INFO com.google.gerrit.server.git.LocalDiskRepositoryManager : Defaulting core.streamFileThreshold to 332m
[2018-11-28 11:49:02,121] [main] INFO com.google.gerrit.server.plugins.PluginLoader : Removing stale plugin file: plugin_hooks_181128_1116_5514078957117773811.jar
[2018-11-28 11:49:02,121] [main] INFO com.google.gerrit.server.plugins.PluginLoader : Removing stale plugin file: plugin_events-log_181128_1116_8975419966674917654.jar
[2018-11-28 11:49:02,122] [main] INFO com.google.gerrit.server.plugins.PluginLoader : Removing stale plugin file: plugin_download-commands_181128_1116_7149912149640119287.jar
[2018-11-28 11:49:02,122] [main] INFO com.google.gerrit.server.plugins.PluginLoader : Removing stale plugin file: plugin_replication_181128_1116_3000551844744811569.jar
[2018-11-28 11:49:02,122] [main] INFO com.google.gerrit.server.plugins.PluginLoader : Removing stale plugin file: plugin_commit-message-length-validator_181128_1116_2800985912637941647.jar
[2018-11-28 11:49:02,122] [main] INFO com.google.gerrit.server.plugins.PluginLoader : Removing stale plugin file: plugin_reviewnotes_181128_1116_1435979824854811361.jar
[2018-11-28 11:49:02,122] [main] INFO com.google.gerrit.server.plugins.PluginLoader : Removing stale plugin file: plugin_singleusergroup_181128_1116_4944938881709642049.jar
[2018-11-28 11:49:02,122] [main] INFO com.google.gerrit.server.plugins.PluginLoader : Loading plugins from /home/gerrit/gerrit_testsite/plugins
[2018-11-28 11:49:02,199] [main] INFO com.google.gerrit.server.plugins.PluginLoader : Loaded plugin commit-message-length-validator, version v2.14.2
[2018-11-28 11:49:02,250] [main] INFO com.google.gerrit.server.plugins.PluginLoader : Loaded plugin download-commands, version v2.14.2
[2018-11-28 11:49:02,484] [main] INFO com.google.gerrit.server.plugins.PluginLoader : Loaded plugin events-log, version e271462
[2018-11-28 11:49:02,550] [main] INFO com.google.gerrit.server.plugins.PluginLoader : Loaded plugin hooks, version v2.14.2
[2018-11-28 11:49:02,638] [main] WARN com.googlesource.gerrit.plugins.replication.ReplicationFileBasedConfig : Config file /home/gerrit/gerrit_testsite/etc/replication.config does not exist; not replicating
[2018-11-28 11:49:02,641] [main] INFO com.google.gerrit.server.plugins.PluginLoader : Loaded plugin replication, version v2.14.2
[2018-11-28 11:49:02,697] [main] INFO com.google.gerrit.server.plugins.PluginLoader : Loaded plugin reviewnotes, version v2.14.2
[2018-11-28 11:49:02,736] [main] INFO com.google.gerrit.server.plugins.PluginLoader : Loaded plugin singleusergroup, version v2.14.2
[2018-11-28 11:49:02,975] [main] INFO com.google.gerrit.server.change.ChangeCleanupRunner : Ignoring missing changeCleanup schedule configuration
[2018-11-28 11:49:02,998] [main] INFO com.google.gerrit.sshd.SshDaemon : Started Gerrit SSHD-CORE-1.4.0 on *:29419
[2018-11-28 11:49:03,002] [main] INFO org.eclipse.jetty.server.Server : jetty-9.3.17.v20170317
[2018-11-28 11:49:03,787] [main] INFO org.eclipse.jetty.server.handler.ContextHandler : Started o.e.j.s.ServletContextHandler#384cd83a{/r,null,AVAILABLE}
[2018-11-28 11:49:43,834] [main] ERROR com.google.gerrit.pgm.Daemon : Unable to start daemon
java.lang.IllegalStateException: Cannot start HTTP daemon
at com.google.gerrit.pgm.http.jetty.JettyServer$Lifecycle.start(JettyServer.java:106)
at com.google.gerrit.lifecycle.LifecycleManager.start(LifecycleManager.java:92)
at com.google.gerrit.pgm.Daemon.start(Daemon.java:323)
at com.google.gerrit.pgm.Daemon.run(Daemon.java:232)
at com.google.gerrit.pgm.util.AbstractProgram.main(AbstractProgram.java:61)
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 com.google.gerrit.launcher.GerritLauncher.invokeProgram(GerritLauncher.java:204)
at com.google.gerrit.launcher.GerritLauncher.mainImpl(GerritLauncher.java:108)
at com.google.gerrit.launcher.GerritLauncher.main(GerritLauncher.java:63)
at Main.main(Main.java:24)
Caused by: java.net.SocketException: Unresolved address
at sun.nio.ch.Net.translateToSocketException(Net.java:131)
at sun.nio.ch.Net.translateException(Net.java:157)
at sun.nio.ch.Net.translateException(Net.java:163)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:76)
at org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:317)
at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:80)
at org.eclipse.jetty.server.ServerConnector.doStart(ServerConnector.java:235)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.server.Server.doStart(Server.java:401)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at com.google.gerrit.pgm.http.jetty.JettyServer$Lifecycle.start(JettyServer.java:92)
... 12 more
Caused by: java.nio.channels.UnresolvedAddressException
at sun.nio.ch.Net.checkAddress(Net.java:101)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:218)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
... 19 more
The configuration file is listed below, we use a LDAP server to authenticate:
[gerrit]
basePath = git
serverId = c3094920-33f3-4219-82cf-0181f4f0c7e7
canonicalWebUrl = http://oururl/r/
[database]
type = h2
database = /home/gerrit/gerrit_testsite/db/ReviewDB
[index]
type = LUCENE
[auth]
type = ldap
gitBasicAuthPolicy = LDAP
[ldap]
server = ldap://ldapserver
accountBase = OU=Usuários Rede,DC=company,DC=com,DC=br
groupBase = OU=Grupos,DC=company,DC=com,DC=br
referral = follow
accountPattern = (mailNickname=${username})
groupPattern = (memberOf=${cn})
accountFullName = cn
accountEmailAddress = mail
localUsernameToLowerCase = true
accountSshUserName = cn
username = ldapread#company.com.br
password = pass
[receive]
enableSignedPush = false
[sendemail]
smtpServer = mail.company.com.br
smtpServerPort = 587
smtpEncryption = tls
sslVerify = false
allowedDomain = company.com.br
smtpUser = gerrit#company.com.br
smtpPass = pass
[container]
user = gerrit
javaHome = /usr/lib/jvm/java-8-oracle/jre
[sshd]
listenAddress = *:29419
[httpd]
listenUrl = http://engenharia.company.com.br:8888/r/
[cache]
directory = cache
[download]
command = checkout
command = cherry_pick
command = format_patch
command = pull
scheme = ssh
[capability]
accessDatabase = group Administrators
[plugins]
allowRemoteAdmin = true
[plugin "events-log"]
storeUrl = jdbc:h2:/tmp/db
What can I do to debug the issue? (I haven't done the Gerrit setup and installation.)
It wasn't related to Gerrit.
A network change disabled Gerrit. After changing the DNS server and gateway of the Gerrit machine, everything is working again.
Related
I install kylin by https://github.com/cas-packone/ambari-kylin-service/
2020-01-13 01:52:16,673 INFO [main] utils.Compatibility:41 : Running in ZooKeeper 3.4.x compatibility mode
2020-01-13 01:52:16,710 INFO [main] imps.CuratorFrameworkImpl:284 : Starting
2020-01-13 01:52:16,715 INFO [main] zookeeper.ZooKeeper:438 : Initiating client connection, connectString=node1:2181 sessionTimeout=120000 watcher=org.apache.curator.ConnectionState#6c000e0c
2020-01-13 01:52:16,717 INFO [main-SendThread(node1:2181)] zookeeper.ClientCnxn:1013 : Opening socket connection to server node1/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)
2020-01-13 01:52:16,719 INFO [main-SendThread(node1:2181)] zookeeper.ClientCnxn:856 : Socket connection established, initiating session, client: /127.0.0.1:49768, server: node1/127.0.0.1:2181
2020-01-13 01:52:16,721 INFO [main-SendThread(node1:2181)] zookeeper.ClientCnxn:1273 : Session establishment complete on server node1/127.0.0.1:2181, sessionid = 0x16f798087cc03af, negotiated timeout = 60000
2020-01-13 01:52:16,722 INFO [main] imps.CuratorFrameworkImpl:326 : Default schema
2020-01-13 01:52:16,725 DEBUG [main] util.ZookeeperDistributedLock:142 : 6521#node1 trying to lock /kylin/kylin_metadata/create_htable/kylin_metadata/lock
2020-01-13 01:52:16,730 INFO [main-EventThread] state.ConnectionStateManager:237 : State change: CONNECTED
Exception in thread "main" java.lang.IllegalArgumentException: Failed to find metadata store by url: kylin_metadata#hbase
at org.apache.kylin.common.persistence.ResourceStore.createResourceStore(ResourceStore.java:89)
at org.apache.kylin.common.persistence.ResourceStore.getStore(ResourceStore.java:101)
at org.apache.kylin.rest.service.AclTableMigrationTool.checkIfNeedMigrate(AclTableMigrationTool.java:94)
at org.apache.kylin.tool.AclTableMigrationCLI.main(AclTableMigrationCLI.java:41)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.apache.kylin.common.persistence.ResourceStore.createResourceStore(ResourceStore.java:83)
... 3 more
Caused by: java.lang.NoSuchMethodError: org.apache.curator.framework.api.CreateBuilder.creatingParentsIfNeeded()Lorg/apache/curator/framework/api/ProtectACLCreateModePathAndBytesable;
at org.apache.kylin.storage.hbase.util.ZookeeperDistributedLock.lock(ZookeeperDistributedLock.java:145)
at org.apache.kylin.storage.hbase.util.ZookeeperDistributedLock.lock(ZookeeperDistributedLock.java:166)
at org.apache.kylin.storage.hbase.HBaseConnection.createHTableIfNeeded(HBaseConnection.java:305)
at org.apache.kylin.storage.hbase.HBaseResourceStore.createHTableIfNeeded(HBaseResourceStore.java:110)
at org.apache.kylin.storage.hbase.HBaseResourceStore.<init>(HBaseResourceStore.java:91)
... 8 more
2020-01-13 01:52:16,772 INFO [Curator-Framework-0] imps.CuratorFrameworkImpl:924 : backgroundOperationsLoop exiting
2020-01-13 01:52:16,773 INFO [Thread-1] zookeeper.ReadOnlyZKClient:344 : Close zookeeper connection 0x7b94089b to node1:2181
2020-01-13 01:52:16,775 INFO [ReadOnlyZKClient-node1:2181#0x7b94089b] zookeeper.ZooKeeper:692 : Session: 0x16f798087cc03ae closed
2020-01-13 01:52:16,775 INFO [ReadOnlyZKClient-node1:2181#0x7b94089b-EventThread] zookeeper.ClientCnxn:517 : EventThread shut down
2020-01-13 01:52:16,777 INFO [Thread-4] zookeeper.ZooKeeper:692 : Session: 0x16f798087cc03af closed
2020-01-13 01:52:16,777 INFO [main-EventThread] zookeeper.ClientCnxn:517 : EventThread shut down
ERROR: Unknown error. Please check full log.
I have this Dockerfile :
FROM basex/basexhttp:9.3.1
I deploy it on Elasticbeanstalk but i get the following error :
[main] INFO org.eclipse.jetty.util.log - Logging initialized #549ms to
org.eclipse.jetty.util.log.Slf4jLog [main] INFO
org.eclipse.jetty.server.Server - jetty-9.4.24.v20191120; built:
2019-11-20T21:37:49.771Z; git:
363d5f2df3a8a28de40604320230664b9c793c16; jvm 1.8.0_212-b04 [main]
WARN org.eclipse.jetty.webapp.WebAppContext - Failed startup of
context
o.e.j.w.WebAppContext#31a5c39e{/,null,UNAVAILABLE}{/srv/basex/webapp}
java.lang.IllegalStateException: Parent for temp dir not configured
correctly: writeable=false
at org.eclipse.jetty.webapp.WebInfConfiguration.makeTempDirectory(WebInfConfiguration.java:499)
at org.eclipse.jetty.webapp.WebInfConfiguration.resolveTempDirectory(WebInfConfiguration.java:468)
at org.eclipse.jetty.webapp.WebInfConfiguration.preConfigure(WebInfConfiguration.java:138)
at org.eclipse.jetty.webapp.WebAppContext.preConfigure(WebAppContext.java:488)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:523)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:169)
at org.eclipse.jetty.server.Server.start(Server.java:407)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:110)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:100)
at org.eclipse.jetty.server.Server.doStart(Server.java:371)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72)
at org.basex.BaseXHTTP.(BaseXHTTP.java:129)
at org.basex.BaseXHTTP.main(BaseXHTTP.java:53) [main] INFO org.eclipse.jetty.server.AbstractConnector - Started
ServerConnector#48eff760{HTTP/1.1,[http/1.1]}{0.0.0.0:8984} [main]
INFO org.eclipse.jetty.server.Server - Started #936ms
java.lang.NullPointerException
and then container stops.
Now i tried to use the same image and run it via the root user and it starts and works perfectly fine. Following is the command :
docker run -d b58e4a50371d
Any suggestions/help appreciated.
I have a Gerrit v2.15 on a linux machine and I'm the administrator in Gerrit.
I installed the Gerrit plugin-manager under gerrit/plugins with command :
wget https://gerrit-ci.gerritforge.com/view/Plugins-stable-2.15/job/plugin-plugin-manager-bazel-master-stable-2.15/lastSuccessfulBuild/artifact/bazel-genfiles/plugins/plugin-manager/plugin-manager.jar
But nothing uploads in Gerrit UI in tab Plugins. I only see the Installed, as before.
In gerrit/logs/error.log I can read out the following:
[2018-06-15 08:54:26,366] [main] INFO com.google.gerrit.server.plugins.PluginLoader : Loaded plugin plugin-manager, version v2.15-1-g27c3d2935d
[2018-06-15 08:54:26,367] [plugin-manager-preloader] INFO com.googlesource.gerrit.plugins.manager.OnStartStop : Start-up: pre-loading list of plugins from registry
[2018-06-15 08:54:26,902] [main] INFO com.google.gerrit.server.git.GarbageCollectionRunner : Ignoring missing gc schedule configuration
[2018-06-15 08:54:26,902] [main] INFO com.google.gerrit.server.config.ScheduleConfig : accountDeactivation schedule parameter "accountDeactivation.interval" is not configured
[2018-06-15 08:54:26,902] [main] INFO com.google.gerrit.server.change.ChangeCleanupRunner : Ignoring missing changeCleanup schedule configuration
[2018-06-15 08:54:26,946] [main] INFO com.google.gerrit.sshd.SshDaemon : Started Gerrit SSHD-CORE-1.6.0 on *:29418
[2018-06-15 08:54:26,949] [main] INFO org.eclipse.jetty.server.Server : jetty-9.3.18.v20170406
[2018-06-15 08:54:28,040] [main] INFO com.googlesource.gerrit.plugins.gitiles.HttpModule : No /opt/gerrit/etc/gitiles.config; assuming defaults
[2018-06-15 08:54:28,847] [main] INFO org.eclipse.jetty.server.handler.ContextHandler : Started o.e.j.s.ServletContextHandler#62672ad5{/,null,AVAILABLE}
[2018-06-15 08:54:28,869] [main] INFO org.eclipse.jetty.server.AbstractConnector : Started ServerConnector#38503309{HTTP/1.1,[http/1.1]}{127.0.0.1:8081}
[2018-06-15 08:54:28,890] [main] INFO org.eclipse.jetty.server.Server : Started #20170ms
[2018-06-15 08:54:28,893] [main] INFO com.google.gerrit.pgm.Daemon : Gerrit Code Review 2.15.1 ready
[2018-06-15 08:54:44,819] [plugin-manager-preloader] INFO com.googlesource.gerrit.plugins.manager.OnStartStop : 45 plugins successfully pre-loaded
What have i missed?
Is it some permission settings that is wrong or configuration in gerrit.config that has to be done?
Directory gerrit/plugin has permissions set to: drwxr-xr-x
Note : I've tried restarting Gerrit.
Good to know: We are using nginx. That might be useful info.
I know very little about how nginx works.
What it looks like in the UI
The plugin-manager only works in the Old UI. If you're using the new PolyGerrit UI first click on "Switch to Old UI" link at the right/down on the page. Then the plugin-manager can be access at: Plugins > Manage menu.
If you're not able to see the "Manage" option in the Old UI check the following:
. Verify if you're logged in Gerrit with an Admin user (you need to have "Administrate Server" permission in All-Projects project). There're an specific permission to access Plugins > Installed item (called "View Plugins") but this permission doesn't work the same way to Plugins > Manage one.
. Verify if you have the following set in the GERRIT_SITE/etc/gerrit.config file:
[plugins]
allowRemoteAdmin = true
Maybe this can resolve your issue.
Am trying to use example given here
http://openejb.apache.org/hello-world.html
With OpenEJB I am able to output HelloWorld
I am trying same in Apache Tomee
I have Remote EJB bean like this
#Remote
public interface Hello{
public String sayHello();
}
#Stateless
public class HelloBean implements Hello{
public String sayHello(){
return "Hello World!!!!";
}
}
packed it in a jar
jar cvf hello.jar org
Deployed on Apache Tomee
Tomee Log after deploying hello.jar
03-Oct-2017 15:55:51.778 INFO [localhost-startStop-1] org.apache.openejb.assembler.classic.Assembler.createApplication Deployed Application(path=/home/ashish/apache-tomee-plus-7.0.2/webapps/manager)
03-Oct-2017 15:55:51.805 INFO [localhost-startStop-1] sun.reflect.DelegatingMethodAccessorImpl.invoke At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
03-Oct-2017 15:55:51.826 INFO [localhost-startStop-1] sun.reflect.DelegatingMethodAccessorImpl.invoke Deployment of web application directory /home/ashish/apache-tomee-plus-7.0.2/webapps/manager has finished in 137 ms
03-Oct-2017 15:55:51.831 INFO [main] sun.reflect.DelegatingMethodAccessorImpl.invoke Starting ProtocolHandler [http-nio-8080]
03-Oct-2017 15:55:51.839 INFO [main] sun.reflect.DelegatingMethodAccessorImpl.invoke Starting ProtocolHandler [ajp-nio-8009]
03-Oct-2017 15:55:51.845 INFO [main] sun.reflect.DelegatingMethodAccessorImpl.invoke Server startup in 5735 ms
03-Oct-2017 15:56:51.874 INFO [ContainerBackgroundProcessor[StandardEngine[Catalina]]] org.apache.openejb.config.ConfigurationFactory.configureApplication Configuring enterprise application: /home/ashish/apache-tomee-plus-7.0.2/webapps/hello.jar
03-Oct-2017 15:56:51.914 INFO [ContainerBackgroundProcessor[StandardEngine[Catalina]]] org.apache.openejb.config.InitEjbDeployments.deploy Auto-deploying ejb HelloBean: EjbDeployment(deployment-id=HelloBean)
03-Oct-2017 15:56:51.915 INFO [ContainerBackgroundProcessor[StandardEngine[Catalina]]] org.apache.openejb.config.AppInfoBuilder.build Enterprise application "/home/ashish/apache-tomee-plus-7.0.2/webapps/hello.jar" loaded.
03-Oct-2017 15:56:51.925 INFO [ContainerBackgroundProcessor[StandardEngine[Catalina]]] org.apache.openejb.assembler.classic.Assembler.createAppClassLoader Creating dedicated application classloader for hello
03-Oct-2017 15:56:51.926 INFO [ContainerBackgroundProcessor[StandardEngine[Catalina]]] org.apache.openejb.assembler.classic.Assembler.createApplication Assembling app: /home/ashish/apache-tomee-plus-7.0.2/webapps/hello.jar
03-Oct-2017 15:56:51.945 INFO [ContainerBackgroundProcessor[StandardEngine[Catalina]]] org.apache.openejb.assembler.classic.JndiBuilder.bind Jndi(name=HelloBeanRemote) --> Ejb(deployment-id=HelloBean)
03-Oct-2017 15:56:51.945 INFO [ContainerBackgroundProcessor[StandardEngine[Catalina]]] org.apache.openejb.assembler.classic.JndiBuilder.bind Jndi(name=global/hello/HelloBean!org.acme.Hello) --> Ejb(deployment-id=HelloBean)
03-Oct-2017 15:56:51.945 INFO [ContainerBackgroundProcessor[StandardEngine[Catalina]]] org.apache.openejb.assembler.classic.JndiBuilder.bind Jndi(name=global/hello/HelloBean) --> Ejb(deployment-id=HelloBean)
03-Oct-2017 15:56:51.969 INFO [ContainerBackgroundProcessor[StandardEngine[Catalina]]] org.apache.openejb.assembler.classic.Assembler.startEjbs Created Ejb(deployment-id=HelloBean, ejb-name=HelloBean, container=Default Stateless Container)
03-Oct-2017 15:56:51.987 INFO [ContainerBackgroundProcessor[StandardEngine[Catalina]]] org.apache.openejb.assembler.classic.Assembler.startEjbs Started Ejb(deployment-id=HelloBean, ejb-name=HelloBean, container=Default Stateless Container)
03-Oct-2017 15:56:51.988 INFO [ContainerBackgroundProcessor[StandardEngine[Catalina]]] org.apache.openejb.assembler.classic.Assembler.createApplication Deployed Application(path=/home/ashish/apache-tomee-plus-7.0.2/webapps/hello.jar)
Now I have created void main class and trying to access this EJB
It throws error
My Main Class
import java.util.Properties;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.rmi.PortableRemoteObject;
public class HelloClient {
public static void main(String[] args) throws Exception {
Properties props = new Properties();
props.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.RemoteInitialContextFactory");
//props.put(Context.PROVIDER_URL, "ejbd://127.0.0.1:4201");
//props.put(Context.PROVIDER_URL, "ejbd://localhost:8080");
//props.put(Context.PROVIDER_URL, " http://localhost:8080/openejb/ejb");
Context ctx = new InitialContext(props);
Object ref = ctx.lookup("HelloBeanRemote");
Hello h = (Hello) PortableRemoteObject.narrow(ref, Hello.class);
String result = h.sayHello();
System.out.println(result);
}
}
using : props.put(Context.PROVIDER_URL, "ejbd://127.0.0.1:4201");
run:
Oct 03, 2017 7:12:26 PM org.apache.openejb.client.StickToLastServerConnectionFactoryStrategy connect
WARNING: Cannot connect to server(s): 127.0.0.1:4201 Exception:
java.net.ConnectException: Cannot connect to server 'ejbd://127.0.0.1:4201'. Check that the server is started and that the specified serverURL is correct.
at org.apache.openejb.client.SocketConnectionFactory$SocketConnection.open(SocketConnectionFactory.java:55)
at org.apache.openejb.client.SocketConnectionFactory.getConnection(SocketConnectionFactory.java:35)
at org.apache.openejb.client.ConnectionManager.getConnection(ConnectionManager.java:43)
at org.apache.openejb.client.StickToLastServerConnectionFactoryStrategy.connect(StickToLastServerConnectionFactoryStrategy.java:70)
at org.apache.openejb.client.StickToLastServerConnectionFactoryStrategy.connect(StickToLastServerConnectionFactoryStrategy.java:47)
at org.apache.openejb.client.ServerMetaData.connect(ServerMetaData.java:57)
at org.apache.openejb.client.Client.processRequest(Client.java:58)
at org.apache.openejb.client.Client.request(Client.java:42)
at org.apache.openejb.client.JNDIContext.request(JNDIContext.java:87)
at org.apache.openejb.client.JNDIContext.lookup(JNDIContext.java:234)
at javax.naming.InitialContext.lookup(InitialContext.java:417)
at java8demo.HelloClient.main(HelloClient.java:25)
Exception in thread "main" javax.naming.NamingException: Cannot lookup '/HelloBeanRemote'. [Root exception is java.rmi.RemoteException: Cannot connect to any servers: Server #0: ejbd://127.0.0.1:4201]
at org.apache.openejb.client.JNDIContext.lookup(JNDIContext.java:240)
at javax.naming.InitialContext.lookup(InitialContext.java:417)
at java8demo.HelloClient.main(HelloClient.java:25)
Caused by: java.rmi.RemoteException: Cannot connect to any servers: Server #0: ejbd://127.0.0.1:4201
at org.apache.openejb.client.StickToLastServerConnectionFactoryStrategy.connect(StickToLastServerConnectionFactoryStrategy.java:66)
at org.apache.openejb.client.ServerMetaData.connect(ServerMetaData.java:57)
at org.apache.openejb.client.Client.processRequest(Client.java:58)
at org.apache.openejb.client.Client.request(Client.java:42)
at org.apache.openejb.client.JNDIContext.request(JNDIContext.java:87)
at org.apache.openejb.client.JNDIContext.lookup(JNDIContext.java:234)
... 2 more
/home/ashish/.cache/netbeans/8.2/executor-snippets/run.xml:53: Java returned: 1
BUILD FAILED (total time: 0 seconds)
using: props.put(Context.PROVIDER_URL, "ejbd://localhost:8080");
run:
Exception in thread "main" javax.naming.NamingException: Cannot lookup '/HelloBeanRemote'. [Root exception is java.rmi.RemoteException: Cannot open object output stream to server: ; nested exception is:
java.net.SocketException: Broken pipe (Write failed)]
at org.apache.openejb.client.JNDIContext.lookup(JNDIContext.java:240)
at javax.naming.InitialContext.lookup(InitialContext.java:417)
at java8demo.HelloClient.main(HelloClient.java:25)
Caused by: java.rmi.RemoteException: Cannot open object output stream to server: ; nested exception is:
java.net.SocketException: Broken pipe (Write failed)
at org.apache.openejb.client.Client.processRequest(Client.java:107)
at org.apache.openejb.client.Client.request(Client.java:42)
at org.apache.openejb.client.JNDIContext.request(JNDIContext.java:87)
at org.apache.openejb.client.JNDIContext.lookup(JNDIContext.java:234)
... 2 more
Caused by: java.net.SocketException: Broken pipe (Write failed)
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:111)
at java.net.SocketOutputStream.write(SocketOutputStream.java:155)
at java.io.ObjectOutputStream$BlockDataOutputStream.drain(ObjectOutputStream.java:1877)
at java.io.ObjectOutputStream$BlockDataOutputStream.setBlockDataMode(ObjectOutputStream.java:1786)
at java.io.ObjectOutputStream.<init>(ObjectOutputStream.java:247)
at org.apache.openejb.client.Client.processRequest(Client.java:104)
... 5 more
/home/ashish/.cache/netbeans/8.2/executor-snippets/run.xml:53: Java returned: 1
BUILD FAILED (total time: 0 seconds)
By default Tomee doesn't allow Remote EJB lookup
you need to enable it inside Apache-Tomee/conf/system.properties file
// enable remote access
tomee.remote.support = true
// blacklist none
tomee.serialization.class.blacklist = -
// whitelist all classes or you can define your classes
tomee.serialization.class.whitelist = *
openejb.system.apps = true
openejb.servicemanager.enabled = true
once these configuration are changeed, restart tomee and tomee deploy your EJB's
and all EJB's can be accessed using following url
Properties p = new Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.RemoteInitialContextFactory");
p.put(Context.PROVIDER_URL, "http://localhost:8080/tomee/ejb");
final InitialContext ctx = new InitialContext(p);
Hello hbr = (Hello) ctx.lookup("HelloBeanRemote");
One other mistake I was doing that
I used openejb-client-3.0.jar from OpenEJb container
instead of openejb-client-7.0.2.jar from apache lib folder
Use client jar above 3 version
I'm trying to run confluence image on a docker container. This behavior is Intermittent - most of the time I can't run it, but at sometimes I can.
After downloading the image I run these commands in order put confluence online:
sudo chown -R daemon /data/confluence
sudo chown -R daemon /var/atlassian/application-data/confluence
docker run -v /data/your-confluence-home:/var/atlassian/application-data/confluence --name="confluence" -d -p 8090:8090 -p 8091:8091 atlassian/confluence-server
But then, I get this error on docker logs confluence
If you encounter issues starting up Confluence, please see the Installation guide at http://confluence.atlassian.com/display/DOC/Confluence+Installation+Guide
Server startup logs are located in /opt/atlassian/confluence/logs/catalina.out
---------------------------------------------------------------------------
Using Java: /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
2017-05-23 15:33:41,519 INFO [main] [atlassian.confluence.bootstrap.SynchronyProxyWatchdog] A Context element for ${confluence.context.path}/synchrony-proxy is found in /opt/atlassian/confluence/conf/server.xml. No further action is required
---------------------------------------------------------------------------
23-May-2017 15:33:42.013 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8090"]
23-May-2017 15:33:42.026 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
23-May-2017 15:33:42.028 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 381 ms
23-May-2017 15:33:42.033 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service Tomcat-Standalone
23-May-2017 15:33:42.033 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.0.41
SLF4J: A number (1) of logging calls during the initialization phase have been intercepted and are
SLF4J: now being replayed. These are subject to the filtering rules of the underlying logging system.
SLF4J: See also http://www.slf4j.org/codes.html#replay
23-May-2017 15:33:43.517 INFO [localhost-startStop-2] org.apache.catalina.core.ApplicationContext.log Spring WebApplicationInitializers detected on classpath: [com.atlassian.synchrony.proxy.SynchronyDispatcherServletInitializer#335dedfb]
23-May-2017 15:33:43.814 INFO [localhost-startStop-2] org.apache.catalina.core.ApplicationContext.log Initializing Spring FrameworkServlet 'dispatcher'
23-May-2017 15:33:43.814 INFO [localhost-startStop-2] org.springframework.web.servlet.DispatcherServlet.initServletBean FrameworkServlet 'dispatcher': initialization started
23-May-2017 15:33:43.819 INFO [localhost-startStop-2] org.springframework.web.context.support.AnnotationConfigWebApplicationContext.prepareRefresh Refreshing WebApplicationContext for namespace 'dispatcher-servlet': startup date [Tue May 23 15:33:43 UTC 2017]; root of context hierarchy
23-May-2017 15:33:43.864 INFO [localhost-startStop-2] org.springframework.web.context.support.AnnotationConfigWebApplicationContext.loadBeanDefinitions Registering annotated classes: [class com.atlassian.synchrony.proxy.websocket.WebSocketConfig,class com.atlassian.synchrony.proxy.web.SynchronyWebMvcConfig]
2017-05-23 15:33:44,007 INFO [localhost-startStop-1] [com.atlassian.confluence.lifecycle] contextInitialized Starting Confluence 6.2.0 [build 7111 based on commit hash 583f3f4010922d699723a091097524472954c767] - synchrony version 0.3.1-release-confluence_6.1-e20fb944
23-May-2017 15:33:44.371 INFO [localhost-startStop-2] org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler.initialize Initializing ExecutorService 'defaultSockJsTaskScheduler'
23-May-2017 15:33:44.670 INFO [localhost-startStop-2] org.springframework.web.socket.server.support.WebSocketHandlerMapping.registerHandler Mapped URL path [/sockjs/v1/**] onto handler of type [class org.springframework.web.socket.sockjs.support.SockJsHttpRequestHandler]
23-May-2017 15:33:44.854 INFO [localhost-startStop-2] org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping.register Mapped "{[/healthcheck]}" onto public com.atlassian.synchrony.proxy.web.HealthCheckResult com.atlassian.synchrony.proxy.web.SynchronyProxyRestController.getSynchronyProxyInfo()
23-May-2017 15:33:44.855 INFO [localhost-startStop-2] org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping.register Mapped "{[/reload],methods=[PUT]}" onto public org.springframework.http.ResponseEntity com.atlassian.synchrony.proxy.web.SynchronyProxyRestController.reloadConfiguration(com.atlassian.synchrony.proxy.web.SynchronyProxyConfigPayload)
23-May-2017 15:33:44.873 INFO [localhost-startStop-2] org.springframework.web.servlet.handler.SimpleUrlHandlerMapping.registerHandler Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.DefaultServletHttpRequestHandler]
23-May-2017 15:33:44.939 INFO [localhost-startStop-2] org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.initControllerAdviceCache Looking for #ControllerAdvice: WebApplicationContext for namespace 'dispatcher-servlet': startup date [Tue May 23 15:33:43 UTC 2017]; root of context hierarchy
23-May-2017 15:33:45.056 INFO [localhost-startStop-2] org.springframework.context.support.DefaultLifecycleProcessor.start Starting beans in phase 2147483647
23-May-2017 15:33:45.094 INFO [localhost-startStop-2] org.springframework.web.servlet.DispatcherServlet.initServletBean FrameworkServlet 'dispatcher': initialization completed in 1279 ms
2017-05-23 15:33:46,688 WARN [localhost-startStop-1] [com.atlassian.config.ApplicationConfig] setApplicationHome Application home does not exist. Creating directory: /var/atlassian/application-data/confluence/shared-home
2017-05-23 15:33:46,783 ERROR [localhost-startStop-1] [atlassian.config.bootstrap.DefaultAtlassianBootstrapManager] init Home is not configured properly:
com.atlassian.config.ConfigurationException: Couldn't save confluence.cfg.xml to /var/atlassian/application-data/confluence directory.
at com.atlassian.config.xml.AbstractDom4jXmlConfigurationPersister.saveDocument(AbstractDom4jXmlConfigurationPersister.java:86)
at com.atlassian.config.xml.DefaultDom4jXmlConfigurationPersister.save(DefaultDom4jXmlConfigurationPersister.java:24)
at com.atlassian.config.ApplicationConfig.save(ApplicationConfig.java:330)
at com.atlassian.confluence.setup.DefaultBootstrapManager.populateSynchronyConfiguration(DefaultBootstrapManager.java:298)
at com.atlassian.confluence.setup.DefaultBootstrapManager.afterConfigurationLoaded(DefaultBootstrapManager.java:509)
at com.atlassian.config.bootstrap.DefaultAtlassianBootstrapManager.init(DefaultAtlassianBootstrapManager.java:71)
at com.atlassian.config.util.BootstrapUtils.init(BootstrapUtils.java:36)
at com.atlassian.confluence.setup.ConfluenceConfigurationListener.initialiseBootstrapContext(ConfluenceConfigurationListener.java:127)
at com.atlassian.confluence.setup.ConfluenceConfigurationListener.contextInitialized(ConfluenceConfigurationListener.java:60)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4853)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5314)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.IOException: Permission denied
at java.io.UnixFileSystem.createFileExclusively(Native Method)
at java.io.File.createTempFile(File.java:2024)
at com.atlassian.config.xml.AbstractDom4jXmlConfigurationPersister.saveDocumentAtomically(AbstractDom4jXmlConfigurationPersister.java:92)
at com.atlassian.config.xml.AbstractDom4jXmlConfigurationPersister.saveDocument(AbstractDom4jXmlConfigurationPersister.java:82)
... 17 more
What am I doing wrong?
Have you tried via named volume (if using a docker version >= 1.9)?
$ sudo docker volume create --name confluenceVolume
$ sudo docker run -v confluenceVolume:/var/atlassian/application-data/confluence --name="confluence" -d -p 8090:8090 -p 8091:8091 atlassian/confluence-server
Add ENTRYPOINT script and use it. Example - https://github.com/AfsmNGhr/dockemacs/blob/master/Dockerfile#L34. See also - http://www.johnzaccone.io/entrypoint-vs-cmd-back-to-basics/.