Port definition per Webservices at Glassfish 3.1 - glassfish-3

I have a war file contains two webservices helloService and Calculator.
Is it possible to establish these services at different port? For instance
http://localhost:8080/HelloService
http://localhost:8085/CalculatorService
I am using glassfish 3.1

I think it is nor possible, because a war file corresponds a component on which all service establihed same listener.

Related

ASP.NET Web api, multiple applications under same host name

Lets say that I have multiple internal ASP.NET web api applications. i.e.
http://service1.something.com/bob/bill
http://service2.something.com/pete
http://service3.something.com/dancing/dragon
I would like to expose these different services under a common host name
http://something.com/service1/bob/bill
http://something.com/service2/pete
http://something.com/service3/dancing/dragon
The reason I'm thinking of this setup is to allow each service to run a different set of middleware, but give the client a uniform URL structure to use. Each service can then be upgraded indepently of the others.
Ideally this should be using the latest version of ASP.NET and potentially hosted on Service Fabric. It doesn't have to run on the new core stack, the full .NET framework is acceptable.
I've read that the WebListener supports port sharing, so that is something I'm considering.
Suggestions?
Yes, you can do this with ASP.NET applications in Service Fabric:
service 1: http://something.com/service1/bob/bill
service 2: http://something.com/service2/pete
service 3: http://something.com/service3/dancing/dragon
As long as you use a web stack that supports port sharing. On windows, that means using a web stack that uses the http.sys kernel driver. Here are the web hosting options currently available for ASP.NET on Service Fabric:
The WebListener host in ASP.NET Core 1 is based on HttpListener which uses http.sys, so that will work.
Kestrel in ASP.NET Core 1 is not based on http.sys and to my knowledge does not support port sharing, so that won't work.
Katana uses HttpListener so that will also work.
Even in Azure Fabric every service should have different port - port sharing is available for service replicas (statefull) or multiple instances of the same service (stateless).
https://azure.microsoft.com/en-us/documentation/articles/service-fabric-service-manifest-resources/
Common way to have uniform URL structure is to create Api Gateway, which will call other services.
http://microservices.io/patterns/apigateway.html

Remote EJB in Domain mode WildFly

We are trying to lookup a remote EJB across wildfly running in domain mode with two nodes.
The setup is like this:
Wildfly Node 1:
Module A: EJB Client
Module B: Remote EJB
Wildfly Node 2:
Module A: EJB Client
Module B: Remote EJB
The wildfly nodes are part of a single domain.
Now, if we lookup the remote EJB across the nodes, it should return the EJB from the same node first, if it is available. Only if, it is not available, should the lookup return EJB from other node.
We have configured the EJB as clustered.
The problem is that even if we use "java:global" binding, the lookup is always returning the EJB from other node.
What configuration are we missing?
Have you tried configuring the JNDI properties for your InitialContext before doing the lookup? You can create a properties file and load at the moment to instantiate your InitialContext, in this file you can define the primary and secondary host that will be used to get the proxy, you can define this by a properties file or programmatically.
https://docs.jboss.org/author/display/AS71/EJB+invocations+from+a+remote+client+using+JNDI

Kettle client to invoke EJBs deployed in JBoss

I'm just starting with Kettle (PDI).
I want to know if it is possible to deploy EJB3 in JBoss AS 5.1.0, and then invoke EJBs from a remote client through KETTLE by using the JNDI API to first lookup the bean proxy and then invoke on that proxy?
Basically, I want to extract, transform and load data that was deployed to the application server through Kettle.
Thanks
Generally speaking you'd like to implement a normal stand-alone remote EJB client. This client is to be integrated into an (open source) ETL tool.
I would be very surprised if this does not work. If you managed to have a stand-alone remote client (sometimes tough enough), there could be one problem: Conflicting libraries: Normally a JBoss clients use jboss-client.jar, and its content may conflict with libraries provided by Kettle. But Kettle is open source, so with a little effort you could resolve this as well.

How to configure a Message Driven Bean to subscribe to a remote JMS Topic

I am trying to get a MessageDriven (EJB 3) bean to subscribe to a JMS Topic on another glassfish instance on another host. Is this possible?
In the Glassfish console you can modify the JMS server and point it to another Glassfish instance or a standalone OpenMQ broker. Although you can configure several JMS hosts to my knowledge Glassfish will always use the one called default_JMS_host so that's the one you want to edit.
Just one thing: in such a setup the two server instances will share queues and topics, which may not be what you want if the two servers are for example running the same application but don't want to share e.g a particular queue. This can easily be solved via the Destination Resources configuration, by specifying different physical names for that queue.

Call to EJB method from a remote jboss server(servlet)

case 1:
I'm having war in one jboss server and ejb jar in another jboss server.
I want to call my ejb from my servlet which is present in another server.
How to call it. can any one help me with a working sample and required configurations.
case 2:
Message Driven Bean(MDB) in my transaction jboss server and business method in another jboss server. How to call my business method from my transaction server.
kindly help me to solve this case
Thanks in advance
I can't (won't) help with a working example, but this is what you have to do:
Your EJBs (session beans) must be configured in a way to support remote access, RMI.
You have to export your EJB client classes into a separate JAR file; those are the interfaces and base classes required to perform an RMI call (stubs). This is required as clients (your WAR) must understand how to deserialize/serialize the RMI communication between your servlets and the remote EJBs.
Make the exported EJB client JAR available to your WAR file
Define an initial context pointing to your remote EJB server as described here.
Deploy and run it...
BTW: A personal opinion, RMI communication is painful and you should try to avoid it as it tightly couples the client (your WAR) to the remote EJBs.
EDIT: Which EJB version and which IDE do you use?

Resources