Skip to content

Conversation

rainerWJY
Copy link
Collaborator

Describe what this PR does / why we need it

#2018

原理:
this.getClass().getClassLoader() 返回的是Spring Boot的LaunchedClassLoader
这个类加载器知道如何正确访问fat JAR中的嵌套资源
Playwright的资源查找依赖于当前线程的上下文类加载器

用这个规避 loadURI==null后的报错

Does this pull request fix one issue?

Describe how you did it

Describe how to verify it

Special notes for reviews

@github-actions github-actions bot added the area/jmanus SAA Jmanus module label Aug 7, 2025
…ring Boot support

- Added Playwright dependency versioning in pom.xml.
- Enhanced ChromeDriverService to support Playwright initialization in Spring Boot environments.
- Implemented browser type detection and configuration options for headless mode.
- Improved error handling and logging for Playwright instance creation.
…ght initialization

- Added detailed logging for class loader switching and Playwright instance creation.
- Implemented checks for browser and temporary directories post-creation.
- Enhanced environment setup with additional logging for system properties related to Playwright.
@rainerWJY rainerWJY changed the title B2043 fix(jmanus): fix the bug where Playwright cannot run when using the Spring Boot fat jar Aug 7, 2025
- 移除了特定于 Spring Boot 环境的代码
- 优化了浏览器驱动实例的创建过程
- 添加了对浏览器页面超时的配置支持
- 简化了错误处理逻辑
- 删除了未使用的 isSpringBootEnvironment 方法
@rainerWJY rainerWJY merged commit 87fbdf0 into alibaba:main Aug 8, 2025
11 checks passed
github-actions bot pushed a commit to Hipple/spring-ai-alibaba that referenced this pull request Aug 8, 2025
…pring Boot fat jar (alibaba#2059)

* feat(playwright): integrate Playwright for browser automation with Spring Boot support

- Added Playwright dependency versioning in pom.xml.
- Enhanced ChromeDriverService to support Playwright initialization in Spring Boot environments.
- Implemented browser type detection and configuration options for headless mode.
- Improved error handling and logging for Playwright instance creation.

* feat(playwright): enhance logging and directory checks during Playwright initialization

- Added detailed logging for class loader switching and Playwright instance creation.
- Implemented checks for browser and temporary directories post-creation.
- Enhanced environment setup with additional logging for system properties related to Playwright.

* up

* refactor(spring-ai-alibaba-jmanus): 重构 ChromeDriverService 类

- 移除了特定于 Spring Boot 环境的代码
- 优化了浏览器驱动实例的创建过程
- 添加了对浏览器页面超时的配置支持
- 简化了错误处理逻辑
- 删除了未使用的 isSpringBootEnvironment 方法

---------

Co-authored-by: rainerWJY <answeropensource@alibabacloud.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/jmanus SAA Jmanus module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants