Trying to convert existing WCF service to Web Role can't deploy without errors - azure-cloud-services

I've converted existing WCF application to web role by adding it with "Add web role project in solution". Convert menu doesn't offer me option to convert. Our application requires .NET 4.6.1
Application runs fine on full emulator. However deployment fails with two scenarios:
osFamily attribute set to "5" in Serviceconfiguration(no .NET 4.6.1 installation script required):
19:15:16 - Instance 0 of role Severa.API is restarting
Details: [11/28T17:15Z]Failed to load role entrypoint. System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
at System.Reflection.Assembly.GetTypes()
at Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.GetRoleEntryPoint(Assembly entryPointAssembly)
--- End of inner exception stack trace ---
at Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.GetRoleEntryPoint(Assembly entryPointAssembly)
at Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.CreateRoleEntryPoint(RoleType roleTypeEnum)
at Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.InitializeRoleInternal(RoleType roleTypeEnum) Last exit time: [2016/11/28, 17:15:06.916]. Last exit code: 0.
osFamily attribute set to "4" in Serviceconfiguration with .NET 4.6.1 installation:
The feature named NetFx451 that is required by the uploaded package is not available in the OS * chosen for the deployment.
I've used the .NET installation script in other projects with success. Also I have added WebRole.CS class to the project.
Is the issue here that the webrole is not WCF type meaning some setting etc. is missing?

We've managed to identify and fix the issue.
I've enabled Fusion logging and immediately got the missing information.
What would have saved a lot of time and point us to right direction would have been to understand that web role in CS consists of two processes: WAIISHost which runs RoleEntryPoint code in startup and good old W3WP for the Web application itself.
WAIIShost can't read Web.config and requires an empty Web.config file named after name of the project and redeployed successfully. I followed instructions from this article:
Post about the issue

Related

Java Spring Boot: How to implement a JCo3 server with different message server

