Skip to content

Commit 21f1915

Browse files
committed
Downgrade to Spring Boot 2.7.3
1 parent cb53ae0 commit 21f1915

File tree

11 files changed

+255
-184
lines changed

11 files changed

+255
-184
lines changed

pom.xml

Lines changed: 171 additions & 124 deletions
Original file line numberDiff line numberDiff line change
@@ -1,136 +1,183 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
4-
<modelVersion>4.0.0</modelVersion>
5-
<parent>
6-
<groupId>org.springframework.boot</groupId>
7-
<artifactId>spring-boot-starter-parent</artifactId>
8-
<version>3.2.0</version>
9-
<relativePath/> <!-- lookup parent from repository -->
10-
</parent>
11-
<groupId>org.phoebus</groupId>
12-
<artifactId>pvws</artifactId>
13-
<version>0.0.1-SNAPSHOT</version>
14-
<name>EPICS web socket server</name>
15-
<description>EPICS web socket server</description>
16-
<properties>
17-
<java.version>17</java.version>
18-
</properties>
19-
<dependencies>
20-
<dependency>
21-
<groupId>org.springframework.boot</groupId>
22-
<artifactId>spring-boot-starter-websocket</artifactId>
23-
<!--<exclusions>
24-
<exclusion>
25-
<groupId>org.springframework.boot</groupId>
26-
<artifactId>spring-boot-starter-logging</artifactId>
27-
</exclusion>
28-
<exclusion>
29-
<groupId>org.apache.logging.log4j</groupId>
30-
<artifactId>log4j-to-slf4j</artifactId>
31-
</exclusion>
32-
</exclusions>-->
33-
</dependency>
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
<parent>
6+
<groupId>org.springframework.boot</groupId>
7+
<artifactId>spring-boot-starter-parent</artifactId>
8+
<version>2.7.3</version>
9+
<relativePath/> <!-- lookup parent from repository -->
10+
</parent>
11+
<groupId>org.phoebus</groupId>
12+
<artifactId>pvws</artifactId>
13+
<version>0.0.1-SNAPSHOT</version>
14+
<name>EPICS web socket server</name>
15+
<description>EPICS web socket server</description>
16+
<packaging>${packaging.type}</packaging>
17+
<properties>
18+
<java.version>11</java.version>
19+
</properties>
20+
<dependencies>
3421

35-
<dependency>
36-
<groupId>org.springframework.boot</groupId>
37-
<artifactId>spring-boot-starter-logging</artifactId>
38-
<exclusions>
39-
<exclusion>
40-
<groupId>org.apache.logging.log4j</groupId>
41-
<artifactId>log4j-to-slf4j</artifactId>
42-
</exclusion>
43-
</exclusions>
44-
</dependency>
22+
<dependency>
23+
<groupId>org.springframework.boot</groupId>
24+
<artifactId>spring-boot-starter-websocket</artifactId>
25+
</dependency>
4526

46-
<dependency>
47-
<groupId>org.springframework.boot</groupId>
48-
<artifactId>spring-boot-starter-test</artifactId>
49-
<scope>test</scope>
50-
<!--<exclusions>
51-
<exclusion>
52-
<groupId>org.springframework.boot</groupId>
53-
<artifactId>spring-boot-starter-logging</artifactId>
54-
</exclusion>
55-
<exclusion>
56-
<groupId>org.apache.logging.log4j</groupId>
57-
<artifactId>log4j-to-slf4j</artifactId>
58-
</exclusion>
59-
</exclusions>-->
60-
</dependency>
27+
<dependency>
28+
<groupId>org.springframework.boot</groupId>
29+
<artifactId>spring-boot-starter-logging</artifactId>
30+
<exclusions>
31+
<exclusion>
32+
<groupId>org.apache.logging.log4j</groupId>
33+
<artifactId>log4j-to-slf4j</artifactId>
34+
</exclusion>
35+
</exclusions>
36+
</dependency>
6137

62-
<!--<dependency>
63-
<groupId>org.springframework.boot</groupId>
64-
<artifactId>spring-boot-test</artifactId>
65-
<exclusions>
66-
<exclusion>
67-
<groupId>org.springframework.boot</groupId>
68-
<artifactId>spring-boot-starter-logging</artifactId>
69-
</exclusion>
70-
<exclusion>
71-
<groupId>org.apache.logging.log4j</groupId>
72-
<artifactId>log4j-to-slf4j</artifactId>
73-
</exclusion>
74-
</exclusions>
75-
<scope>test</scope>
76-
</dependency>-->
38+
<dependency>
39+
<groupId>org.springframework.boot</groupId>
40+
<artifactId>spring-boot-starter-test</artifactId>
41+
<scope>test</scope>
42+
</dependency>
7743

