Payara 4 to 5 upgrade via export/import failing - upgrade

I'm attempting to upgrade a Payara 4 instance to Payara 5 on Debian via the recommended method in the Payara Server 4 to 5 Migration Guide , specifically exporting the domain out from the Payara 4 one and then importing it again, using the following commands:
cd /opt/payara41/bin
sudo ./asadmin backup-domain --backupDir /opt/backups domain1
cd /opt/payara5/bin
sudo ./asadmin delete-domain domain1
sudo ./asadmin restore-domain --filename /opt/backups/domain1/domain1_2022_04_06_v00001.zip --long domain1
The import reports it completed successfully:
Restored the domain (domain1) to /opt/payara5/glassfish/domains/domain1
Description : domain1 backup created on 2022_04_06 by user root
GlassFish Version : Payara Server 4.1.2.172 #badassfish (build 235)
Backup User : root
Domain Name : domain1
Backup Type : full
Backup Config Name :
Backup Filename (origin) : /opt/backups/domain1/domain1_2022_04_06_v00001.zip
Domain Directory : /opt/payara41/glassfish/domains/domain1
Command restore-domain executed successfully.
However once I start the service back up (I've created a new service file as well but this is working fine) and try to load my application, the Payara control panel's logon page throws an SSL error, one of my two applications just shows a blank page, and the other throws a load of errors talking about the javac compiler failing, amongst others.
I was able to fix the control panel accessibility by changing the value of key-store="keystore.jks" to key-store="config/keystore.jks" in the domain.xml but this has made no change to the two applications - and in fact if I try viewing the list of installed applications within Payara 5 the page shows 0 installed and has an error box with a java.lang.NullPointerException message. Going to https://localhost:4848/management/domain/list-components shows the same NullPointer error, yet the application list is visible elsewhere in this /management/domain path (I forget the exact location off the top of my head, the point is that a different area is listing them).
The official guide states that the process of upgrading should be a simple export/import if you don't want to use any of the new features like H2 databases or HTTP/2, so I'm unsure how to proceed. Has anyone else seen this before?

For anyone who happens to find this, I believe I have solved it by replacing the default-web.xml file under the glassfish/domains/domain1/config directory with one from a fresh Payara 5 domain (i.e. one created from scratch in Payara 5, not Payara 4). There are several instances in this file of modules named jakarta rather than javax ; swapping it out appears to get Payara 5 to look in the right places for modules.

Related

Deployment to Websphere (WAS) - application has status 'unknown' after start

I am currently trying to get an application running on a Websphere Application Server [1] (commonly shortened to 'WAS') Docker image [2].
I can connect to the websphere online console (wsadmin) and use it to create a new Enterprise application based on a .war file. I created an application, decided not to run it in distributed mode, but kept the other settings to their default values. The application has been created successfully, I can see it under Applications > Websphere Enterprise Applications.
-But it has the application status 'unknown', which does not change if I start or stop it (neither starting nor stopping generates an error message in the online console).
So without any feedback and as a complete newby to WAS, I have no idea how to further deploy this application.
How can I get an application status, start the application or get at least an error message to make some progress?
EDIT 1
The log directory /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/server1 contains (_only) the following log files:
logdata
(multiple logs in the form) {id like 1628494344657_368}_server1
tracedata
1628494344624_368-server1.lock
List item
(multiple logs in the form) TextLog_{YY}.{MM}.{DD}_{hh}.{mm}.{ss}_server1.log
hpelRepository.owner
logViewer.pos
native_stderr.log
native_stdout.log
server1.pid
startServer.log
(multiple logs in the form) verbosegc.{index starting at 001}.log
Since I haven't found something like systemErr/Out.log, I have looked into most of the files. I didn't find an obvious error message at the end of these files (- the ones dated for today seemed to contain more useful information, like documents being created during deployment of my example application, I can add them if someone needs them to help me).
[1] Server Version: 9.0.5
[2] Docker image used: ibmcom/websphere-traditional#sha256:334dede7396a7ff372b048a974f676969e0d847ceba30b3e81b255a86bc42500

Stopping Wildfly Windows Service failed

as mentioned from the title i have a problem stopping the wildfly windows service.
When i tried to stop the wildfly service via the server manager - services window the status of the wildfly service doens't change to stop from stop pending. But wildfly isn't running anymore (my web service is not reachable and also the server log says that wildfly was successfully stopped). to start the service again i have to restart the windows server.
i've tested this with different scenarios:
Windows Server 2008 R2 Datacenter + Wildfly 9
Windwos Server 2012 Datacenter + Wildfly 10
Windows 7 + Wildfly 10
I also tried to make changes in the service.bat like Chris French mentioned on https://developer.jboss.org/thread/238135?tstart=0 but there is no change.
Interessting is that the problem doens't exists on any of the scenarios when i added the service without adding any deployments to wildfly (so just the blank server). What means that i am able to start and stop the wildfly service successfully from the server manager services window when the wildfly server is "blank" and without any changes (for e.g. in standalone.xml).
So i think the problem must be my java ee project which contains a web service and a simple persistent project to access different my sql databases. In the standalone.xml i just added the mysql driver and the databases and i do some edits in the interface section (ip adress changes).
Any Ideas? Do i have to made changes in different config files (for e.g. the service.bat) when im deploying something to wildfly?
Sorry for my english and thanks a lot!
When installing the WildFly service, make sure you have the following parameters specified:
In WildFly 8: /user <username> /password <password>
in WildFly 10: /jbossuser <username> /jbosspass <password>
In the services.bat the documentation reads:
/user: username for the shutdown command
/password: password for the shutdown command
According to my experience, without these parameters, WildFly will move to status "stopping", but will not stop.
That works for me:
1. Always run the CMD as admin first.
2. If your JBOSS_HOME environment is not set, get sure that you navigate to WildFly home directory before you execute the script.
For example: cd "C:\Program Files\wildfly
It's matter, because the service.bat takes your current dir (%CD%) as JBOSS_HOME, if it's not set.
3. You’ve to install the service with a special parameter. /controller
It’s important that you tell wildfly service on which port your wildfly admin console is running.
Take a look in standalone.xml, search for “management-http”, get sure that you use the same port in parameter.
Example: (Default port is 9990)
./bin/service/service.bat install /controller localhost:9990
Done. Now start the service and wait until you can reach the wildfly console page.
After try to stop or restart the service in service.msc or with service.bat (service.bat start/stop/restart).
I had similar issue but it turned out I needed a JAVA_HOME in standalone.conf.bat under bin folder. Simply uncomment the line that sets the JAVA_HOME variable and update its value with the desired path.
set "JAVA_HOME=C:\Program Files\Java\jdk1.8.0_121"
Above solution worked for me.
I had the "stopping" problem, when JAVA_HOME was set directly in jboss_cli.bat, pointing to the older jdk version previously installed on my machine. Check jboss_cli.bat for correct path of JAVA_HOME or simply use the JAVA_HOME environment variable (you might have to delete set JAVA_HOME line in jboss_cli.bat).

How to set up JAVA_OPTS for AspectJ to work in Tomcat running as a service on a Windows Server?

Problem
I need to integrate AspectJ code into an existing application running on Tomcat, but I think I am not setting JAVA_OPTS correctly.
Our vendor has created some AspectJ code that passes logged in user id information to the CONTEXT_INFO() object within MSSQLServer Connection. This is so that within an audit database trigger that we created, we can capture the user id that made the change.
What I have done
Added the following code to our database trigger
DECLARE #appUserID INT
SET #appUserID = ISNULL(REPLACE(CONVERT(VarChar(128), CONTEXT_INFO()),CHAR(0), ''), '0');
Added aspectjrt.jar to the web application WEB-INF\lib folder.
Added vendorAspectJCode.jar to the web application WEB-INF\lib folder.
Added aspectjweaver.jar to tomcat's lib folder \tomcat7.0.27\lib
Edited catalina.bat with the following:
there is a line of code that looks like this:
set JAVA_OPTS=%JAVA_OPTS% %LOGGING_CONFIG%
I have changed that to
set JAVA_OPTS=”%JAVA_OPTS% %LOGGING_CONFIG% -javaagent:D:\tomcat\tomcat7.0.27\lib\aspectjweaver.jar"
but it did not seem to work.
So then I have tried setting it like that, adding a new set JAVA_OPTS:
set JAVA_OPTS=%JAVA_OPTS% %LOGGING_CONFIG%
set JAVA_OPTS="-javaagent:D:\tomcat\tomcat7.0.27\lib\aspectjweaver.jar"
but that did not seem to do the trick either
After making the following changes and running a test through the web application front end, the user id that was inserted into the database was 0, so that tells me that something has not been done right and the part that I feel less comfortable with all of the steps above was Step 5.
Does anybody know if the syntax for setting JAVA_OPTS is correct?
or whether there is another place to put it?
After a lot of trial and error I found out how to integrate AspectJ in Tomcat running as a Service on a Windows server. I do not know why, but the bolded stuff was the cause to my problems.
Of course, as I mentioned in my question above you need the following prerequisites:
Add aspectjrt.jar to the web application WEB-INF\lib folder.
Add vendorAspectJCode.jar to the web application WEB-INF\lib folder.
Add aspectjweaver.jar to tomcat's lib folder \tomcat7.0.27\lib
Setting -javaagent:PathToMyAspectjweaver\aspectjweaver.jar in the service.bat did not work. So I had to set it in the registry along with uninstalling/installing the Tomcat service for changes to be picked up by doing as follows:
First I recommend turning UAC off and to make sure that you are an Administrator
Stop the Tomcat service if running.
Delete the tomcat service.
Verify in Windows Services that the service is no longer there.
Verify the Windows registry that everything related to the service got deleted. If not, do so manually.
Install the Tomcat service.
Verify in Windows Services that the service got created.
Find the service in the registry and edit the variable Options apppending the following:
-javaagent:PathToMyAspectjweaver\aspectjweaver.jar
I have created a couple of bat files for these steps. Steps 2 and 3 would look something similar to this below (TomcatServiceUninstall.bat):
echo OFF
ECHO Removing Tomcat Service...
sc stop YourServiceName
sc delete YourServiceName
ECHO Removing Registry Key containing config data for Tomcat7
REG DELETE "HKLM\SOFTWARE\Wow6432Node\Apache Software Foundation\Procrun 2.0\YourServiceName" /f
REG DELETE "HKLM\SOFTWARE\Wow6432Node\Apache Software Foundation\Tomcat\7.0" /f
ECHO Uninstall Complete - File Directories remain intact.
Step 6 would look like that (TomcatServiceInstall.bat)
ECHO OFF
ECHO Running Service.bat to install the Tomcat 7 - YourServiceName - Service
cd "C:\Path to your tomcat\tomcat7.0.27\bin"
service.bat install

Visual Studio cannot process a dimension

I'm trying to create a cube using SQL Server 2008 R2. When I tried to process a dimension, this error occurred:
The project could not be deployed to the 'wasim-PC/Joker' server
because of the following connectivity problems : A connection cannot
be made. Ensure that the server is running. To verify or update the
name of the target server, right-click on the project in Solution
Explorer, select Project Properties, click on the Deployment tab, and
then enter the name of the server.
I searched about a solution but I failed.
When you process a cube or dimension, its definition is first deployed to a server running SQL Server Analysis Services.
The error tells you that the deployment fails because it cannot find the service on 'wasim-PC/Joker'. I'm guessing this is your workstation. Make sure they analysis services service is installed and running on your local system. If you want to deploy to a different server, follow the steps specified in the error message.
I changed UAC Setting to "Never notify me" and every thing work well now! ( Windows 7 )

GlassFish 3.1 won't start from Eclipse

I'm using Linux, and I've installed GlassFish 3.1 outside of Eclipse. It starts fine with asadmin start-domain.
In Eclipse Helios I've installed the latest version of the GlassFish tools, server adapter etc. I've added a "Server" instance for my external GlassFish, but when I try to start it, the Eclipse Console says "Waiting for domain1 to start ......" – more and more dots are printed while I wait for several minutes. Eventually there's a dialog saying "Server GlassFish 3.1 at localhost failed to start."
At no point is http://localhost:8080 responding.
There is no other errors messages that I can find. The server log (glassfish/domains/domain1/server.log) prints the long startup command, and then:
Feb 28, 2011 10:48:45 PM com.sun.enterprise.admin.launcher.GFLauncherLogger info
INFO: Successfully launched in 3 msec.
The GlassFish installation is entirely stock, with no applications loaded. It works fine when started from the command line outside of Eclipse.
I've tried to reinstall GlassFish to different locations, I've reinstalled Eclipse with no plugins except the GlassFish stuff.
The strange thing is that the "Internal GlassFish 3.1" server, which is distributed with the Eclipse plugin and lives inside eclipse/plugins, works just fine and starts up very snappily. But I'd really like to have an external GlassFish that I can easily run independently of Eclipse when I want to.
Help much appreciated!
You can have detailed logs about what is going on :
go to "Window -> Preferences -> Glassfish Preferences".
There you can check the "Start Glassfish Enterprise Server in Verbose Mode".
I had problems starting Glassfish 3.1 from inside eclipse too.
I tried to delete the "osgi-cache/" subdirectory located in the domain directory and then i could successfully launch glassfish.
Hope it helps.
CLI130 Glassfish Error and Port 4848 in Use Error
Glassfish is written in Java and if the system's TCP/IP configuration isn't setup a certain way, Glassfish will choke when it makes a getLocaHost() call. A quick fix is:
Get the system's hostname and related IP
hostname
ifconfig -a
Add a line to /etc/hosts after the localhost line:
hostname ip-address-of-hostname
A Little More Background.....
If the local hostname (value returned from the "hostname" command) does not resolve to an IP address (e.g. "nslookup my-hostname") Glassfish will fail. The following Java app will expose this:
import java.net.*;
class Testnet {
public static void main() throws Exception {
InetAddress host = InetAddress.getLocalHost();
System.out.println ("host=" + host.getHostName());
System.out.println ("addr=" + host.getHostAddress());
}
}
The root cause could be any one of a number of issues:
The Local hostname (value returned from "hostname" command) does not resolve to an IP or valid IP
Misconfigured /etc/nsswitch.conf or /etc/hosts
There have been suggestions on the web that IPV6 only addressing messes up Java in Linux. To make sure this won't befall you, it can be set on most flavors of Linux with the following command (however the above Testnet app ran for us with bindv6only set to both 1 and 0):
sysctl -w net.ipv6.bindv6only=0
In terms of HA, having an entry for the local IP and hostname in /etc/hosts is a solid thing to do and to make sure "files" is the first entry in the list for "hosts" in /etc/nsswitch.conf. The downside to this is that each host needs to be setup with this line and it could cause problems with nodes that get their IP from DHCP or are randomly assigned when configured.
I've met the same problem as I was learning java web programming, but in netbeans - windows env. I've spent much time guessing what that error could mean because the log file wasn't clearly saying that.
Finally I found out that glassfish v3 was trying to run on 8080 port, which was already occupied by reportingservicesservice.exe which is sql server service.
go to (tools -> servers) add a new glassfish server instance which runs on a different, free port - that solved the problem.
The suggestion to delete "osgi-cache" worked for me on ONE machine (at work).
However on my home machine, neither that suggestion nor the suggestion to add my machine's hostname to the "hosts" file helped. Glassfish would start but Eclipse wouldn't recognize that...
The only thing that worked for me was:
go to the glassfish3/bin directory
execute "asadmin create-domain newdomain"
in this step, I was prompted for an admin username and password; I chose "admin" and "admin123" respectively
create a Glassfish server in Eclipse pointing to the new domain
Now I know that this may mean that the default domain (domain1) has some strange configuration, but that just doesn't seem right. Anyway, this did work for me, and now I can start Glassfish from within Eclipse - any Glassfish domain that I want.
HTH.
I'm using ubuntu 13.04 and had the same issue. I tried almost everything, but when i disabled IPv6 it worked. For ubuntu it's easy, just add following 3 lines to kernel parameters:
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
and run sudo sysctl -p. Good luck ;)
p.s. Don't forget to disable proxy server, set Active provider to Direct at General->Network connections.
Hum. Good news is that the internal server is working.
For the external one, first thing to test is if the server can be started outside Eclipse.
Check also the domain directory known by Eclipse (hint: server properties tab), and if the location is the one you want to use.
Maybe the domain has been started with a different Glassfish Server? In this case, make sure the osgi-cache/ directory in this domain is deleted first.
If the server works outside Eclipse, triple check the registration data of this server (runtime +domain) in Eclipse itself. In fact, try a new eclipse workspace...
Is this server secured with https?
I had the samere problem with Indigo + Glassfish 3.1 plug-in accessing an already working local standalone glassfish instance (with username 'admin' and my own password set).
Fortunately doing the following did the trick for me:
stop glassfish
delete osgi-cache content ( ${GLASSFISH_3.1HOME}/glassfish/domains/domain1/osgi-cache )
set my username ('admin' in my case) and reset passowrd (no password at all)
starting glassfish from within Indigo now works!