Defining Swagger configuration in XML, one can specify multiple schemes, e.g. "http,https". Documentation
When using Java configuration, there's only "scheme", not "schemes". I tried passing a comma-delimited string with "http,https", but that does not seem to work.
restConfiguration()
.component('servlet')
.apiContextPath('api-docs')
.scheme('https')
How does one specify multiple schemes, using Java?
Related
I'm part of a team building an API wrapper in Apex. Our service responses use snake case, but we wanted to follow style conventions and use camel case for our Apex variables. If the names don't match, however, the properties won't get set correctly upon deserialization of the response.
Does anyone know of a way to specify a particular name to use for serialization? In Java, we used Gson's SerializedName annotation (https://google.github.io/gson/apidocs/com/google/gson/annotations/SerializedName.html). I wasn't able to find anything similar for Apex, though.
I am trying to use the support that was added for specifying jars as runtime libraries when creating request handler's and other components. However, it is not clear to me from the documentation (https://cwiki.apache.org/confluence/display/solr/Adding+Custom+Plugins+in+SolrCloud+Mode) whether this only works through components created through the ConfigAPI or if it should also work if runtimeLib="true" is added to solrconfig.xml.
For example:
<requestHandler name="/browse" class="solr.SearchHandler" runtimeLib="true">
I added runtimeLib="true" to all of my searchComponents and requestHandlers in solrconfig.xml to see if it would work, but when starting the Solr instances, they all fail because they are looking for a class that is in a custom jar file. I've added the .system collection and uploaded the jars per the Solr Reference Guide/Wiki documentation and can see the .system collection and I can also see that my collection's configoverlay.json has the two jars I uploaded.
My collection's configoverlay.json contents
{"runtimeLib":{
"my-custom-jar":{
"name":"my-custom-jar",
"version":1},
"sqljdbc41-jar":{
"name":"sqljdbc41-jar",
"version":1}}}
Is specifying a runtimeLib attribute in solrconfig.xml supported? If so, what is the proper usage?
You're almost there. Further down on the page that you are linking to there is an example of creating a parser. The example uses completely different example values than the rest of the page, so I can understand why you may have glossed over it.
The point is, that you need to register your request handler using the curl command provided on the page. Unfortunately, you need to use a command that I had to dig into the source code to find: create-requesthandler. To create a request handler using your values above, I think you should issue the command
curl "http://{servername}:8983/solr/{collection}/config" -H 'Content-type:application/json' -d '{
"create-requesthandler": {
"name":"my-custom-jar",
"runtimeLib": true,
"class": "solr.SearchHandler"
}
}'
remember to replace the values of servername and collection. And change the port if you are using a non-default value.
Restart your solr server and the plugin should be available.
Sadly loading classes from plugins in managed schemas seems to be unsupported at the moment:
https://issues.apache.org/jira/browse/SOLR-8751
This probably means that you have to add it dynamically via the API as mentioned above. So the solution could be to use a minimal managed schema and add the fields requiring external jars afterwards.
For me, the simplest solution was not to use the Blob API at all, and directly add the required jars to the classpath of the Solr instance, as described here:
http://lucene.472066.n3.nabble.com/Problems-while-setting-classpath-while-upgrading-to-Solr-5-1-from-Solr-4-X-tp4209853p4209863.html
Is there a way to create custom objects and fields by using script or IDE ?
Salesforce is very easy to use, however, it's so time-consuming to create so many fields on Web interface. So, just wonder if there's ways to use script or IDE to create objects and fields in Salesforce?
You're looking for the Metadata API, or already developed tools which use the metadata api.
http://www.salesforce.com/us/developer/docs/api_meta/Content/meta_intro.htm
http://www.salesforce.com/us/developer/docs/api_meta/index.htm
Though using it directly will still require some developement, which may not save you much time. you get metadata in XML, but would still need to process it to what you want to achieve.
Somewhat also depend on the nature of what you want to do. I for instance had a requirement today for 150 custom labels based on an input file. Was much faster to generate metadata XML than to ever do that in the web interface. Deployed the metadata using the force.com IDE.
Hi i tried to develop an application using IPC in WebSpherePortal using two different war files.Am trying to transfer one bean object,for that i have placed one jar file in ../WebSpherePortal/PortalServer/shared/app. Even am getting class cast exception.Can any one answer this question.
What you attempted will not work. The classloader with WAS works generally so that every application is separated from each others. You can not share any classes because the classloaders will not be able to understand that the two classes - even when loaded from the same jar - are actually the same. What you need to do is to serialize ("implements Serializable", plus ensure that you really do serialize every Object) every Object before you share them.
Some approaches you could generally take are ICE or Spring Remoting.
I have a woodstox and and java SE 1.6 stax parser in the classpath but woodstox seems to get selected by default.
However in certain cases I'd like to use the default Java stax parser. Is there any way to specify which implementation to use?
Easiest way is to just directly instantiate one you want -- there is no need to use XMLInputFactory.newInstance(); for Woodstox you would instantiate com.ctc.wstx.stax.WstxInputFactory. For Sun implementation it is something else (com.sun.sjsxp or such) -- you can see class name if you instantiate it via Stax API when Woodstox jar is not in classpath.
But if you absolutely want to use indirection, value of system property "javax.xml.stream.XMLInputFactory" is used, as per javadocs: value is the name of class to instantiate.
I had a similar problem, my local jboss has woodstox in the path but the remote server don't (or something is not properly configured). So I chose to instantiate the reference implementation:
// Use BEA streaming parser to avoid runtime exceptions
XMLOutputFactory xmlof = new XMLOutputFactoryBase();