eclipse-ee4j / glassfish

Eclipse GlassFish
https://eclipse-ee4j.github.io/glassfish/
371 stars 138 forks source link

.Net is a prerequisite for create-service #14057

Closed glassfishrobot closed 13 years ago

glassfishrobot commented 13 years ago

Windows XP, Build 24. Treied to create a service. I.e. executed: asadmin create-instance --node localhost aa asadmin create-service --node localhost aa. Was seen such output:

C:\elena\glassfish3\glassfish\bin>asadmin create-service --node localhost aa CLASSPATH= C:\elena\glassfish3\glassfish\bin..\modules\admin-cli.jar Commands: [create-service, --node, localhost, aa] asadmin extension directory: C:\elena\glassfish3\glassfish\lib\asadmin Prepare Process program options Parsing program options Parse command options params: {node: [localhost] } operands: [aa] Prevalidate command options Inject command options Validate command options service name = aa asadmin --host localhost --port 4848 --interactive=true --echo=false --terse=fal se create-service --dry-run=false --force=false --node localhost aa Execute command TRACE: Source executable: C:\elena\glassfish3\glassfish\lib\winsw.exe TRACE: Copied from C:\elena\glassfish3\glassfish\lib\winsw.exe to C:\elena\glas sfish3\glassfish\nodes\localhost\aa\bin\aaService.exe TRACE: Target XML file written: C:\elena\glassfish3\glassfish\nodes\localhost\a a\bin\aaService.xml TRACE: ** Object Dump ** Class Modifiers Field Value

WindowsService private static final SOURCE_WIN32_EXE_FILENAME winsw.exe WindowsService private static final TARGET_DIR bin WindowsService private static final TEMPLATE_FILE_NAME Domain-service- winsw.xml.template WindowsService private sourceWin32Exe C:\elena\glassf ish3\glassfish\lib\winsw.exe WindowsService private targetDir C:\elena\glassf ish3\glassfish\nodes\localhost\aa\bin WindowsService private targetXml C:\elena\glassf ish3\glassfish\nodes\localhost\aa\bin\aaService.xml WindowsService private targetWin32Exe C:\elena\glassf ish3\glassfish\nodes\localhost\aa\bin\aaService.exe WindowsService private xmlFileCopy

TRACE: Uninstall STDERR: TRACE: Uninstall STDOUT: TRACE: No preexisting Service with that id and/or name was found Error while trying to install GlassFish as a Windows Service. The return value was: -2146232576. STDERR: STDOUT: Command create-service failed.

C:\elena\glassfish3\glassfish\bin>

===========================================

I did not see the messages that were described in the #13377. I think this is another problem

Environment

Operating System: All Platform: All

Affected Versions

[3.1]

glassfishrobot commented 5 years ago
glassfishrobot commented 13 years ago

@glassfishrobot Commented bnevins said: Native (.Net) code...

glassfishrobot commented 13 years ago

@glassfishrobot Commented easarina said: At least for this relaease has to be documented, for what windows machines create-service would not work.

glassfishrobot commented 13 years ago

@glassfishrobot Commented bnevins said: Sending server-mgmt\src\main\java\com\sun\enterprise\admin\servermgmt\services\ServiceAdapter.java Transmitting file data . Committed revision 41829.

SMF-Linux and Windows need to use different names. In Windows I was setting the Service's ID to a string with slashes. This is illegal in Windows. Simple fix is to set the "service name" to the name of the instance

SERVICE_NAME: i3 DISPLAY_NAME: i3 GlassFish Server

glassfishrobot commented 13 years ago

@glassfishrobot Commented easarina said: Build 25 10/21. Windows 2003 R2 machine.

The changes were impleted in this build, i.e. for a service qq that I was tried to create were created such id and name:

qq qq GlassFish Server

But when I've executed create-service command I still saw:

============================================

asadmin create-service --node localhost qq Error while trying to install GlassFish as a Windows Service. The return value was: -2146232576. STDERR: STDOUT: Command create-service failed.

So the bug was not fixed.

glassfishrobot commented 13 years ago

@glassfishrobot Commented bnevins said: Obviously you do NOT have the fix from yesterday...

C:\WINDOWS>asadmin create-service --node localhost qq The specified instance's directory does not exist: C:\glassfish3\glassfish\nodes\localhost\qq Command create-service failed.

glassfishrobot commented 13 years ago

@glassfishrobot Commented easarina said: The instance directory was created, i.e. the directory exists:

C:\elena\glassfish3\glassfish\nodes\localhost\qq>ls bin config

So you comment did not match the case.

And all changes that were mebtioned in this bug "Simple fix is to set the "service name" to the name of the instance"

That fix was implemented in the latest build. But create-service still doesn't work.

glassfishrobot commented 13 years ago

@glassfishrobot Commented bnevins said: Works fine or me. I think you didn't get all the fixes with the 10/21 4AM nightly.

Please email me if you have more problems.

Here is what I get with the latest build:

