[
https://issues.apache.org/jira/browse/TOMEE-4654?focusedWorklogId=1032896&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-1032896
]
ASF GitHub Bot logged work on TOMEE-4654:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 29/Jul/26 19:11
Start Date: 29/Jul/26 19:11
Worklog Time Spent: 10m
Work Description: jungm commented on PR #2846:
URL: https://github.com/apache/tomee/pull/2846#issuecomment-5122386737
Good call — done in 3c75c91. `openejb.forceReadOnlyAppNamingContext` is back
to `false` by default, so nothing changes for existing applications, and the
TCK turns it on for its runs. I've retitled the PR and rewritten the
description to match, since it now adds the capability rather than flipping the
behaviour.
The lifecycle work from the last round stays: when the flag *is* set, the
contexts are marked at the end of `startEjbs`, so an EAR's late web modules are
covered and the container's own binds (`app/<module>/<bean>`,
`comp/EJBContext`, `comp/WebServiceContext`, `comp/TimerService`) all run
first. Also made the constant `public` so the harness can set it, opted
`JavaCompReadOnlyTest` into the flag explicitly, and restored
`EmbeddedTomEEContainerTest.testEjbCanCreateSubContextByDefault` to asserting
the write succeeds.
Full `openejb-core` suite after the flip: 4096 tests, 6 failures, all the
pre-existing security ones that reproduce on a clean `main`.
One consequence worth stating plainly: with the default off, TomEE still
deviates from EE.5.3.4 / Enterprise Beans 10.4.4 out of the box, so the
behaviour TOMEE-4654 reported is unchanged for anyone who doesn't set the flag.
Happy to leave it here and revisit the default for a major release, or file a
follow-up to track it — whichever you prefer.
The matching tomee-tck change (setting the flag in the TomEE config and
un-excluding the write tests) will be a separate PR there.
_🤖 Addressed by [Claude Code](https://claude.com/claude-code)_
Issue Time Tracking
-------------------
Worklog Id: (was: 1032896)
Time Spent: 50m (was: 40m)
> java:comp naming context accepts writes the Enterprise Beans spec requires it
> to refuse
> ---------------------------------------------------------------------------------------
>
> Key: TOMEE-4654
> URL: https://issues.apache.org/jira/browse/TOMEE-4654
> Project: TomEE
> Issue Type: Bug
> Reporter: Markus Jung
> Assignee: Markus Jung
> Priority: Major
> Time Spent: 50m
> Remaining Estimate: 0h
>
> The Enterprise Beans spec requires the java:comp context to be read-only
> inside a bean, and to throw {{OperationNotSupportedException}} on any write
> attempt against it. TomEE's naming context skips that check and lets bind,
> rebind, and rename calls through instead of refusing them.
> h2. Steps to reproduce / TCK reference
> Excluded in {{runner-webprofile/exclusions/enterprise-beans-30.txt}} in the
> apache/tomee-tck harness repo:
> * {{**/naming/context/*Test.java}}
> Once fixed, remove the matching lines and confirm the tests pass — each write
> attempt against java:comp must throw {{OperationNotSupportedException}}.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)