Grails Dashboard says I have no Services - sql

In the process of trying to troubleshoot my Grails SQL Issue, I just realized that the default Grails Splash page says I have 0 Services. I figured this is a separate issue so I made a new question. I'm on Grails 3.3.9. See attached picture. I'm using default scaffolded code here so my index page is calling my list method in the Service. What am I missing here? Service below (excuse my ignorance, I'm coming from Grails 2.3.11):
package TSTSupport
import grails.gorm.services.Service
import grails.gorm.transactions.Transactional
#Service(TST_Customer)
#Transactional
interface TST_CustomerService {
TST_Customer get(Serializable id)
List<TST_Customer> list(Map args)
Long count()
void delete(Serializable id)
TST_Customer save(TST_Customer TST_Customer)
}

Thanks to #JeffScottBrown, I realized that in Grails 3.3.9, the generate-all command creates a gorm data service which is different from a regular service (which is why Grails says I have 0 services). Using create-service is the way to go if you want the actual dashboard to recognize your services.

Related

override the `/graphql` endpoint using dropwizard and kotlin

I am using dropwizard and kotlin to implement the graphql endpoints. My project uses the code first approach to generate the schema.
The code runs fine but everytime I open the endpoint http://localhost:PORT- the by default playground url displays as http://localhost:PORT/graphql. I want to update this to http://localhost:PORT/api/graphql.
I tried to override the run method of GraphqlBundle class as mentioned here - https://github.com/smoketurner/dropwizard-graphql
But, still no luck. Can someone please help in this.

Cumulocity - get access to datapoint modal

I'm trying to get an access to datapoints in new cumulocity version. In older version such things as c8yDataPointSvc and schemaPropertiesSvc. I can't seem to find them anywhere. Basically I need components to work with datapoint as in the picture below. I would appreciate any info on how to either reuse those old components or a new way of using them as there is such.
Thanks a lot!
I see here three options. First what I am going to say is that we in Cumulocity use a hybrid approach for our core applications, since we have a lot of functionalities still written in AngularJS. Same as the one that you need. There is no equivalent in Angular yet. That is why you have several options to use those old services.
One is in a hybrid application to you a bridge service where you can define the upgraded c8yDataPointSvc like that -
constructor(
private ng1Injector: any,
...
) {}
get ng1DataPointSvc() {
return this.ng1Injector.get('c8yDataPointSvc');
}
This ng1Injector is a constructor input variable that we define when we provide that bridge service in the upgrade module like this:
{
provide: BridgeService,
useFactory: BridgeFactory,
deps: ['$injector', ...]
}
This way you will still have an Angular application, you will still use the provided from us factory c8yDataPointSvc in your Angular application just by upgrading it using anguar hybrid app upgrade functionality.
Other option is to just keep your widget an AngularJS one and when you have a hybrid app, you can just import the AngularJS widget and the angular compiler will take care of the upgrade/downgrade. This is what we are doing with a lot of our customers, who have angulatJS widgets and are using Cumulocity versions above 10.5.0.*
And the last option will be to not use the AngularJS services you need and using our SDK just implement the functionalities used from c8yDataPointSvc. But that will be the biggest effort probably.

How to write Java code using ther Jubula client API

I am new to the testing environment and have been searching for tutorials on Jubula client API.
Fortunately I have managed to find one, but still I am unable to launch my project. Till now I have installed the JUnit plugin in Jubula and configured the AUT on the standalone. Am I supposed to straight away make the JUnit unit test class or something else has to be done?
There is an FAQ on the Jubula Testing Portal about this:
http://testing.bredex.de/faqs/jubula-api-setup.html
You need to connect to the AUT first and map the objects from the app accordingly for usage and launch the test application.
Assign the variables or objects from the Swing or HTML and perform the required testing according to need.
For example:
public static final ComponentIdentifier btnFileExit = MakeR.createCI(Object from Jubula); //$NON-NLS-1$
Now, perform the required actions on the application and webpage, respectively.

ServiceLoader issue in WebLogic12c

I have been trying to refactor our Activiti implementation into using CDI but ran into a number of problems. I've spent way too much time trying to resolve this already, but I just can't let it go...I think I've pinned the problem down now, setting up a clean structured war without involving Activiti and have been able to reproduce what I think is the main problem.
Basically I have jar1 and jar2, both CDI enabled by including META-INF/beans.xml. Both jars specify a class in META-INF/services/test.TheTest pointing to implementations local to respective jar. jar1 depends on jar2. Also, both jars point to an implementation of javax.enterprise.inject.spi.Extension, triggering the scenario. In each implementation of Extension, I have a method like:
public void afterDeploymentValidation(
#Observes AfterDeploymentValidation event, BeanManager beanManager) {
System.out.println("In jar1 extension");
ServiceLoader<TheTest> loader = ServiceLoader.load(TheTest.class);
Iterator<TheTest> serviceIterator = loader.iterator();
List<TheTest> discoveredLookups = new ArrayList<TheTest>();
while (serviceIterator.hasNext()) {
TheTest serviceInstance = (TheTest) serviceIterator.next();
discoveredLookups.add(serviceInstance);
System.out.println(serviceInstance.getClass().getName());
}
}
Now, my problem is that the ServiceLoader does not see any implementations in either case when running WebLogic12c. The same code works perfectly fine in both Jboss 7.1.1 and Glassfish , listing both implementations of the test.TheTest interface.
Is it fair to assume that this is indeed a problem in WebLogic 12c or am I doing something wrong? Please bare in mind that I am simply trying to emulate the production setup we use when incorporating Activiti.
Regards,
/Petter
There is a Classloader Analysis Tool provided with WLS, have you seen if this will help with the diagnosis of your issue.
You can access this tool by going to ip:port/wls-cat/index.jsp
Where port will be the port of the managed server where your application is deployed.

Capture GlassFish log file into SQL/JPA data base

I need a little help getting started. I have a new JSF-2 web application that I intend to deploy under GlassFish 3.1 (or higher). Normally the server stores all its log files as text in one of its private directories, which also includes the logging I do with ether System.println( .. ) or something like java.util.logging.Logger.getLogger( ... )
What I want to do is instead of those logging entries going to the text file, capture them and file them into my SQL data base. I can then add table columns for timestamp and key values so it can be easily searched as part of the admin web page in the application, rather than having to go to the admin console for it. It would be possible also to expose some of that data to users.
Can this be done and how?
Follow up question: could this be done in a way that would be portable to Tomcat or another container?
You will need to write custom log handler. Custom log handler is a class that extends java.util.logging.Handler:
package test.stackoverflow;
import java.util.logging.Handler;
..
public class AlanHandler extends Handler {
..
#Override
public void publish(LogRecord record) {
//CODE THAT STORES LOG RECORD INTO THE DATABASE
}
}
Additionally, you will have to slightly change logging.properties file:
handlers=java.util.logging.ConsoleHandler, test.stackoverflow.AlanHandler
Deploy JAR of AlanHandler on Glassfish (as a library), restart the server and that should do it.