78-
<dependency>
79-
<groupId>org.phoebus</groupId>
80-
<artifactId>core-pv</artifactId>
81-
<version>4.7.2</version>
82-
<exclusions>
83-
<exclusion>
84-
<groupId>org.tango-controls</groupId>
85-
<artifactId>JTangoServer</artifactId>
86-
</exclusion>
87-
<exclusion>
88-
<groupId>org.tango-controls</groupId>
89-
<artifactId>JTangoClientLang</artifactId>
90-
</exclusion>
91-
</exclusions>
92-
</dependency>
44+
<dependency>
45+
<groupId>org.phoebus</groupId>
46+
<artifactId>core-pv</artifactId>
47+
<version>4.7.2</version>
48+
<exclusions>
49+
<exclusion>
50+
<groupId>org.tango-controls</groupId>
51+
<artifactId>JTango</artifactId>
52+
</exclusion>
53+
<exclusion>
54+
<groupId>org.tango-controls</groupId>
55+
<artifactId>JTangoServer</artifactId>
56+
</exclusion>
57+
<exclusion>
58+
<groupId>org.tango-controls</groupId>
59+
<artifactId>JTangoClientLang</artifactId>
60+
</exclusion>
61+
<exclusion>
62+
<groupId>org.tango-controls</groupId>
63+
<artifactId>tango-idl-java</artifactId>
64+
</exclusion>
65+
</exclusions>
66+
</dependency>
9367

94-
<dependency>
95-
<groupId>com.fasterxml.jackson.core</groupId>
96-
<artifactId>jackson-core</artifactId>
97-
<version>2.16.0</version>
98-
</dependency>
68+
<dependency>
69+
<groupId>com.fasterxml.jackson.core</groupId>
70+
<artifactId>jackson-core</artifactId>
71+
<version>2.16.0</version>
72+
</dependency>
9973

100-
<dependency>
101-
<groupId>com.fasterxml.jackson.core</groupId>
102-
<artifactId>jackson-databind</artifactId>
103-
<version>2.16.0</version>
104-
</dependency>
105-
<dependency>
106-
<groupId>com.fasterxml.jackson.datatype</groupId>
107-
<artifactId>jackson-datatype-jsr310</artifactId>
108-
<version>2.16.0</version>
109-
</dependency>
74+
<dependency>
75+
<groupId>com.fasterxml.jackson.core</groupId>
76+
<artifactId>jackson-databind</artifactId>
77+
<version>2.16.0</version>
78+
</dependency>
79+
<dependency>
80+
<groupId>com.fasterxml.jackson.datatype</groupId>
81+
<artifactId>jackson-datatype-jsr310</artifactId>
82+
<version>2.16.0</version>
83+
</dependency>
11084

11185

112-
</dependencies>
86+
</dependencies>
11387

114-
<build>
115-
<plugins>
116-
<plugin>
117-
<groupId>org.springframework.boot</groupId>
118-
<artifactId>spring-boot-maven-plugin</artifactId>
119-
</plugin>
120-
<plugin>
121-
<groupId>org.mortbay.jetty</groupId>
122-
<artifactId>maven-jetty-plugin</artifactId>
123-
<version>6.1.10</version>
124-
<configuration>
125-
<scanIntervalSeconds>10</scanIntervalSeconds>
126-
<connectors>
127-
<connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
128-
<port>8080</port>
129-
<maxIdleTime>60000</maxIdleTime>
130-
</connector>
131-
</connectors>
132-
</configuration>
133-
</plugin>
134-
</plugins>
135-
</build>
88+
<profiles>
89+
<profile>
90+
<id>war</id>
91+
<activation>
92+
<activeByDefault>false</activeByDefault>
93+
</activation>
94+
<properties>
95+
<packaging.type>war</packaging.type>
96+
</properties>
97+
<dependencies>
98+
<dependency>
99+
<groupId>org.apache.tomcat.embed</groupId>
100+
<artifactId>tomcat-embed-websocket</artifactId>
101+
<scope>provided</scope>
102+
</dependency>
103+
<dependency>
104+
<groupId>org.apache.tomcat.embed</groupId>
105+
<artifactId>tomcat-embed-core</artifactId>
106+
<scope>provided</scope>
107+
</dependency>
108+
<dependency>
109+
<groupId>org.apache.tomcat.embed</groupId>
110+
<artifactId>tomcat-embed-el</artifactId>
111+
<scope>provided</scope>
112+
</dependency>
113+
</dependencies>
114+
<build>
115+
<finalName>pvws</finalName>
116+
<plugins>
117+
<plugin>
118+
<groupId>org.springframework.boot</groupId>
119+
<artifactId>spring-boot-maven-plugin</artifactId>
120+
<version>3.2.1</version>
121+
<configuration>
122+
<mainClass>org.phoebus.pvws.EpicsWebSocketServerApplication</mainClass>
123+
<layout>WAR</layout>
124+
</configuration>
125+
<executions>
126+
<execution>
127+
<goals>
128+
<goal>repackage</goal>
129+
</goals>
130+
</execution>
131+
</executions>
132+
</plugin>
133+
</plugins>
134+
</build>
135+
</profile>
136+
<profile>
137+
<id>jar</id>
138+
<activation>
139+
<activeByDefault>true</activeByDefault>
140+
</activation>
141+
<properties>
142+
<packaging.type>jar</packaging.type>
143+
</properties>
144+
<build>
145+
<finalName>pvws</finalName>
146+
<plugins>
147+
<plugin>
148+
<groupId>org.springframework.boot</groupId>
149+
<artifactId>spring-boot-maven-plugin</artifactId>
150+
<version>3.2.1</version>
151+
<configuration>
152+
<mainClass>org.phoebus.pvws.EpicsWebSocketServerApplication</mainClass>
153+
<layout>JAR</layout>
154+
</configuration>
155+
<executions>
156+
<execution>
157+
<goals>
158+
<goal>repackage</goal>
159+
</goals>
160+
</execution>
161+
</executions>
162+
</plugin>
163+
164+
</plugins>
165+
</build>
166+
</profile>
167+
</profiles>
136168
</project>
169+
170+
<!--<plugin>
171+
<groupId>org.mortbay.jetty</groupId>
172+
<artifactId>maven-jetty-plugin</artifactId>
173+
<version>6.1.10</version>
174+
<configuration>
175+
<scanIntervalSeconds>10</scanIntervalSeconds>
176+
<connectors>
177+
<connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
178+
<port>8080</port>
179+
<maxIdleTime>60000</maxIdleTime>
180+
</connector>
181+
</connectors>
182+
</configuration>
183+
</plugin>-->

