How to configure Hudson base distribution? - hudson

I am a total newbie to the Hudson administration, so my question is very 101:
I downloaded hudson-3.0.0.war, which is said to be just the Hudson Core without any plugins included, and deployed it on my Apache Tomcat 7.0 server.
So Hudson as a web app is up, I can browse it, manage plugins via UI and so on.
But when I try to create my very first job as Build a free-style software project, I get the following exception:
HTTP Status 500 - java.lang.NoClassDefFoundError: org/eclipse/hudson/utils/tasks/MetaProject
type Exception report
message java.lang.NoClassDefFoundError: org/eclipse/hudson/utils/tasks/MetaProject
description The server encountered an internal error that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: java.lang.NoClassDefFoundError: org/eclipse/hudson/utils/tasks/MetaProject
I assume that a certain plugin is missing (although I would expect that even the base distribution included such a basic task, but never mind...).
I cannot figure out which plugin I have to install in order to enable the job creation between all available plugins.
I am really hoping to any assistance with this issue, which I shall appreciate very much.

It looks like you are missing a dependency. Add to the pom.xml the dependency:
<dependency>
    <groupId>org.eclipse.hudson</groupId>
    <artifactId>hudson-plugin-utils</artifactId>
    <version>3.0.1</version>
</dependency>

Related

Can I deploy a Grails 4 app to Google Cloud Platform?

I have been able to run through the following Grails 3 guide for deploying a Grails application to GCP.
https://guides.grails.org/grails-google-cloud/guide/index.html
I've tried to mirror this using my own Grails 4 application but it fails when I try to access it.
appengineDeploy completes successfully but when I try and access the webapp URL, I get a long stacktrace which culminates in the following error;
Failed to instantiate [org.grails.orm.hibernate.HibernateDatastore]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: com/mysql/cj/api/io/SocketFactory
...
...
Caused by: java.lang.ClassNotFoundException: com.mysql.cj.api.io.SocketFactory
I've been trying all sorts of various versions of the socket factory dependency to try and solve and redeploy but all result in the same error.
I have used various version of the j-6 connector (com.google.cloud.sql:mysql-socket-factory-connector-j-6) and my most recent attempt used the j-8 (1.0.14).
At this point it would be great to even know if what I'm trying is even possible. Java 11 support has been added quite recently and I have made the necessary config adjustments to get my app to deploy, but I cannot then access it.
Upgrading to version 8 of mysql-connector-java in tandem with mysql-socket-factor-connector-j-8 appears to have made this particular issue go away (and moved me to the next).
Dependencies are as follows;
runtime "mysql:mysql-connector-java:8.0.15"
runtime "com.google.cloud.sql:mysql-socket-factory-connector-j-8:1.0.14"

WSO2 ESB on Carbon 4.2 - Did not find the desired phase 'Transport' while deploying handler 'POXSecurityHandler'

I'm new to WSO2 ESB and would like to try it out for some external integrations.
I've installed the WSO2 Carbon 4.2 server and installed the ESB feature 4.8.1.
After a restart, I'm getting some errors as below.
Any tips or suggestions would be gratefully accepted.
Thanks.
[2014-03-06 10:01:08,521] INFO {org.wso2.carbon.mediation.initializer.ServiceBusInitializer} - Initializing Apache Synapse...
[2014-03-06 10:01:08,525] FATAL {org.wso2.carbon.mediation.initializer.ServiceBusInitializer} - Couldn't initialize the ESB...
org.apache.synapse.SynapseException: The synapse.xml location ././
./repository/deployment/server/synapse-configs
/default doesn't exist
at org.apache.synapse.SynapseControllerFactory.handleFatal(SynapseControllerFactory.java:121)
at org.apache.synapse.SynapseControllerFactory.validatePath(SynapseControllerFactory.java:113)
at org.apache.synapse.SynapseControllerFactory.validate(SynapseControllerFactory.java:88)
at org.apache.synapse.SynapseControllerFactory.createSynapseController(SynapseControllerFactory.java:44)
at org.apache.synapse.ServerManager.init(ServerManager.java:102)
at org.wso2.carbon.mediation.initializer.ServiceBusInitializer.initESB(ServiceBusInitializer.java:423)
at org.wso2.carbon.mediation.initializer.ServiceBusInitializer.activate(ServiceBusInitializer.java:182)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
...
...
...
[2014-03-06 10:01:08,531] INFO {org.wso2.carbon.rule.kernel.internal.ds.RuleEngineConfigDS} - Successfully registered the Rule Config service
[2014-03-06 10:01:08,553] ERROR {org.wso2.carbon.security.internal.SecurityMgtServiceComponent} - Failed to activate SecurityMgtServiceComponent
org.apache.axis2.phaseresolver.PhaseException: Did not find the desired phase 'Transport' while deploying handler 'POXSecurityHandler'.
at org.apache.axis2.phaseresolver.PhaseHolder.addHandler(PhaseHolder.java:75)
at org.apache.axis2.phaseresolver.PhaseResolver.engageModuleToFlow(PhaseResolver.java:68)
at org.apache.axis2.phaseresolver.PhaseResolver.engageModuleToOperation(PhaseResolver.java:104)
at org.apache.axis2.phaseresolver.PhaseResolver.engageModuleToOperation(PhaseResolver.java:110)
at org.apache.axis2.description.AxisOperation.onEngage(AxisOperation.java:152)
at org.apache.axis2.description.AxisDescription.engageModule(AxisDescription.java:478)
at org.apache.axis2.description.AxisService.onEngage(AxisService.java:827)
at org.apache.axis2.description.AxisDescription.engageModule(AxisDescription.java:478)
at org.apache.axis2.description.AxisServiceGroup.onEngage(AxisServiceGroup.java:134)
For the second exception -
"org.apache.axis2.phaseresolver.PhaseException: Did not find the desired phase 'Transport' while deploying handler 'POXSecurityHandler'."
This is because the 'Transport' phase is missing in the 'OutFaultFlow' of the axis2.xml. This is a recent addition hence it's missing when you did the feature installation. To fix this issue,
Search for the OutFaultFlow in the repository/conf/axis2/axis2.xml
In there, just after the 'Security' phase add the new entry 'Transport' as follows
.
<phase name="Transport"/>
Restart the server
Even though, WSO2 Carbon supports any feature installation via P2, there are some configurations not coming via the feature installation.
If you compare the ESB product with the customized product you have, you will see there are many differences in the config files. Please take a look at how ESB distribution is created.
There are two errors in your case.
org.apache.synapse.SynapseException: The synapse.xml location ././
./repository/deployment/server/synapse-configs/default doesn't exist
This means that it cannot find the synapse.xml in /repository/deployment/server/synapse-configs/default. This is missing as it comes via the product distribution.
org.apache.axis2.phaseresolver.PhaseException: Did not find the desired phase 'Transport' while deploying handler 'POXSecurityHandler'.
This probably means that Axis2 to cannot find the "Transport" phase required by a security component. The "Transport" phase is available in ESB 4.8.1 axis2.xml.
In summary, my personal opinion is that you should not try to install ESB features on WSO2 Carbon. If I need a product with multiple features, I would start with ESB first.
While feature installation provides you more flexibility, it will not always work smoothly. However there are many useful cases that we can install features on top of WSO2 Products.
I hope this helps.
For the first exception see the bug resolution comment at https://wso2.org/jira/browse/ESBJAVA-776
I also copied in the synapsis.xml file from the ESB distribution given by Isuru

Getting 'java.sql.SQLException: com.mysql.jdbc.Driver' with grails run-app (when BuildConfig.groovy doesn't need to be recompiled)

I've upgraded my grails application from 1.3.9 to 2.2.3 and then to 2.3.3. I read the release and upgrade notes for 1.3.9->2.2.3 and then from 2.2.3->2.3.3
I am using OpenJDK 6, Jetty 6 and the plugin jetty 1.1, MySQL 5.5 and I have the connector library under lib
Now my issue is if I run grails clean and then grails run-app the application runs without any problems but if I stop it and run grails run-app again I get a gigantic error (see here: http://pastebin.com/36MpXhir)
I also found that changing something like adding a space somewhere in BuildConfig.groovy (anything that makes it be recompiled) makes the application run normally.
Looking at the stacktrace the first thing that puzzles me is
[02.12.13 16:13:59.919] [main] pool.ConnectionPool Unable to create initial connections of pool.
java.sql.SQLException: com.mysql.jdbc.Driver
at org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:254)
at org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:182)
at org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:701)
at org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:635)
at org.apache.tomcat.jdbc.pool.ConnectionPool.init(ConnectionPool.java:486)
at org.apache.tomcat.jdbc.pool.ConnectionPool.<init>(ConnectionPool.java:144)
at org.apache.tomcat.jdbc.pool.DataSourceProxy.pCreatePool(DataSourceProxy.java:116)
at org.apache.tomcat.jdbc.pool.DataSourceProxy.createPool(DataSourceProxy.java:103)
at org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:127)
at org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy.afterPropertiesSet(LazyConnectionDataSourceProxy.java:162)
There are references to org.apache.tomcat even though I'm using jetty (and removed tomcat from BuildConfig.groovy).
Did anyone else encounter such a problem?
Don't put jar files in the lib directory if they're available in a public Maven repo. It's far better to download jars once and keep them in a local cache, and reuse them as needed.
The MySQL driver is used as the commented-out example in the generated BuildConfig.groovy - just un-comment it :) You might want to bump up the version to the latest, e.g.
dependencies {
runtime 'mysql:mysql-connector-java:5.1.27'
}
This is a good site for finding Maven artifacts: http://mvnrepository.com/artifact/mysql/mysql-connector-java
If you do have a jar that's not in a Maven repo (e.g. one with shared code at your company) then you can put it in the lib directory, but it's not auto-discovered. Run grails compile --refresh-dependencies to get it added to the classpath.
For me same error has occurred while running the Grails Application.Then I debug and view the code history of my code which was committed recently.
From that I found the issue that was:
Inside the controller file I send the instance with-out properly
Eg:
**def list=[personInstance.]---> error occurred.**
**render list as JSON**
Then I correct my mistake-->clean the app --> run the app
Now its working fine.