C:\glassfish3\glassfish\domains\domain1>asadmin create-local-instance qwerty Using DAS host localhost and port 4848 from existing das.properties for node localhost. To use a different DAS, create a new node using create-node-ssh or create-node-config. Create the instance with the new node and correct host and port: asadmin --host das_host --port das_port create-local-instance --node node_name instance_name. Rendezvoused with DAS on localhost:4848. Port Assignments for server instance qwerty: JMX_SYSTEM_CONNECTOR_PORT=28687 JMS_PROVIDER_PORT=27677 HTTP_LISTENER_PORT=28081 ASADMIN_LISTENER_PORT=24849 JAVA_DEBUGGER_PORT=29010 IIOP_SSL_LISTENER_PORT=23821 IIOP_LISTENER_PORT=23701 OSGI_SHELL_TELNET_PORT=26667 HTTP_SSL_LISTENER_PORT=28182 IIOP_SSL_MUTUALAUTH_PORT=23921

Command create-local-instance executed successfully.

C:\glassfish3\glassfish\domains\domain1>asadmin create-service --node localhost qwerty The Windows Service was created successfully. It is ready to be started. Here are the details: ID of the service: qwerty Display Name of the service:qwerty GlassFish Server Server Directory: C:\glassfish3\glassfish\nodes\localhost\qwerty Configuration file for Windows Services Wrapper: C:\glassfish3\glassfish\nodes\localhost\qwerty\bin\qwertyService.xml The service can be controlled using the Windows Services Manager or you can use the Windows Services Wrapper instead: Start Command: C:\glassfish3\glassfish\nodes\localhost\qwerty\bin\qwertyService.exe start Stop Command: C:\glassfish3\glassfish\nodes\localhost\qwerty\bin\qwertyService.exe stop Uninstall Command: C:\glassfish3\glassfish\nodes\localhost\qwerty\bin\qwertyService.exe uninstall Install Command: C:\glassfish3\glassfish\nodes\localhost\qwerty\bin\qwertyService.exe install You can verify that the service is installed (or not) with sc query state= all For your convenience this message has also been saved to this file: C:\glassfish3\glassfish\nodes\localhost\qwerty Command create-service executed successfully.

glassfishrobot commented 13 years ago

@glassfishrobot Commented easarina said: I've installed the same build on Windows 7 and create-service was executed successfully there. So I believe this is Windows 2003 issue. So I'm reopening the bug.

glassfishrobot commented 13 years ago

@glassfishrobot Commented bnevins said: 1) What happens when you run install/uninstall/start/stop If you don't know what I'm talking about look in PlatformServices.log in your Windows 7 instance dir

1B) What about "sc query state= all | grep your-instance-name" What do you see?

1C) Is the service appearing in Service Manager?

2) What happens when you run create-service on DAS on Windows 2003?

Assigning to you while waiting for answers.

glassfishrobot commented 13 years ago

@glassfishrobot Commented bnevins said: For that last item I mean:

asadmin create-service domain1 // what happens?

glassfishrobot commented 13 years ago

@glassfishrobot Commented bnevins said: -> P3

glassfishrobot commented 13 years ago

@glassfishrobot Commented bnevins said: Here is what my code does in a nutshell:

create an xml file (in the bin directory) create copies of Kohsuke's winsw.exe program and rename to instance-nameservice.exe also in the bin directory.

Now – you simply RUN that executable with one of the 4 commands:

start stop install uninstall

It works on my Windows machine. It works on your Windows machine. That means it works.

Are there things you can foul up in your environment so that it does not work? You bet! Simply run it as an unprivileged user! It obviously won't allow you to create a service.

The problem is the miserable messages emitted from winsw.exe. I can't fix that.

But you need to try lots of things before giving up so fast.

Can you create ANY service on this 2003 machine? Try installing some other service.

The error message for 2003 is crucial. You did not include it here. What did it say? Did it say something like access denied?

glassfishrobot commented 13 years ago

@glassfishrobot Commented easarina said: create-service command did not create any services. When I've tried to execute Service.exe, I saw a message that .Net Framework is not installed. I've attached a message.

I believe .Net Framework doesn't install by default on XP and Windows 2003 machines.

glassfishrobot commented 13 years ago

@glassfishrobot Commented easarina said: Created an attachment (id=5198) .Net Framework error message

glassfishrobot commented 13 years ago

@glassfishrobot Commented bnevins said: We use WinSW (open source project on Kenai) for managing services. WinSW requires .Net

That's that! If you want to run Services – you must have .Net installed.

Paul - assigning to you so you can document this requirement...

glassfishrobot commented 13 years ago

@glassfishrobot Commented pauldavies said: Changed subcomponent to docs. Set target milestone to MS 7.

glassfishrobot commented 13 years ago

@glassfishrobot Commented File: dotNetFramework.jpg Attached By: easarina

glassfishrobot commented 13 years ago

@glassfishrobot Commented Was assigned to pauldavies

glassfishrobot commented 7 years ago

@glassfishrobot Commented This issue was imported from java.net JIRA GLASSFISH-14057

glassfishrobot commented 13 years ago

@glassfishrobot Commented Reported by easarina

glassfishrobot commented 13 years ago

@glassfishrobot Commented Marked as fixed on Friday, December 10th 2010, 2:11:12 am