src/main/java/org/phoebus/pvws/ApplicationConfig.java

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,8 @@
2222
import com.fasterxml.jackson.databind.DeserializationFeature;
2323
import com.fasterxml.jackson.databind.ObjectMapper;
2424
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
25-
import jakarta.servlet.ServletContextListener;
26-
import org.phoebus.pvws.ws.PvSocketHandler;
2725
import org.phoebus.pvws.ws.Vtype2Json;
2826
import org.phoebus.pvws.ws.WebSocket;
29-
import org.springframework.boot.web.servlet.ServletListenerRegistrationBean;
3027
import org.springframework.context.annotation.Bean;
3128
import org.springframework.context.annotation.Configuration;
3229
import org.springframework.context.annotation.Scope;
@@ -62,23 +59,10 @@ public List<WebSocket> getSockets() {
6259
return new CopyOnWriteArrayList<>();
6360
}
6461

65-
@Bean
66-
@Scope("singleton")
67-
public PvSocketHandler pvSocketHandler() {
68-
return new PvSocketHandler();
69-
}
70-
7162
@Bean
7263
@Scope("singleton")
7364
public Instant startTime() {
7465
return startTime;
7566
}
7667

77-
@Bean
78-
ServletListenerRegistrationBean<ServletContextListener> servletListener() {
79-
ServletListenerRegistrationBean<ServletContextListener> servletListenerRegistrationBean
80-
= new ServletListenerRegistrationBean<>();
81-
servletListenerRegistrationBean.setListener(new PvwsServletContextListener(getSockets()));
82-
return servletListenerRegistrationBean;
83-
}
8468
}

src/main/java/org/phoebus/pvws/EpicsConfiguration.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@
1919

2020
package org.phoebus.pvws;
2121

22-
import jakarta.annotation.PostConstruct;
2322
import org.phoebus.pv.PVPool;
2423
import org.springframework.beans.factory.annotation.Value;
2524
import org.springframework.stereotype.Component;
2625

26+
import javax.annotation.PostConstruct;
2727
import java.util.logging.Level;
2828
import java.util.logging.Logger;
2929
import java.util.prefs.Preferences;
@@ -48,21 +48,18 @@ public void init() {
4848

4949
// Set default type in preferences before PVPool reads the preferences
5050
String default_type = System.getenv("PV_DEFAULT_TYPE");
51-
if (default_type != null && !default_type.isEmpty()){
51+
if (default_type != null && !default_type.isEmpty()) {
5252
Preferences.userRoot().node("/org/phoebus/pv").put("default", default_type);
5353
}
5454
// Not set in environment, try application properties or command line
55-
else if(pvDefaultType != null && !pvDefaultType.isEmpty()){
55+
else if (pvDefaultType != null && !pvDefaultType.isEmpty()) {
5656
Preferences.userRoot().node("/org/phoebus/pv").put("default", pvDefaultType);
5757
}
5858
logger.log(Level.INFO, "PV_DEFAULT_TYPE=" + Preferences.userRoot().node("/org/phoebus/pv").get("default", null));
5959

6060

61-
62-
63-
6461
// Configure JCA/CAJ to use environment vars, not java properties or preferences
65-
System.setProperty("jca.use_env", "true");
62+
System.setProperty("jca.use_env", "false");
6663

6764
for (String name : new String[]
6865
{

0 commit comments

Comments
 (0)