how can I be notified when a bundle throws an exception in osgi runtime? (equinox helios)

If a bundle throws an exception in osgi, the stack-trace is printed on the osgi console. I want to be notified if a bundle throws an exception. I thought using osgi logging service could help about it. However I could not get it to work under Helios.
The question is how can I be notified if a bundle throws an exception in osgi Helios.
Or if osgi logging does the work, how can I get osgi logging to work in Helios? As much as I googled, there is apparently no implementation of osgi loggin service currently integrated in helios. I downloaded the equinox skd 3.6 from eclipse site that contains the bundle org.eclipse.equinox.log, however I could add it as dependency to my plugins, or install it in the osgi runtime.
Any help is really appreciated.
A bundle can only throw an exception when it is invoked. This nearly always when some other bundle invoked one of your published services, or because the bundle received a callback from the framework such as BundleActivator.start().
In the first case, OSGi has absolutely no way to know that an exception happened! Service invocations are direct method calls between two objects, and are not brokered or proxied by the OSGi framework. Therefore if you want to find out about the exception, you must catch it in the calling code.
In the second case, callbacks happen because some bundle caused them to happen. For example, a bundle will be started because some other bundle called Bundle.start(). In this case, an exception thrown from the BundleActivator.start() method would be wrapped in a BundleException that could be caught by the calling code.
So it's really all down to your code, unless you have some third-party bundles that invoke your services or start/stop your bundles (e.g. a web console, or a shell like GoGo). In this case it's down to the third party code. In most cases they should send messages to the LogService, so you should install the log bundle into your framework.
You said that you couldn't install the log bundle, but you didn't say why it failed, what the error message was etc! This kind if information is important if you want help resolving the problem.
You could try Pax Logging and a custom Log4J appender - Pax Logging provides implementations of the OSGi LogService etc as well as wrappers for common logging frameworks.
Do you want to do this purely to log/notify exceptions, or is there some other reason? An UncaughtExceptionHandler might be what you want if it's a case of managing your own or wrapped code.

Groovy: deploying a war file

I have a groovy application running locally on my desktop.
Apparently it runs error free. At least all unit tests I wrote are fulfilled.
I want to deploy the application using a war file. For this I use the command
grails war
in the home directory of the application. When doing this I am getting the following exception:
Error executing script War: java.lang.NullPointerException
gant.TargetExecutionException: java.lang.NullPointerException
at gant.Gant$_dispatch_closure4.doCall(Gant.groovy:331)
at gant.Gant$_dispatch_closure6.doCall(Gant.groovy:334)
at gant.Gant$_dispatch_closure6.doCall(Gant.groovy)
at gant.Gant.withBuildListeners(Gant.groovy:344)
at gant.Gant.this$2$withBuildListeners(Gant.groovy)
at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source)
at gant.Gant.dispatch(Gant.groovy:334)
at gant.Gant.this$2$dispatch(Gant.groovy)
at gant.Gant.invokeMethod(Gant.groovy)
at gant.Gant.processTargets(Gant.groovy:495)
at gant.Gant.processTargets(Gant.groovy:480)
Caused by: java.lang.NullPointerException
at _GrailsWar_groovy$_run_closure5_closure25_closure26_closure28.doCall(_GrailsWar_groovy:289)
at _GrailsWar_groovy$_run_closure5_closure25_closure26_closure28.doCall(_GrailsWar_groovy)
at _GrailsWar_groovy$_run_closure5_closure25_closure26.doCall(_GrailsWar_groovy:282)
at _GrailsWar_groovy$_run_closure5_closure25_closure26.doCall(_GrailsWar_groovy)
at _GrailsWar_groovy$_run_closure5_closure25.doCall(_GrailsWar_groovy:258)
at _GrailsWar_groovy$_run_closure5.doCall(_GrailsWar_groovy:256)
at _GrailsWar_groovy$_run_closure4.doCall(_GrailsWar_groovy:239)
at War$_run_closure1.doCall(War.groovy:38)
at gant.Gant$_dispatch_closure4.doCall(Gant.groovy:324)
... 10 more
Any hint why?
Thanks a lot in advance
I think you'll have to find the source of Gant.groovy and see what it's doing on that line. Apparently there is some problem caused by your project's specific configuration (since such a show-stopper bug would have been caught if it always occurred), but the error message does not contain much information.
Alternatively, you could try upgrading Grails to the latest version 1.1.1 if you haven't already.