​Hi everyone one,
On my project, we are developing a spring boot application which is using JCo3.
It works fine for calling SAP from JAVA.
Now we are enhancing this application and we want to create a Jco server.
It will have to communicate with 2 different SAP system.
Each system have its own message server.
We customize each message server with several logon group according to our needs.
So we have created 2 classes to build up 2 Jco server one per system.
For server class, we hae base our development upon this blog:
https://blogs.sap.com/2017/08/25/sap-jco-server-example/
So we use a ServerDataProvider to use the parameters below
jco.server.connection_count=2
jco.server.progid=JCO_SERVER_SAP
jco.server.repository_map=SID(020)=S4
jco.server.mshost=myslanaddress.com
j
co.server.msserv=3601
jco.server.system_id=SID
We have 2 files to specify these parameters one per SAP system
The other system wil use a different progid.
When starting our application, everything goes well for the first bean instanciation.
As soon we arrived on the other, when trying to create the new Jco server
with for instance new progid JCO_SERVER_SAP and with new message server info)
with (server = JCoServerFactory.getServer(properties.getProperty(ServerDataProvider.JCO_PROGID));
The Constructor threw this exception; nested exception is com.sap.conn.jco.JCoRuntimeException: (136) JCO_ERROR_ILLEGAL_STATE: JCoServer JCO_SERVER_SAP is currently running. Current server state is STARTED
It is strange because in debug the progId is JCO_SERVER_CAR and not JCO_SERVER_SAP..
I foun this message (https://answers.sap.com/questions/12862862/how-to-implement-a-jco3-server-with-multiple-diffe.html) but I don’t know how to build such solution.
Do you have any clue ?
Thanks in advance for any help.
I tried to create and use
jco.server.repository_map
but it do not work.

Unable to build extended domain with WLS, Forms, Reports: expected directories not created

I am in the middle of building a 4-node application layer using WLS, Oracle Forms and Oracle Reports. I have built an ADMIN node and successfully built the RCU and have run config.sh.
I fully defined the entire domain (all 4 nodes) while running config.sh. I have copied and moved the domain definition to the 2nd node using pack & unpack.
When I attempt to install and build on the 2nd node (ADMIN does not run here), and run Forms and/or Reports for the first time, many directories are automatically created.
But some I expect to be created are missing.
For example:
$DOMAIN_HOME/config/fmwconfig/components/FORMS/instances/forms2/server/
did not get created.
What step did I miss here that results in some of the necessary directories not being created?
This is because the FORMS SystemComponents are not installed in the new instance locations under <domain_name>/config/fmwconfig/components/FORMS/<instance> and the FORMS components are not carried across by the pack command.
Re-running the config wizard will allow you to install the components on the new instances.
Alternatively, the instance definitions can be added on the Admin Server with WLST in offline mode only:
readDomain('<$DOMAIN_HOME>')
print('Create FORMS SystemComponent '+'forms2')
cd('/')
create('forms2', 'SystemComponent')
cd('/SystemComponent/'+'forms2')
cmo.setComponentType('FORMS')
set('Machine', machineName)
updateDomain()
closeDomain()
The above only works if the Managed Server shares the domain's filesystem with the Admin Server.
Also see:
https://github.com/galiacheng/oracle-forms-reports-weblogic-on-azure#create-managed-servers-and-forms-component

How do I publish multiple instances of an application to Service Fabric cluster from Visual Studio?

I have created a statless service fabric application in visual studio and need to publish two instances of it. The first goes well, but when i try to pusblish the second app i get the error:
2>Application Type DevelopmentType and Version 1.0.0 was already registered with Cluster, unregistering it...
2>Unregister-ServiceFabricApplicationType : Application type and version is still in use
2>At C:\Program Files\Microsoft SDKs\Service
2>Fabric\Tools\PSModule\ServiceFabricSDK\Publish-NewServiceFabricApplication.ps1:224 char:20
2>+ $reg | Unregister-ServiceFabricApplicationType -Force
2>+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2> + CategoryInfo : InvalidOperation: (Microsoft.Servi...usterConnection:ClusterConnection) [Unregister-Serv
2> iceFabricApplicationType], FabricException
2> + FullyQualifiedErrorId : UnregisterApplicationTypeErrorId,Microsoft.ServiceFabric.Powershell.UnregisterApplicatio
2> nType
2>
2>Finished executing script 'Deploy-FabricApplication.ps1'.
I want the instance to have the same ApplicationType, but when i publish with a new application name and a new publish profile i only get the error above.
The problem is that you're essentially trying to overwrite the existing app type with a new one but since the existing app type has an app associated with it, you get this error. In order to "overwrite" the app type, the system would need to delete it and register the new one. But it can't be deleted because it has an existing app associated with it. So that's why you get this error.
A little background on the difference between an application type and an application. It's sort of like the difference between a class and an instance in programming. An app type represents what an app can be. It contains the code, configuration, and data. But an app type is just a definition; it's not a running app. When you create an app, you create it to be based on an app type. Now you've got a running application. Just like the programming analogy, you can create multiple applications from one app type, which is what you're trying to do.
When you deploy from VS, it doesn't know your intention that you want to create a new application from an existing app type on the cluster. It assumes you want to deploy the application with the code that you've defined in your project. Since VS doesn't know how that code differs from what is on the cluster, it proceeds with attempting to remove any conflicting app type (an app type with the same name and version) in order to register a new app type with the code that was contained in your project. And that's when you run into the error.
So how do you resolve this? If your intention is really to just create another application from the existing app type, without any code differences between the two applications, then you'll need to handle this directly from PowerShell and not use VS. What you're trying to do is just basic management of your cluster. You'll want to use the New-ServiceFabricApplication PowerShell cmdlet (see https://learn.microsoft.com/en-us/powershell/servicefabric/vlatest/new-servicefabricapplication). Note that if you haven't configuration your application properly, you may run into port conflicts between the two applications. To avoid that, you'd want to parameterize your ports in your app manifest so that you can provide different port values when invoking New-ServiceFabricApplication.

How to connect to oracle from a java servlet?

I have a problem connecting to oracle from within a java servlet running in Jetty (as part of Eclipse). The identical code runs fine from a standalone java app.
My entire development environment is on a single mac. I am using Eclipse and have included the ojdbc6.jar in the main 'Referenced Libraries' and have also dragged and dropped this file in the war/web-inf/lib folder.
As soon as the line
OracleConnectionPoolDataSource ocpds = new
OracleConnectionPoolDataSource();
is called (within the servlet) I get the exception:
java.security.AccessControlException: access denied
(javax.management.MBeanServerPermission createMBeanServer)
Am I missing some security policy or so? If so, exactly what do I do need to do to rectify this? And where does this BeanServer come in?
Thanks in advance.
Every web container has its own way of defining data sources, and making them available through JNDI. You should do that instead.
The native oracle connection pool seems to be creating an MBeanServer, and this is not probably not allowed by the security manager used by Jetty. See http://wiki.eclipse.org/Jetty/Feature/Secure_Mode and http://wiki.eclipse.org/Jetty/Tutorial/Jetty-Policy.
Worked it out - not entirely clear why but created a new GWT app in Eclipse but this time NOT included the Google App Engine (which is ticked by default). This seems to add some restrictions to the code when it is running in Jetty....
I now have copied the sample code over and all is working well!

MVC3 site deployed on IIS6 stops working after 20 minuttes with 404 Not Found

I'll try to make this short, feel free to ask for more details.
A mobile edition a a web-site has been created using MV3 razor and deployed to an IIS6 web-server using extenstionless URL's. Since .NET4 is installed on the server there is no special configuration done on the server to get extensionless urls work. When I try to access the site with the URL: http://site/m/ i get a 404 Not Found error.
What I do to produce this problem:
Right-click on project in VS2010 and publish to local file system.
ZIP all files in and transfer to production server + unzip there
Right click on production web-site and add a virtual directory for the new application
Create a new application pool with all default settings
Put the new virtual directory/application in that application pool
Try to access the URL in the browser; receive 404 Not Found
The thing that puzzles me, is that if I replace Step 1 with "File->Create New MVC3 Project" and then publish to local file system everything works fine:
The test-project is displayed in the browser with the name i used http://site/mvctest/
I do not need to use any extensions
It does not stop working after 20 minutes (see next paragraph)
And now for the (even) weirder part:
If I now move the "m" application into the application pool just created for the "mvctest" application; it works too. But only for 20 minutes (or whatever value I have set for "Shutdown worker process after being idle for").
Any ideas?
EDIT: If I add wildcard mapping to the /m/ virtual directory it works, but that should/could also affect performance in a bad way?
it sounds like your first scenario the handler isn't setup to handle the mvc requests. IIS 6 needs to be integrated or an extension for MVC mapped.
Set the app pool up to run in integrated pipeline mode. What happens then? This should work. Also check the event log for rapid fail protection kicking in because of worker process resets.

Resources